Race the tool round against abort, check abort before starting tools,
answer pending calls with an aborted result, deny permission prompts on
abort, and kill the bash process group on drop.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Classify every comment as tautology, stale, excuse or decision record.
Tautology/stale/excuse comments are deleted (excuses filed as issues
#196-#236), decisions moved to docs/adr/0001-0034.
- scripts/lint-comments.sh + .comment-baseline: per-file comment count
may only go down; wired into tests/all.sh
- .claude/skills/delete-comment: repeatable audit workflow
- cargo fmt applied to touched crates
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- ToolResult carries images; agent attaches them after tool results; read returns real images
- inner codemode calls reported as Info notices via State::nested
- searchTools/ALL_TOOLS/describeNamespace, tools.x.json/.raw, exit()
- store()/load() across calls, max_output_tokens, 2-script concurrency cap
- script ends when settled; unawaited calls cancelled; failure lists calls made
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Token counting, the compaction trigger and the masking schedule lived in
Agent's private fields plus mask.rs, compact.rs, stats.rs and the TUI.
Move them behind one module with view/record/reset/tokens, so the
reset-together invariant and the mask-boundary rule have one owner.
- Agent holds a ContextWindow instead of compact_at/ctx/mask_boundary
- TUI shows Agent::context_tokens() (real reading + estimate), matching
the compaction trigger instead of the bytes/4 guess
- stats replay goes through ContextWindow::masked
- ContextMeter/estimate_tokens move into the module; mask is crate-private
- tests at the ContextWindow interface replace the meter unit test
- Agent: make session/usage/provider/model/system/max_tokens/compact_at
private; add set_provider, set_model, replace_session, fork, clear,
fit_window. Fixes stale context-token reading after resume/new session.
- hx-core::compact: ContextMeter, plan/apply and estimate_tokens split out
of agent.rs, testable without provider or session.
- hx-core::switch: Switcher shared by TUI and RPC for model/provider
switches; RPC set_model now also refits the compaction threshold.
- hx-tui: status.rs (footer, /usage as pure functions), popup.rs, and
Picker::key returning an Act.
- tests/tui_smoke.py: resolve the temp dir (macOS /var symlink) and match
the resume via the OSC window title instead of split screen text.