Skip to content

fix(s08): recognize Anthropic prompt overflow errors - #561

Merged
CrazyBoyM merged 1 commit into
shareAI-lab:mainfrom
zmylol:fix/s08-prompt-too-long
Oct 27, 2026
Merged

CrazyBoyM merged 1 commit into
shareAI-lab:mainfrom
zmylol:fix/s08-prompt-too-long

Conversation

@zmylol

@zmylol zmylol commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

S08 now recognizes Anthropic's prompt is too long error and uses its existing reactive-compaction path to retry once. Previously that message bypassed recovery and propagated immediately. The change preserves the existing error markers and retry limit, synchronizes the three chapter READMEs, and adds five regression cases.

Fixes #560

Validation:

  • The new tests reproduced the bug before the fix: 2 failed, 7 passed in the S08 suite.
  • S08 and compaction-pair tests: 21 passed, 22 subtests passed.
  • The offline reproduction using the real SDK exception now follows API → reactive_compact → API.
  • Full Python suite: 486 passed, 1 failed, 100 subtests passed. The failure is the pre-existing progress-event ordering mismatch in test_s16_scenario_matches_the_deterministic_runtime, also reproduced on unmodified upstream main.
  • git diff --check and independent general/Python code reviews passed.

Prepared with AI assistance. Verification used mocked API responses without live model calls.

Recognize the documented prompt is too long message in the bounded reactive-compaction path. Synchronize all three chapter READMEs and add regression coverage for recovery, compatible markers, retry exhaustion, and unrelated errors.

Validation: 21 targeted tests and 22 subtests passed. Full suite: 486 passed, 1 pre-existing S16 scenario ordering failure, 100 subtests passed.

Refs shareAI-lab#560. Prepared with AI assistance.

@CrazyBoyM CrazyBoyM left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added prompt is too long predicate preserves the existing error markers and one-retry limit. The three READMEs agree. Context-compaction/tool-pair tests: 21 passed, 22 subtests passed, with a fake model client and no paid API calls. Prefer this tested implementation over duplicate #565.

AI-assisted maintainer review. Vercel statuses point to the account-blocked deployment notice, not a passing deploy. Combined local verification with resolved test/generated-data overlaps: 498 tests and 112 subtests passed.

@CrazyBoyM
CrazyBoyM merged commit d5cba86 into shareAI-lab:main Oct 27, 2026
0 of 2 checks passed
CrazyBoyM added a commit that referenced this pull request Oct 27, 2026
Incorporate #578, preserve #561's regression tests, and distinguish a complete request from a prefix of an older request. EN/ZH/JA examples stay synchronized.

Co-authored-by: ship <shiyipeng2002@163.com>
ruohai0925 pushed a commit to ruohai0925/learn-claude-code that referenced this pull request Nov 17, 2026
Recognize the documented prompt is too long message in the bounded reactive-compaction path. Synchronize all three chapter READMEs and add regression coverage for recovery, compatible markers, retry exhaustion, and unrelated errors.

Validation: 21 targeted tests and 22 subtests passed. Full suite: 486 passed, 1 pre-existing S16 scenario ordering failure, 100 subtests passed.

Refs shareAI-lab#560. Prepared with AI assistance.
ruohai0925 pushed a commit to ruohai0925/learn-claude-code that referenced this pull request Nov 17, 2026
…eAI-lab#603)

Incorporate shareAI-lab#578, preserve shareAI-lab#561's regression tests, and distinguish a complete request from a prefix of an older request. EN/ZH/JA examples stay synchronized.

Co-authored-by: ship <shiyipeng2002@163.com>
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.

[s08] Reactive compaction does not recognize Anthropic's "prompt is too long" error

2 participants