Resolve Claude Code multi-questions & Add auto-compact - #53
Open
daocha wants to merge 7 commits into
Open
Conversation
dcha-agent
force-pushed
the
improve-claudecode
branch
from
August 19, 2026 17:35
086e1c1 to
001bb77
Compare
Adds a per-provider idle-gap check (Claude/Codex/Copilot) that warns and offers to /compact before resuming a session whose native prompt cache has likely expired, plus incrementing -resumeN naming for compacted sessions. Documents both this and the claude --resume/FAQ notes across all localized READMEs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Qo58kKphHpzkoPznNKpCs
Adds the five runtime.long_gap_* keys (used by the new idle-session compact/proceed prompt) to every locale catalog, not just en.json. Also rewrites the zh-HK FAQ addition from Cantonese phrasing to standard written Traditional Chinese, matching the zh-TW convention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Qo58kKphHpzkoPznNKpCs
- Critical: "Proceed anyway" re-triggered the same idle warning forever instead of ever running the message, since the native transcript's mtime doesn't move until the agent actually runs a turn. Added a skip_long_gap_check bypass for both button replays. - Compact failure or a busy workspace no longer silently drops the held message; it now falls through to _process_user_message so it either runs or gets properly queued. - Blocking filesystem/sqlite lookups in the gap check now run via asyncio.to_thread instead of on the event loop. - Fixed a provider-normalization fallback gap and de-duplicated the session-naming and Codex state-db-path logic flagged by review. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Qo58kKphHpzkoPznNKpCs
- handle_photo now goes through the same long-gap check as text messages instead of bypassing it entirely (was dispatching straight to run_active_session). - Fixed message reordering: replaying a held long-gap message no longer re-runs the should-queue check, so it can't get pushed behind messages that queued up while the confirmation prompt was open. A genuinely busy workspace is still handled explicitly so nothing gets silently dropped. - Added a per-provider "is this session even big enough to matter" size gate (Codex: its local session db's cumulative tokens_used column; Claude: a bounded tail-read of the last assistant turn's usage) so idle sessions with little accumulated context don't trigger the warning. - Retuned idle-time defaults per provider based on each CLI's actual documented behavior instead of one-size-fits-all: Codex raised from 10 to 30 minutes (no official number exists either way, and the size gate now filters small sessions, so favor fewer interruptions); Copilot disabled by default (GitHub's docs confirm no inactivity timeout and native auto-compaction at ~80-95% context, so there's nothing idle-related to warn about -- defer to Copilot's own mechanism). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Qo58kKphHpzkoPznNKpCs
Raised CODEX_LONG_GAP_SECONDS from 30 to 60 minutes to match Claude: Codex's own prompt cache is generally shorter-lived than Claude's anyway, so the larger threshold costs nothing in accuracy and just means fewer interruptions, especially now that the size gate filters small sessions. Also brings all 10 localized READMEs in sync with the size-gate feature and the Codex/Copilot threshold changes from the previous commit (they still had the old "10 minutes" numbers and rationale). No locale JSON changes needed -- that round didn't introduce any new translatable strings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Qo58kKphHpzkoPznNKpCs
Found via manual re-review: unlike text messages, handle_photo never checked for an existing pending_action before proceeding. A photo sent while a text message's long-gap compact/proceed confirmation was still awaiting a button press would silently overwrite that pending_action with the photo's own data -- orphaning the original warning's buttons (pressing them would run the photo's content instead) and losing the original text message. Photos can't be queued like text (_enqueue_chat_message is text-only), so handle_photo now rejects with a clear message instead of overwriting. Added a regression test, confirmed it fails without the fix. Also translated the new message key into all 10 locales. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Qo58kKphHpzkoPznNKpCs
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.
No description provided.