Skip to content

fix(agent): reject non-digit compact dates in chat history - #150

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-953d
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-953d

Conversation

@cursor

@cursor cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

Summary

  • chat_history / chat_plan crash the agent process when the LLM passes a localized 8-byte date such as 2026年9 or 2026-9月.
  • normalize_date treated any 8-byte string as YYYYMMDD and sliced at byte indexes 4/6, which is mid-character for those CJK forms. There is no catch_unwind on the builtin tool path.
  • Fix: only compact 8 ASCII digits are rewritten as YYYY-MM-DD. Other values pass through and miss the file instead of panicking.

Task Linkage

  • Task ID: TASK-2026-071
  • Task folder: tasks/TASK-2026-071-utf8-chat-date-normalize/

Injected Specs

  • spec/verification-integrity.md
  • spec/task-artifact-language.md
  • spec/rust-conventions.md
  • spec/testing-policy.md
  • spec/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

  • Commands executed:
    • cargo test -p skilllite-agent --lib extensions::builtin::chat_data::tests (before fix): 1 passed, 3 failed with byte index 6 is not a char boundary inside /
    • Same command after fix: 4 passed
    • cargo test -p skilllite-agent: 251 passed
    • cargo fmt --check: clean
    • cargo clippy --all-targets -- -D warnings: clean
    • cargo test: all workspace packages ok, 0 failed
    • python3 scripts/validate_tasks.py: passed (71 task directories)
  • Key results:
    • 20260902 / 2026-09-02 still normalize to 2026-09-02
    • 2026年9 and 2026-9月 no longer panic; tools return Ok

Regression Scope

Docs Sync (EN/ZH)

  • Not needed
  • Tool schema already documents YYYY-MM-DD or YYYYMMDD.

Review Checklist

  • Acceptance criteria in tasks/TASK-2026-071-utf8-chat-date-normalize/TASK.md satisfied
  • STATUS.md updated with latest progress
  • REVIEW.md includes merge readiness decision
  • tasks/board.md status is up to date
Open in Web View Automation 

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant