Skip to content

Resolve Claude Code multi-questions & Add auto-compact - #53

Open
daocha wants to merge 7 commits into
developfrom
improve-claudecode
Open

Resolve Claude Code multi-questions & Add auto-compact#53
daocha wants to merge 7 commits into
developfrom
improve-claudecode

Conversation

@daocha

@daocha daocha commented Jul 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

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
@daocha daocha changed the title Resolve Claude Code multi-questions Resolve Claude Code multi-questions & Add auto-compact Sep 8, 2026
dcha-agent and others added 5 commits September 8, 2026 23:33
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
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.

2 participants