Commit Graph

2793 Commits

Author SHA1 Message Date
Hunter B a21048a207 docs(readme): focus public overview
Shorten the README around the product path, provider support, install flow, docs index, and community contribution entry points.

Move the long contributor credit ledger into docs/CONTRIBUTORS.md so public credit remains visible without overwhelming the README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 13:03:58 -07:00
Hunter B 90f58261da chore(fleet): satisfy lint cleanups
Keep fleet protocol and manager cleanup warning-clean with derived defaults, boxed task-spec parsing, and collapsed control flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 13:01:45 -07:00
Hunter B 262f535eb9 fix(tui): clean model inventory fallback
Use eager fallback selection in the model inventory default-model resolver so the TUI clippy gate remains warning-clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 13:01:31 -07:00
Hunter B 2de967c858 fix(exec): route auto through model inventory
Add a runnable provider/model inventory and use it for CLI auto routing so exec, review, ACP, and fleet worker subprocesses stop pairing stale root DeepSeek defaults with direct providers like Z.ai.

Forward codewhale fleet through the dispatcher instead of falling back to prompt mode, and tighten the runtime prompt policy for blocking choice questions after stale wakeups.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 12:56:43 -07:00
Hunter B 6a353d77de fix(engine): avoid duplicating mode policy in turn metadata
Keep mode and approval state in the compact request-time runtime prompt, and stop repeating the long human mode description in every turn_meta block. The active user message still carries date, routed model, auto-route, reasoning, and working-set metadata.

This keeps the prompt envelope quieter while preserving the runtime-policy pointer used for cache-stable mode switches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 12:34:00 -07:00
Hunter B 48d43d0365 feat(engine): batch detached shell starts
Let auto-approved background shell launches join native parallel batches with read-only inspection tools. Foreground cargo/test/clippy commands remain serial barriers unless the model explicitly starts them as detached background work.

Adds a per-input detached-start tool hook for exec_shell background/TTY calls and task_shell_start, keeps approval-gated detached work serial, and updates the status text for mixed read-only/background-start batches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 12:28:26 -07:00
Hunter B 1beee1a804 test(tui): serialize completion sound state
The completion sound settings test reads process-global sound state, while another notification test mutates it. Hold the existing module test lock so the default parallel harness cannot race the assertion back to beep mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 12:27:02 -07:00
Hunter B 1574dd488a chore(release): bump v0.8.60
Prepare the local v0.8.60 build by updating the workspace version, internal path dependency pins, npm wrapper version, changelog, README tag examples, Cargo.lock, TUI changelog slice, and generated web facts.

Verification: cargo fmt --all --check; git diff --check; ./scripts/release/check-versions.sh; cargo build -p codewhale-cli -p codewhale-tui --locked; target/debug/codewhale --version; target/debug/codewhale-tui --version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 11:59:34 -07:00
Hunter B f8b3c1e481 feat(engine): parallelize read-only shell calls
Closes #2983.

Allow exec_shell to opt into the existing parallel tool lane when its concrete input is a conservative read-only shell command. The whitelist covers direct git/list/search/read commands plus simple bash/sh/zsh -c wrappers whose inner command passes the same classifier; anything effectful, interactive, redirected, piped, backgrounded, or stdin-fed remains serial and approval-gated.

Parallel exec_shell fanout is capped at four workers, and explicit multi_tool_use.parallel now preserves request-order results while using the same input-aware checks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:45:24 -07:00
Hunter B 877b44935e fix(skills): reject multi-skill Claude plugin archives
Document the portable SKILL.md compatibility boundary for Claude Code plugin bundles and keep /skill install from silently flattening plugin archives that carry multiple skills plus plugin.json runtime metadata.

Reported by @AiurArtanis in #2743.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:20:36 -07:00
Hunter B 38ce04790a feat(whaleflow): add declarative JS workflow authoring
Adds a compile-only JavaScript/TypeScript authoring path that extracts a JSON-compatible workflow({...}) object, lowers it to the existing WorkflowSpec IR, and runs the Rust validation gate before execution.

