Commit Graph

1939 Commits

Author SHA1 Message Date
Hunter Bown 186ebbb116 Merge PR #3050 from Hmbown: wire reasoning-effort for Atlascloud, Moonshot, Ollama dialects
fix(reasoning): wire reasoning-effort for Atlascloud, Moonshot, Ollama
2026-06-10 22:30:00 -07:00
Hunter Bown a6d5824cee Merge PR #3047 from Hmbown: model-based capability lookups for Moonshot/OpenAI/Atlascloud + bare-id registry rows
fix(providers): use model-based lookups for Moonshot/OpenAI/Atlascloud/Ollama capability
2026-06-10 22:29:52 -07:00
Hunter Bown 78ed3768bf Merge PR #3046 from Hmbown: add Moonshot/Kimi to reasoning-content provider and model gates
fix(reasoning): add Moonshot/Kimi to reasoning-content provider and model support
2026-06-10 22:29:44 -07:00
Claude 3f2f154ad2 Merge origin/main into v0.8.58-3018-unhardcode-deepseek — append #3030 step-counter tests after the #3018 routing tests 2026-06-11 05:29:25 +00:00
Claude d9dff6809c Merge origin/main into v0.8.58-3026-hooks-v2 — keep both the #3026 hook fold helpers and the #3027 command_denies_tool gate in turn_loop 2026-06-11 05:26:27 +00:00
Claude 8a165cc49b Merge origin/main into v0.8.58-3028-clickable-tui — union the sidebar test imports (#3030 hover texts + #3028 row builders) 2026-06-11 05:23:29 +00:00
Hunter Bown 880346622b Merge PR #3039 from Hmbown: OSC 8 out-of-band hyperlink infrastructure
feat(tui): OSC 8 out-of-band hyperlink infrastructure
2026-06-10 22:20:35 -07:00
Hunter Bown 6b01cccc65 Merge PR #3038 from Hmbown: make Ctrl+B directly background the active foreground shell
fix(tui): make Ctrl+B directly background the active foreground shell
2026-06-10 22:20:27 -07:00
Hunter Bown d9c5dac55b Merge PR #3037 from Hmbown: compact tool-call transcript rendering — suppress boilerplate cells
fix(tui): compact tool-call transcript rendering — suppress boilerplate
2026-06-10 22:20:18 -07:00
Claude 418ad5b744 Merge origin/main into v0.8.58-3030-hide-internal-ids — combine #3030 stable agent labels with #3033 AgentProgress redraw throttle (both kept in App state and the AgentProgress arm) 2026-06-11 05:19:57 +00:00
Hunter Bown eb610c83ee Merge PR #3035 from Hmbown: throttle AgentProgress redraws to prevent freeze under subagent load
fix(tui): throttle AgentProgress redraws to prevent freeze under subagent load
2026-06-10 22:11:17 -07:00
Hunter Bown 8fadd764d2 Merge PR #3042 from Hmbown: exec --allowed-tools, --disallowed-tools, --max-turns, --append-system-prompt
feat(exec): add --allowed-tools, --disallowed-tools, --max-turns, --append-system-prompt
2026-06-10 22:11:07 -07:00
Hunter Bown 20fa626fb8 Merge PR #3041 from Hmbown: harvest error-message fixes — better tool denial and provider errors
fix: harvest error-message fixes from PR #2933 — better tool denial + subagent conflict messages
2026-06-10 22:11:00 -07:00
Claude 1a61a79910 fix(hooks): pass the Windows cmd /C command line via raw_arg — Command::arg's CRT-style quoting inserted literal \" into hook commands, which cmd.exe does not unescape, so JSON decisions never parsed (hook_gate_* Windows failures)
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 04:46:05 +00:00
Claude 29f75dc19d fix(lint): fold the sidebar click row lookup into the bounds let-chain — newer clippy (1.96) flags the nested if as collapsible_if and CI lints with -D warnings
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 04:42:18 +00:00
Hunter Bown 81b060928b Merge PR #2579 from encyc: Phase 4 — replace Session.messages Vec with AppendLog
refs(#2264): Phase 4 — replace Session.messages: Vec<Message> with AppendLog
2026-06-10 20:10:20 -07:00
Hunter Bown 544b44bd98 Merge PR #2892 from gordonlu: localize sandbox elevation dialog across 7 locales
feat(i18n): localize sandbox elevation dialog across 7 locales
2026-06-10 20:10:05 -07:00
Claude fc10d10189 feat(routing): complete #3018 — RouterCandidates + provider_router_candidates; candidate-aware heuristics, router prompts and recommendation parsing; skip the network router when no cheap tier exists; validate spawn-time model against the active provider; tests + SUBAGENTS.md per-role models docs
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 03:03:08 +00:00
Claude 033132a735 fix(tui): #3032 residuals — running-exec hint now says Ctrl+B backgrounds the command; Ctrl+B documented in KEYBINDINGS.md and runbook updated for menu removal; Cannot-background message names the reason (interactive / non-shell tool / nothing running)
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:40:07 +00:00
Claude 7a64119635 test(reasoning): #3016 coverage — Moonshot in provider_accepts_reasoning_content, kimi-k2.6 stream classification, multi-chunk Moonshot reasoning_content decoder fixture; exclude non-thinking kimi-for-coding from the kimi- prefix rule
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:35:36 +00:00
Claude 5fb41cc209 test(errors): add #3020 test extensions — Plan-mode denial passes through verbatim, bare/model denials get the suffix; Model-Not-Exist + OpenAI-style rejections annotated; conflict error includes elapsed time; tighten mode-word predicate so 'model' no longer matches
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:30:30 +00:00
Claude 948e42397f fix(tui): #3029 audit fix — interleave OSC 8 open/close per region in diff order (OSC 8 is last-writer-wins state; batched opens linked the whole frame to the last target); drop cursor-move hack and dead pending_links; add byte-stream bracketing tests
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:26:45 +00:00
Claude b6e88d2d34 fix(tui): #3031 audit fix — map the literal '(no output)' ToolResult placeholder to None at the routing layer (exec + generic cells) so compact-mode suppression actually fires; add helper + render-mode tests
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:18:46 +00:00
Claude 5a71d644f5 fix(tui): #3030 audit fixes — nickname beats generated Agent-N label; status bar uses stable labels (with raw-id fallback) for spawn/progress/complete; drop truncated raw id from compact detail line; add label/turn/step-counter tests
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:13:30 +00:00
Claude df1b35ba0f fix(tui): #3033 audit fix — throttled AgentProgress no longer cancels redraws owed to other events in the same drain batch; restore pre-event accumulator value; extract agent_progress_redraw_permitted + unit tests
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 02:03:17 +00:00
Claude 6f5039101a feat(hooks): wire the #3026 decision contract into the engine — JSON deny/ask/updatedInput now steer tool calls (deny>ask>allow, last-writer updatedInput), additionalContext piped into tool results, project .codewhale/hooks.toml loaded at both HookExecutor sites; parser hardening + fold/glob/project tests; docs
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 01:52:22 +00:00
Claude ac3f8c04b6 fix(tui): rebuild sidebar click-action mapping — lines and actions now built in one pass so indices can't drift; shell_* jobs route via /jobs, task jobs via /task; finished jobs lose the cancel target; agents panel gates role-mix slot correctly; fix test compile; add action-mapping + click-resolution tests (#3028)
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 00:46:38 +00:00
Claude c15e937096 fix(exec): wire --disallowed-tools into the gate chain (deny wins over allow), filter the advertised tool catalog, honor --append-system-prompt in needs_engine, surface max-steps notice in text mode; add clap/gate/catalog tests (#3027)
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 00:31:05 +00:00
Claude b9bcc9c710 fix(providers): update stale Atlascloud/Ollama capability tests to the generic model-based path; add bare Moonshot/MiniMax/Z.ai model rows (kimi-k2.6, kimi-for-coding, minimax-m3, glm-5.1, glm-5v-turbo) mirroring vendor-prefixed rows; add Moonshot capability + engine capacity tests (#3023, #1310)
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 00:17:53 +00:00
Claude 29e60cd4b9 fix(reasoning): Atlascloud joins the DeepSeek dialect group — max tier now sends reasoning_effort=max; add Atlascloud/Moonshot/Ollama dialect-shape tests; document per-provider reasoning-effort wire mapping in PROVIDERS.md (#3024)
Co-Authored-By: Claude <noreply@anthropic.com>
https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
2026-06-11 00:13:18 +00:00
Hunter Bown e1a61f445e fix(tui): remove ShellControlView menu now unreachable after direct Ctrl+B
Ctrl+B backgrounds the foreground shell directly (#3032), leaving the
two-step shell-control modal dead code that fails clippy -Dwarnings.
Delete ShellControlView/ShellControlChoice, the ModalKind and ViewEvent
variants, and open_shell_control; repoint the default-paste regression
test at HelpView; update the Ctrl+B keybinding description in all
locales to describe the new direct-background behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:49:30 -07:00
Hunter Bown c98b7ea42c fix: harvest error-message fixes from PR #2933 — better tool denial + subagent conflict messages (#3020)
Three targeted error-message improvements extracted from community
PR #2933 (author cy2311), with additional model-not-found annotation:

1. dispatch.rs format_tool_error: pass through self-explanatory messages
   that already name the cause (mode switch, allow_shell, feature flag,
   denied by user) instead of appending a conflicting generic suffix.
   Fixes the Plan-mode double-message (#2657).

2. subagent/mod.rs session-name conflict: include elapsed time
   (started Ns ago / NmNs ago) so the parent can distinguish a live
   worker from a stale/failed earlier spawn (#2656).

3. subagent/mod.rs annotate_child_model_error: catch model-not-found
   patterns (Model Not Exist, does not exist, no such model, etc.) in
   the raw error text even when the taxonomy classifies them as
   Internal rather than Authorization/State (#2653).

Closes #2653, #2656, #2657.
Credit: cy2311 for the dispatch.rs and subagent conflict hunks from #2933.

Co-authored-by: cy2311 <29836092+cy2311@users.noreply.github.com>
2026-06-10 16:41:55 -07:00
Hunter Bown 2d7d5e55ed style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:37 -07:00
Hunter Bown 6d646999d9 style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:34 -07:00
Hunter Bown a004cfbee6 style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:29 -07:00
Hunter Bown b433989cc3 style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:27 -07:00
Hunter Bown f4789a637c style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:23 -07:00
Hunter Bown 710ddf45eb style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:20 -07:00
Hunter Bown 06d680240c style: cargo fmt
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 16:40:17 -07:00
Hunter Bown abc9cfdcc1 fix(reasoning): wire reasoning-effort for Atlascloud, Moonshot, Ollama (#3024)
Three providers previously had silent no-ops for all reasoning-effort
tiers — the user toggled thinking on/off and nothing changed on the
wire.  This commit wires them:

- Atlascloud: now speaks the DeepSeek dialect (thinking + reasoning_effort
  fields) since it serves DeepSeek models.  All three arms (off, low–high,
  xhigh/max) updated.

- Moonshot/Kimi: emits thinking: {type: disabled/enabled} for off/on.
  Kimi-k2.6 natively supports this field.

- Ollama: emits think: false/true for off/on.  Sent through the
  OpenAI-compatible /v1/chat/completions endpoint.

Providers that remain unchanged: Openai, WanjieArk, OpenaiCodex
(chat path), Arcee, Huggingface.
2026-06-10 16:33:29 -07:00
Hunter Bown db69ee42cf feat(hooks): JSON decision contract, glob matchers, project-local hooks (#3026)
Three incremental improvements to the hooks control plane:

1. ToolCallBeforeStdout parser: hooks can now emit a JSON decision on
   stdout — {"decision": "allow"|"deny"|"ask", "reason": "...",
   "updatedInput": {...}, "additionalContext": "..."}.  Non-JSON or empty
   stdout retains legacy passthrough (allow).  Exit code 2 still hard-denies
   regardless of stdout.

2. Glob matchers for ToolName conditions: `name = "mcp__*"` now matches
   all MCP tools.  Uses regex::escape + `*` → `.*` pattern, same
   convention as execpolicy/matcher.rs.  Exact names keep working.

3. Project-local hooks: `HooksConfig::load_with_project(global, workspace)`
   reads `.codewhale/hooks.toml` and appends its hooks after global.
   Malformed file logs a warning and falls back to global-only.
2026-06-10 16:32:11 -07:00
Hunter Bown 139fe07d71 fix(providers): use model-based lookups for Moonshot/OpenAI/Atlascloud/Ollama capability (#3023)
Three changes to fix provider capability reporting:

1. Delete the Openai/Atlascloud/Moonshot early-return arm in
   provider_capability() so these providers use the generic model-based
   path.  Moonshot models now correctly report 262,144 context window
   and thinking_supported: true (via models.rs lookups).

2. Delete the Ollama hardcoded arm so Ollama also uses model-based
   lookups.  The generic fallback now uses 8192 for Ollama (conservative
   for small local models) instead of the 128K default.

3. Ollama fallback: when context_window_for_model returns None and
   the provider is Ollama, default to 8192 instead of
   LEGACY_DEEPSEEK_CONTEXT_WINDOW_TOKENS (128K).
2026-06-10 16:27:49 -07:00
Hunter Bown 7c4d359ed7 fix(reasoning): add Moonshot/Kimi to reasoning-content provider and model support (#3016)
Two targeted fixes to close the Kimi/Moonshot reasoning gap:

1. chat.rs: add ApiProvider::Moonshot to provider_accepts_reasoning_content
   so Kimi thinking traces stream as Thinking blocks instead of leaking
   as plain answer text on Moonshot's native endpoint.

2. models.rs: add kimi-* prefix match to model_supports_reasoning so
   bare Moonshot-native IDs (kimi-k2.6, kimi-*-thinking, etc.) are
   recognized as reasoning-capable without requiring the OpenRouter-style
   moonshotai/ prefix.

These two changes together ensure is_reasoning_model_for_stream returns
true for Kimi models on Moonshot, fixing the RC dialet gap.
2026-06-10 16:26:20 -07:00
Hunter Bown faeeeef59b fix(subagent): un-hardcode DeepSeek from model validation — accept any provider id (#3018)
Two changes to let non-DeepSeek providers use their own model IDs:

1. config.rs: add requested_model_for_provider() — DeepSeek providers
   use strict normalize_model_name(); all others accept any non-empty
   string via normalize_custom_model_id().

2. subagent/mod.rs: normalize_requested_subagent_model() now takes an
   ApiProvider parameter and delegates to requested_model_for_provider.
   Error messages name the active provider and list accepted model IDs
   from model_completion_names_for_provider() instead of hardcoding
   "Expected a DeepSeek model id".

parse_optional_subagent_model() keeps basic trimming-only validation;
provider-aware checks are deferred to the spawn path where the runtime
is available.
2026-06-10 16:25:03 -07:00
Hunter Bown dbd9b9670d feat(exec): add --allowed-tools, --disallowed-tools, --max-turns, --append-system-prompt (#3027)
Headless exec hardening for benchmark/CI/droplet use:
- New CLI flags: --allowed-tools, --disallowed-tools, --max-turns, --append-system-prompt
- Add disallowed_tools to EngineConfig + command_denies_tool() helper
- run_exec_agent threads all four flags into EngineConfig and Op::SendMessage
- needs_engine now includes flag presence for standalone exec use
2026-06-10 16:17:33 -07:00
Hunter Bown 4af5a68591 feat(tui): clickable sidebar rows — click-to-act on Tasks and Agents panels (#3028)
Adds mouse-click dispatch for sidebar rows:

- Add click_action: Option<String> to SidebarHoverRow (app.rs)
- Extend sidebar_hover_rows() and render_sidebar_section() to carry
  row_actions: Vec<Option<String>>
- Add task_panel_row_actions(): background task rows get /task show <id>
  and /task cancel <id>
- Add agent_panel_row_actions(): agent rows get /subagents
- Add sidebar_click_action() in mouse_ui.rs: resolves mouse position
  to an action from the sidebar hover state
- Wire into MouseEventKind::Down(Left): dispatches ViewEvent::
  CommandPaletteSelected → existing slash-command pipeline

Reuses the existing command dispatch backbone — no new ViewEvent variants.
Keyboard parity preserved; all click actions are also reachable via
existing slash commands.
2026-06-10 16:10:50 -07:00
Hunter Bown 60e9f706b3 feat(tui): OSC 8 out-of-band hyperlink infrastructure (#3029)
Adds the foundation for working OSC 8 hyperlinks in the transcript:

- LinkRegion struct: (row, col_start, col_end, target) for a contiguous
  run of linked cells on one terminal row
- write_osc8_open/close: emit OSC 8 escapes directly through a Write
  impl (bypassing ratatui's buffer which strips ESC bytes)
- FRAME_LINKS thread-local: passes link regions from the render closure
  to ColorCompatBackend::draw(), where OSC 8 escapes are emitted
  out-of-band through the backend's Write impl
- ColorCompatBackend integration: draw() reads FRAME_LINKS, emits OSC 8
  open/close around linked cells

The markdown renderer still uses the inline Span::content approach
(known broken); the sentinel-color buffer-scan integration is a
follow-up.  This PR delivers the emission path and thread-local
plumbing so the remaining work is confined to link detection in the
render closure.
2026-06-10 16:06:26 -07:00
Hunter Bown 502fb04c23 fix(tui): make Ctrl+B directly background the active foreground shell (#3032)
Previously Ctrl+B opened a two-step ShellControlView menu (Background /
Cancel).  Now it directly calls request_foreground_shell_background(),
backgrounding the running foreground shell in one keystroke.

When no foreground shell is running, the existing status message
("No foreground shell command to background") provides the hint.

The ShellControlView and open_shell_control() remain available as a
programmatic entry point for views/tests.
2026-06-10 15:59:40 -07:00
Hunter Bown 7fef919765 fix(tui): compact tool-call transcript rendering — suppress boilerplate (#3031)
Three targeted changes to reduce low-value detail in the default
compact/Live transcript view:

1. ExecCell: suppress "(no output)" line in Live mode.  The success
   header already conveys the outcome; Transcript mode keeps it for
   exports/clipboard/pager.

2. ExecCell: suppress sub-second timing in Live mode.  Calls under 1s
   show no timing line; Transcript mode always shows exact timing.

3. render_preserved_output_mode: suppress "(no output)" for empty output
   in Live mode.  Same rationale — the header carries the signal.

Full command text, complete output, and exact timing remain available
in Transcript mode (pager, clipboard export, Alt+V detail view).
2026-06-10 15:57:08 -07:00
Hunter Bown ec0789daf4 fix(tui): hide internal IDs from normal UI — stable labels for turns and agents (#3030)
Three changes to replace raw UUIDs/hex-ids with stable user-facing labels:

1. Turn label: Add turn_counter to App, display "Turn N" instead of the
   raw runtime_turn_id UUID prefix.  Full UUID preserved in hover text.

2. Agent labels: Add agent_counter + agent_label_map to App.  Populated
   on AgentSpawned; sidebar rows use "Agent 1", "Agent 2" etc. instead
   of agent_<hex>.  Nicknames and user-assigned names still take priority.

3. Step counter: Add format_step_counter() helper.  When max_steps is
   u32::MAX (the unbounded sentinel), renders "step 16" instead of the
   meaningless "step 16/4294967295".  Concrete step budgets still show
   the denominator.
2026-06-10 15:52:34 -07:00