fix(agent): reject non-digit compact dates in chat history - #150
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
chat_history and chat_plan treated any 8-byte date as YYYYMMDD and sliced at byte indexes 4/6. Localized values such as 2026年9 panic and crash the agent. Only compact ASCII digits are normalized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chat_history/chat_plancrash the agent process when the LLM passes a localized 8-byte date such as2026年9or2026-9月.normalize_datetreated any 8-byte string asYYYYMMDDand sliced at byte indexes 4/6, which is mid-character for those CJK forms. There is nocatch_unwindon the builtin tool path.YYYY-MM-DD. Other values pass through and miss the file instead of panicking.Task Linkage
TASK-2026-071tasks/TASK-2026-071-utf8-chat-date-normalize/Injected Specs
spec/verification-integrity.mdspec/task-artifact-language.mdspec/rust-conventions.mdspec/testing-policy.mdspec/architecture-boundaries.md(if architecture/layering changed)spec/security-nonnegotiables.md(if sandbox/security changed)spec/docs-sync.md(if behavior/docs/env/commands changed)Validation Evidence
cargo test -p skilllite-agent --lib extensions::builtin::chat_data::tests(before fix): 1 passed, 3 failed withbyte index 6 is not a char boundaryinside年/月cargo test -p skilllite-agent: 251 passedcargo fmt --check: cleancargo clippy --all-targets -- -D warnings: cleancargo test: all workspace packages ok, 0 failedpython3 scripts/validate_tasks.py: passed (71 task directories)20260902/2026-09-02still normalize to2026-09-022026年9and2026-9月no longer panic; tools returnOkRegression Scope
chat_historyandchat_plandate-to-filename lookupDocs Sync (EN/ZH)
YYYY-MM-DDorYYYYMMDD.Review Checklist
tasks/TASK-2026-071-utf8-chat-date-normalize/TASK.mdsatisfiedSTATUS.mdupdated with latest progressREVIEW.mdincludes merge readiness decisiontasks/board.mdstatus is up to date