Reports from david_66 on Discord: sessions get perceived as 'stuck' when
context usage crosses the 78% threshold. Investigation confirmed two
issues in the preemptive compaction hook:
1. PREEMPTIVE_COMPACTION_TIMEOUT_MS was 120s. While the summarize
request is in flight, tool.execute.after short-circuits via the
compactionInProgress guard. A hung summarize blocked the session
for two full minutes before giving up, which users reasonably
experience as a hang.
2. On failure (timeout or exception) only a log line was emitted. The
user had no visibility into why their session was unresponsive or
why auto-compaction never ran, so a transient upstream error could
silently leave them well above the threshold with no signal.
Fix:
- Reduce timeout 120s -> 60s. Still gives the upstream a generous
window, but caps the worst-case perceived hang at one minute.
- Show a warning toast via ctx.client.tui.showToast whenever the
catch block fires, including the underlying error string so users
can act (retry, manual /compact, or adjust provider).
- Include providerID/modelID in the Compaction failed log entry so
wild failures are easier to correlate to a specific target model.
Two existing failure-path assertions were updated to match the new
log shape and a new test covers the toast notification contract.
Discord report: https://discord.com/channels/1452487457085063218/1490536332961906829/1491345441399505037
- Add afterAll(() => { mock.restore() }) to 52 test files missing cleanup
- Rewrite create-tool-guard-hooks.test.ts to use spyOn instead of barrel mock
- Fix skill-mcp-manager OAuth tests with missing mockTokens/mockLogin definitions
- Fix start-work hook: show worktree active block on resume with existing worktree_path
- Extract createWorktreeActiveBlock to worktree-block.ts to avoid circular import
- Replace 80-line isolated test runner CI config with single `bun test` command
lastCompactionTime was only set on successful compaction. When compaction
failed (rate limit, timeout, etc.), no cooldown was recorded, causing
immediate retries in an infinite loop.
Fix: set lastCompactionTime before the try block so both success and
failure respect the cooldown window.
- test: add failed-compaction cooldown enforcement test
- test: fix timeout retry test to advance past cooldown
- fix(switcher): use lastIndexOf for multi-slash model IDs (e.g. aws/anthropic/claude-sonnet-4)
- fix(model-resolution): same lastIndexOf fix in doctor parseProviderModel
- fix(call-omo-agent): resolve model from agent config and forward to both
background and sync executors via DelegatedModelConfig
- fix(subagent-resolver): inherit category model/variant when agent uses
category reference without explicit model override
- test: add model override forwarding tests for call-omo-agent
- test: add multi-slash model ID test for switcher
compactedSessions permanently blocked re-compaction after first success,
causing unbounded context growth (e.g. 500k on Kimi K2.5 with 256k limit).
- Clear compactedSessions flag on new message.updated so compaction can
re-trigger when context exceeds threshold again
- Use modelContextLimitsCache for model-specific context limits instead
of always falling back to 200k for non-Anthropic providers