Adds a new 'consult' tool that makes single tool-less calls to a configured
consultant model. The feature includes:
- Consult backend (consult.rs) with permission checks
- Call limit (default 5 per session) tracked in State
- Three nudge triggers: before exit_plan, after edits, after 3 failed tools
- Side-panel card showing consultant status and call count
- Config keys: consultant = "<model>" to enable; consultant_max_calls for limit
- All nudges are always on; disable by unsetting the consultant config
The consultant model sees the question and context (passed by itself since the
tool has no context visibility). Token usage counts toward subagent quotas.
- hx -p --schema <file> validates the final answer against a JSON schema,
with one retry that includes the validation errors
- max_turns config key and --max-turns cap the main agent's model calls
- hx --mode rpc --ask sends permission requests to the client instead of
auto-allowing bash/write/edit calls
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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>
- Replace bare string with Editor in choose.rs typing input
- Support ←/→ (left/right arrow keys) for cursor movement
- Add Home/End, ctrl-a/ctrl-e, Delete, Up/Down between lines
- Keep ctrl-w (kill word), add ctrl-u (kill line)
- Render cursor marker ▏ at actual position in multi-line answers
- Update help text to mention cursor movement
- Add test: type, move cursor, insert character mid-text
Also: delete 4 comment lines from scripts/lint-comments.sh (tautology).
Co-Authored-By: Claude Haiku 4.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>
Tables are drawn as box-drawn grids that wrap to the terminal width,
falling back to header: value lists when too narrow.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JSON-RPC on stdio with permission requests, hx/step|message|interrupt|compact
in and hx/step_result|intent|edit|usage|decision|plan out. Sessions persist by
id. Limits are soft: a limit stop is blocked with reason "limit" and no catch;
catch is only a validated name from the step's catches list.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Descriptions with an unquoted ': ' (e.g. floorplan) failed strict YAML and
the skill was silently dropped. Read single-line known keys instead; skills
with no recognised key are still skipped and reported in /skills.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The previous commit mentioned the skip marker in its body, so Gitea
skipped it; this one triggers the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release job records the tarball hashes in bin.json and commits it
([skip ci]); flake.nix fetches the binary from the release on
x86_64-linux and aarch64-darwin and builds from source elsewhere.
Drop x86_64-darwin, nixpkgs no longer evaluates it.
Co-Authored-By: Claude Opus 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.
Client::diagnostics_after now owns the rust-analyzer on-save check protocol
(flycheck begin/end, publish after end, busy, settle). The counters are
private, and Manager::diagnostics only picks the server and passes the sync
step. Reader state is one Arc<Shared> instead of eight cloned Arcs.
Adds a fake LSP server and a manager test that fails if the first empty
publish after a change is taken as the result.