Includes a branch/reduce .workflow.js example and a short authoring design note comparing YAML/JSON, Starlark, JavaScript, and TypeScript. The compiler rejects effectful JavaScript constructs instead of executing workflow source as a second runtime.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:15:14 -07:00
Hunter B f6867e65bd fix(provider): preserve Z.ai GLM thinking traces
Z.ai's current GLM-5.2 coding-agent docs confirm actual thinking efforts high and max, with ultracode mapped to max. Its Chat Completion API documents thinking.type, thinking.clear_thinking, and reasoning_content rather than a raw reasoning_effort scalar, so direct Z.ai requests now use the documented thinking object and preserve reasoning_content for coding-agent continuity.

Also accepts ultracode as a max-effort alias across settings, routing, and Responses mapping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:10:37 -07:00
1Kill2Steal 6ac93e81c7 feat(tui): add Ctrl+P/N slash-menu navigation
Adds Ctrl+P and Ctrl+N as Emacs-style alternatives for slash-command autocomplete navigation while keeping the global Ctrl+P file picker from stealing focus when the slash menu is open.

Harvested from PR #3196 by @1Git2Clone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:07:29 -07:00
Hunter B 4f0d261094 feat(fleet): drive fleet run through exec workers
Wire the foreground fleet manager loop to FleetExecutor so leased tasks launch real codewhale exec workers, stream progress into the ledger, and record terminal receipts from subprocess outcomes. Remove the local_result simulation path and update manager tests to use a fake codewhale binary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 08:02:36 -07:00
Hunter B 2118768148 feat(tui): /experiments opens the experimental opt-in panel (#3182)
The WhaleFlow, goal, and sub-agent opt-ins already live in the Config view's
Experimental section (whaleflow / goal_command / features.subagents rows).
This adds /experiments (and /experimental) as a discoverable entry point to
that view so the opt-ins #3182 asks for are reachable by name. Implemented as
aliases on the config command (validated by the registry uniqueness/metadata
tests; commands suite 431/0). A bespoke section-focused panel is left as polish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 02:12:15 -07:00
Hunter B 30992aa0e3 feat(tui): add /swarm WhaleFlow-backed multi-agent overlay (#3178)
/swarm [N] <task> is a high-fanout overlay on the current mode (Agent/Plan/YOLO),
NOT a fourth mode. It mirrors the proven /agent command pattern: it emits a
model instruction to decompose the task, fan out one headless sub-agent per
subtask via agent_open (role/agent_type per subtask, max_depth N for nesting),
run them concurrently, and synthesize from each worker's result SUMMARY (not its
transcript) — the isolation pattern that keeps the orchestrator light.

Registered with aliases fanout/qun; CmdSwarmDescription was already localized in
all locales. Validated by the command-registry completeness tests (unique
names/aliases, complete metadata); broad commands suite 431/0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 02:09:51 -07:00
Hunter B 04aa64d569 feat(tui): lock mode/thinking while a turn is running (#2982)
While a turn is in flight (`is_loading`), the model/permission surface the
engine is acting on must not shift underneath it. User-initiated mode cycling
(cycle_mode / cycle_mode_reverse) and thinking cycling (cycle_effort) are now
refused with a concise status message ("… is locked while a turn is running —
press Esc to interrupt first") and the selection stays put (the chip "twitches"
back rather than moving). Internal set_mode transitions (YOLO/plan) are
unaffected — only the user gestures are guarded.

Unit-tested: locked while is_loading, works again once idle. Persistent
busy/free chip styling is left for a visual-review pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 02:05:52 -07:00
Hunter B 3246ef067c fix(cli): keep Anthropic exec-only in the interactive TUI
The fleet-foundation provider expansion added Anthropic/Zai/Stepfun/Minimax as
recognized providers (auth parser + PROVIDER_LIST), but also flipped all four to
TUI-supported in provider_is_supported_by_tui — making every ProviderKind
supported, killing the rejection path and breaking three build_tui_command
rejection tests (the flip had no positive test, so it was an unverified side
effect).

Anthropic speaks the native Messages API, not the OpenAI-compatible shape the
interactive loop expects, so it stays exec-only (as it was on origin):
`codewhale --provider anthropic` is rejected with a hint to use
`codewhale exec --provider anthropic`. Zai (GLM/Z.AI — the v0.8.60 headline),
Stepfun, and Minimax are OpenAI-compatible and remain interactively supported.

Restores the rejection guard and the 3 tests (now 95/0 in codewhale-cli).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:37:14 -07:00
Hunter B 5106ecfb2d test(fleet): CI-safe multi-worker dogfood smoke with injected failure (#3166)
Adds a verifiable dogfood smoke that drives several concurrent exec-style
workers (three healthy + one injected-failure that emits an error event and
exits non-zero) through the real host adapter, asserting distinct terminal
pass/fail outcomes — no external services, no model calls, no codewhale binary.
Documents the automated CI smoke vs the manual `codewhale fleet run` path in
the dogfood spec, and is honest that the manager run-loop cutover to drive real
FleetExecutor workers is still in progress.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:30:06 -07:00
Hunter B 22980b8788 docs(direction): unified agent runtime + Claude Code convergence stance (#2972)
Adds docs/AGENT_RUNTIME.md: one headless runtime, three launchers (TUI turn,
`codewhale exec`, Agent Fleet); sub-agent == fleet worker == nested/launched run
of the same runtime; the isolation+events+compact-projection lag fix; the single
recursion axis; and the one event vocabulary. Answers #2972 (how much Claude
Code convergence): converge on shape (headless runtime, isolated sub-agents,
event-driven fanout, skills, receipts), keep CodeWhale branding + multi-provider
+ the local-first fleet distinct, and never fork execution semantics per surface.
Cross-linked from FLEET.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:27:59 -07:00
Hunter B d47431269f feat(fleet): FleetExecutor runs workers as real exec subprocesses (#3096/#3154)
Adds FleetExecutor: drives a worker as a local `codewhale exec` subprocess via
the existing host adapter, incrementally drains its stream-json output into
FleetWorkerEventPayload ledger events, and finalizes the terminal outcome from
the process exit. The worker's heavy runtime/tool construction lives in its own
process, so the orchestrator only ingests a compact event stream — the
isolation pattern that keeps fanout light (per Codex/Kimi/Claude Code).

Verified end-to-end by an integration test that runs a REAL subprocess emitting
stream-json (standing in for `codewhale exec`) through the real adapter and
asserts RunningTool + terminal Completed events flow out — no codewhale binary
needed. 8 executor tests pass; the 58 existing fleet tests stay green
(executor is not yet wired into `codewhale fleet run`, so no behavior change).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:24:22 -07:00
Hunter B 91cbaf2811 feat(fleet): exec-subprocess worker building blocks (#3096/#3154)
A fleet worker IS a headless `codewhale exec` run — not a separate execution
engine. New crates/tui/src/fleet/executor.rs provides the bridge:

- build_worker_exec_command: FleetTaskSpec + FleetExecConfig ->
  `codewhale exec --auto --output-format stream-json [--model/--allowed-tools/
  --disallowed-tools/--max-turns/--append-system-prompt] <prompt>`. Secrets are
  never on argv (worker resolves its own config/keyring).
- map_exec_stream_line: maps the worker's stream-json events
  ({"type":"tool_use"|"content"|"tool_result"|"done"|"error"}) into
  FleetWorkerEventPayload so the durable ledger persists the worker's OWN event
  vocabulary (collapses the translation layer toward identity).
- classify_worker_exit: process exit -> terminal Completed/Failed/Cancelled.

This is the substrate for replacing the local simulation with real headless
workers. fleet_task_prompt is now pub(crate). 7 new unit tests; building blocks
only (no behavior change yet) so the 58 existing fleet tests stay green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:20:28 -07:00
Hunter B b1cc6ecf5d merge: fleet security/trust + headless-worker foundation + depth unification 2026-06-13 01:11:50 -07:00
Hunter B e8b52ac57a feat(fleet): security/trust + headless-worker foundation; unify recursion depth
Lands the Agent Fleet security/trust boundary and the headless-worker bridge on
the v0.8.60 line, and collapses the sub-agent and fleet recursion model into a
single shared axis (Hunter steer: "not two moving targets").

Security & trust (#3165):
- FleetTrustLevel, FleetSecurityPolicy, FleetSecretRef (redacted), FleetWorkerAuth,
  FleetCapabilityGrant, FleetAlertEndpoint (redacted) in protocol.
- secrets: resolve_direct(key, source_hint) — fleet secret resolution, never logged.
- Host adapters refuse secret-bearing env keys; SSH uses SendEnv (no argv secrets).

Roles & delegation (#3167):
- fleet role -> SubAgentType mapping; reviewer/verifier default read-only.

Headless worker bridge (#3096/#3154, partial — still simulation, real spawn next):
- worker_runtime: FleetTaskSpec -> AgentWorkerSpec, status -> ledger events,
  exec hardening (mirrors #3027), parallel-safe read-only tool set (#2983).
- FleetManager carries an optional SharedSubAgentManager + exec config.

Recursion depth — ONE axis:
- codewhale_config now owns DEFAULT_SPAWN_DEPTH (3) + MAX_SPAWN_DEPTH_CEILING (3).
- sub-agent DEFAULT_MAX_SPAWN_DEPTH and the fleet clamp both source these consts.
- fleet default raised 1 -> 3 to match standalone sub-agents; root runs at depth 0,
  budget gates child delegation. End-to-end test proves a depth-0 fleet worker
  reaches 3 nested levels (afford >= 3).

Dogfood scaffolding (#3166, partial): docs/examples/fleet-dogfood.toml.

Tests green: codewhale-config fleet, codewhale-tui fleet (58), subagent max_depth;
cargo fmt + git diff --check clean; cargo check --workspace ok.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:10:30 -07:00
Hunter B 7c52d6ae11 Merge provider model refresh for v0.8.60 2026-06-12 23:57:54 -07:00
Hunter B 754cff1c84 Refresh GLM and MiniMax provider models 2026-06-12 23:56:01 -07:00
Hunter B 344e89c93d merge #3082 Checklist strategy workflow 2026-06-12 22:55:23 -07:00
Hunter B 751ff943aa fix(tui): group strategy context under work checklist 2026-06-12 22:55:11 -07:00
Hunter B 467bb309dd merge #3142 Agent run receipts 2026-06-12 22:46:08 -07:00
Hunter B c0ba6ce5ad feat(subagents): add agent run receipts 2026-06-12 22:45:53 -07:00
Hunter B 07670871d0 merge #3164 Fleet manager runbook skill 2026-06-12 22:26:49 -07:00
Hunter B fb1a27b4f2 feat(fleet): add manager runbook skill 2026-06-12 22:26:35 -07:00
Hunter B 33f112143d merge #3163 Runtime SDK fleet helpers 2026-06-12 22:17:40 -07:00
Hunter B 26925ae644 feat(runtime-sdk): add fleet helper client
Refs #3163.

Adds the @codewhale/runtime-sdk workspace with typed fleet Runtime API helpers, protocol-shaped TypeScript declarations, JSON/SSE event fixture handling, and typed RuntimeCapabilityError failures for create/event-stream endpoints that the Rust API has not exposed yet.

Documents the SDK contract in docs/RUNTIME_API.md and wires npm workspace verification through npm test --workspace @codewhale/runtime-sdk.
2026-06-12 22:17:16 -07:00
Hunter B e8f6816472 merge #1310 MiniMax provider route 2026-06-12 22:05:52 -07:00
Hunter B e9f0c1c13b feat(config): add first-party MiniMax provider route
Refs #1310.

Adds the direct minimax provider slot, auth/config/env bindings, model aliases, docs, and picker/status surfaces. MiniMax requests now set reasoning_split and preserve reasoning_details history so thinking stays out of answer text.

Also updates Moonshot/Kimi reasoning classification for the Kimi Code route so reasoning_content streams into Thinking cells instead of inline prose.
2026-06-12 22:05:22 -07:00
Hunter Bown e6005eb9ac feat(config): add first-party Z.ai and StepFlash/StepFun provider routes (#3187) (#3191)
* feat(config): add first-party Z.ai and StepFlash/StepFun provider routes (#3187)

Add Z.ai (GLM Coding Plan) and StepFun/StepFlash as first-party providers:

Provider: Z.ai
- Default model: GLM-5.1 (200K context, 128K output, thinking, function calling)
- Base URL: https://api.z.ai/api/coding/paas/v4
- Auth: ZAI_API_KEY / Z_AI_API_KEY
- Config key: [providers.zai]

Provider: StepFun
- Default model: step-3.7-flash (256K context, 256K output, 3-level reasoning)
- Base URL: https://api.stepfun.ai/v1
- Auth: STEPFUN_API_KEY / STEP_API_KEY
- Config key: [providers.stepfun]

Both providers use OpenAI-compatible Chat Completions transport.

Includes:
- ProviderKind enum variants with serde aliases
- ProvidersToml config fields with aliases
- Provider trait implementations in provider.rs
- PROVIDER_REGISTRY, ALL, KIND_LOOKUP, FROM_KIND_LOOKUP updates
- EnvRuntimeOverrides fields and env-var loading
- TUI ApiProvider enum and lookup table updates
- CLI provider_slot and provider_env_vars additions
- Exhaustive match arms across client.rs, config.rs, engine.rs, main.rs,
  provider_picker.rs, ui.rs, and config_persistence.rs

Verified: cargo check passes, config provider tests (67/67) pass.

* test(tui): update provider picker tests for Zai and Stepfun additions
2026-06-12 19:58:57 -07:00
Hunter B 12d3053a15 merge #3162 fleet status surfaces 2026-06-12 19:35:31 -07:00
Hunter B 6b5ffd5627 feat(tui): expose fleet status surfaces 2026-06-12 19:35:11 -07:00
Hunter B 86c87ca6a4 merge #3161 fleet alerts 2026-06-12 19:18:01 -07:00
Hunter B bc61857fad feat(tui): add opt-in fleet alert dry-runs 2026-06-12 19:17:50 -07:00
Hunter B a656175c49 merge #3160 fleet task specs 2026-06-12 19:01:14 -07:00
Hunter B 714276e1c1 feat(tui): add verifiable fleet task specs 2026-06-12 19:01:00 -07:00
Hunter B 8e53aac3b5 merge #3159 fleet scheduler policy 2026-06-12 18:43:44 -07:00
Hunter B 44f429f108 feat(tui): add fleet scheduler policy 2026-06-12 18:43:36 -07:00
Hunter B c78d3b63fc merge #3158 fleet host adapters 2026-06-12 18:31:39 -07:00
Hunter B 9e5688b8c8 feat(tui): add fleet host adapters 2026-06-12 18:31:29 -07:00
Hunter B e35684efed merge #3157 fleet manager commands 2026-06-12 18:15:26 -07:00
Hunter B 66a45c0070 feat(tui): add local fleet manager commands 2026-06-12 18:15:18 -07:00
Hunter B 8ba8f7f2f5 merge #3156 fleet ledger 2026-06-12 17:56:41 -07:00