Skip to content

fix(s08): prevent active request loss after snip_compact - #578

Open
ship-onward wants to merge 1 commit into
shareAI-lab:mainfrom
ship-onward:fix/s08-preserve-active-request
Open

ship-onward wants to merge 1 commit into
shareAI-lab:mainfrom
ship-onward:fix/s08-preserve-active-request

Conversation

@ship-onward

Copy link
Copy Markdown
Contributor

Summary

Fixes #577

snip_compact() may archive the current user request during a long tool-use loop,
causing the agent to fall back to an older request.

This PR ensures that the active request remains visible after compaction.

Changes

  • Preserve the current active_request during snip_compact
  • Add a regression test for long tool-use conversations
  • Keep the existing context compaction flow unchanged

Testing

  • Added/updated tests/test_s08_context_compact.py
  • Reproduced the original three-prompt scenario
  • Confirmed Prompt 3 no longer falls back to Prompt 1
  • Existing behavior remains unchanged

AI Assistance

AI tools were used to assist with debugging and code review.
I reviewed, tested, and understand the submitted changes.

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
…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>

This branch has not been deployed

No deployments
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_context_compact] Current user request may be lost after snip_compact

1 participant