Commit Graph

1969 Commits

Author SHA1 Message Date
HUQIANTAO 655f50ea72 docs(hooks): add doc comments to all public types (#2447)
* docs(hooks): add doc comments to all public types

* docs(hooks): clarify sink error handling

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 10:29:33 -07:00
HUQIANTAO 7ad6317c1a docs(tui-core): add doc comments to all public types (#2456)
Add doc comments to all public types in the tui-core crate:
- Pane enum and all 6 variants
- UiEvent enum and all 13 variants
- UiEffect enum and all 4 variants
- UiState struct and all 8 fields
- UiState::reduce and UiState::snapshot methods

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:29:01 -07:00
HUQIANTAO 9eb33875bf test(app-server): add unit tests for auth, CORS, and JSON-RPC helpers (#2448)
* test(app-server): add unit tests for auth, CORS, and JSON-RPC helpers

Add 16 new unit tests (total 20) covering:
- resolve_auth_token: empty token rejection, auto-generation, explicit token, insecure loopback
- cors_layer: default origins, extra origins, empty origin skipping
- JSON-RPC helpers: params_or_object, jsonrpc_result, jsonrpc_error, error codes
- Default CORS origins verification

* test(app-server): redact auth token debug output

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 10:24:26 -07:00
HUQIANTAO 896104b851 docs(release): add doc comments to all public types and functions (#2449)
* docs(release): add doc comments to all public types and functions

* test(tui-core): add unit tests for UiState state machine

Add 25 unit tests covering the previously untested UiState::reduce
state machine and snapshot:

- Default state verification
- Key navigation: pane switching (1-5), unknown key no-op
- Prompt lifecycle: pending_tasks increment, response delta tracking
- Tool lifecycle: active_tool set/clear, pending_tasks decrement, saturation
- Job lifecycle: active_jobs increment/decrement, progress clamping, saturation
- Approval lifecycle: pending_approvals increment/decrement, saturation
- Pause/Resume: flag toggling
- Tick: ScheduleBackgroundRefresh effect
- Snapshot: field presence, state change reflection

* Revert "test(tui-core): add unit tests for UiState state machine"

This reverts commit 92dfb9bcf3e915b14d5848244e0732fb188b2ce8.

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 10:23:59 -07:00
HUQIANTAO dfeedca524 test(web): add unit tests for pure helper functions (#2454)
* test(web): add unit tests for pure helper functions

Add vitest configuration and tests for:
- relativeTime: time formatting (just now, minutes, hours, days, months, years)
- lastPageFromLink: GitHub Link header pagination parsing

These are the first tests for the web frontend. The test framework
(vitest) was already in package.json but had no config or test files.

* test(web): exercise real GitHub helpers

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 10:21:09 -07:00
HUQIANTAO 311333d887 refactor(tools): replace manual Display impl with thiserror derive (#2442)
* refactor(tools): replace manual Display impl with thiserror derive

Replace the hand-rolled Display implementation for ToolError with
thiserror derive macros. The thiserror crate is already a workspace
dependency. Error messages remain identical (verified by existing
test tool_error_display_matches_legacy_text).

This reduces boilerplate and ensures consistency with other error
types in the codebase (secrets, state crates already use thiserror).

* chore: add thiserror to Cargo.lock

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:18:05 -07:00
HUQIANTAO aea924adf2 docs(core): add doc comments to all public types (#2460)
* docs(core): add doc comments to all public types

Add doc comments to all public types in the core crate:
- InitialHistory enum and variants
- NewThread struct and fields
- JobStatus enum and variants
- JobRetryMetadata struct and fields
- JobHistoryEntry struct and fields
- JobRecord struct and fields
- JobManager struct
- ThreadManager struct
- Runtime struct

* docs(core): add doc comments to all public types

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:17:45 -07:00
HUQIANTAO f0c3051231 docs(secrets): add doc comments to all public types (#2457)
Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:07:00 -07:00
HUQIANTAO a2725a2d26 docs(agent): add doc comments to all public types (#2455)
Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:06:54 -07:00
HUQIANTAO ee80350d89 docs(tools): add doc comments to remaining public types (#2451)
Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:06:42 -07:00
HUQIANTAO 1f8d69b60b docs(mcp): add comprehensive doc comments to all public types (#2446)
Add doc comments to all public structs, enums, traits, and methods:
- McpServerConfig, ToolFilter, McpServerDefinition
- McpStartupStatus, McpStartupUpdateEvent, McpStartupFailure, McpStartupCompleteEvent
- McpToolDescriptor, McpResourceDescriptor
- McpManagedClient trait and all its methods
- InMemoryMcpClient and its builder methods
- McpManager and all its public methods
- run_stdio_server function

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
2026-05-31 10:06:37 -07:00
Hunter Bown 375021a28c Merge pull request #2433 from aboimpinto/docs/stacked-pr-process
docs: document layered PR process
2026-05-31 10:03:26 -07:00
Hunter Bown 1eebb0462e Merge pull request #2431 from reidliu41/fix/attach-absolute-path-completion
fix(tui): suppress inline skill completions in slash command args
2026-05-31 10:03:08 -07:00
Hunter Bown 9cf382a446 Merge pull request #2434 from Hmbown/codex/harvest-2318-message-submit-hooks
feat(hooks): harvest message_submit transform hooks
2026-05-31 10:02:34 -07:00
Hunter B 0d3b81db2e fix(hooks): surface continued submit hook stderr 2026-05-31 04:43:54 -07:00
ningjingkun 4146ec617e fix(hooks): harden message_submit review cases 2026-05-31 04:39:51 -07:00
ningjingkun 467e2cbfff feat(hooks): allow message_submit to transform submitted text 2026-05-31 04:39:51 -07:00
Hunter B 1b71031113 docs: clarify partial issue references 2026-05-31 04:37:26 -07:00
Hunter Bown 55bcedd8be Merge pull request #2432 from hongqitai/style/fix-clippys
style: fix clippy warnings and run fmt
2026-05-31 04:32:06 -07:00
Hunter Bown 88ae74cabd Merge pull request #2430 from Hmbown/codex/harvest-2333-unix-socket
feat(hooks): add opt-in Unix socket event sink
2026-05-31 04:27:11 -07:00
Paulo Aboim Pinto 6f46a5d199 docs: document layered PR process 2026-05-31 13:27:10 +02:00
hqt 12cba233df style: fix clippy warnings and run fmt 2026-05-31 19:22:21 +08:00
lihuan215 459ae3d4ae feat(hooks): add opt-in Unix socket event sink
Harvests the UnixSocketHookSink work from #2333 while moving app-server socket configuration to the separate [hook_sinks] table, requiring an explicit socket path, and adding regression coverage for macOS-safe socket paths and lifecycle [hooks] preservation.
2026-05-31 04:19:27 -07:00
reidliu41 ff7ef7951e fix(tui): suppress inline skill completions in slash command args
Prevent inline skill slash completions from opening while editing arguments for an existing slash command.

  This keeps `/attach /path/to/image.png` usable without showing skill entries after the path slash, while
  preserving inline skill completions in normal message text.

  Adds a regression test for `/attach /`.
2026-05-31 19:15:35 +08:00
Hunter Bown ecfca261a1 fix(tools): remove invalid override fallthrough (#2428)
Hardens the tool override path from #2420 so a broken replacement override cannot silently fall through to the original built-in tool.

Validation:
- git diff --check
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/fix-plugin-override cargo test -p codewhale-tui tools::registry --all-features
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/fix-plugin-override cargo test -p codewhale-tui tools::plugin --all-features
2026-05-31 04:13:13 -07:00
Hunter Bown f4eba5fe43 Merge pull request #2429 from Hmbown/codex/harvest-2426-volcengine-search
feat(web_search): add Volcengine Ark search provider
2026-05-31 04:07:37 -07:00
Hunter B 553acc3cf7 fix(web_search): harden Volcengine provider wiring 2026-05-31 03:56:57 -07:00
implecao c1a9a841ca chore: fix clippy warning in extract_json_block
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 03:54:09 -07:00
implecao c591d91c2b chore: apply cargo fmt
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 03:54:09 -07:00
implecao 70ef86c600 feat(web_search): add Volcengine Ark search provider
Add Volcengine (火山引擎) as a new SearchProvider in web_search tool.
Uses Volcengine's Responses API with `tools: [{type: "web_search"}]`
and strict JSON prompt constraints to extract structured search results.

- Free tier: 20K queries/month per API key
- API key resolution: [search] api_key → VOLCENGINE_API_KEY →
  VOLCENGINE_ARK_API_KEY → ARK_API_KEY env vars
- Select via `DEEPSEEK_SEARCH_PROVIDER=volcengine` or
  `[search] provider = "volcengine"` in config.toml

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 03:54:09 -07:00
Hunter Bown 74b78e77ec chore(web): bump qs lockfile entry (#2425)
Supersedes #2224.

Updates the transitive web lockfile entry for `qs` from 6.15.1 to 6.15.2 while keeping the current-main diff limited to the `node_modules/qs` metadata.

Validation:
- git diff --check
- npm --prefix web ci --ignore-scripts
- npm --prefix web run lint
2026-05-31 03:51:12 -07:00
Paulo Aboim Pinto f488cd8e00 feat(tui): add pluggable tool registry (#2420)
Thanks @aboimpinto.

Adds a self-describing local plugin/override tool registry, keeps explicit [tools.overrides] above auto-discovered scripts, makes plugin discovery deterministic, hardens child-process stdin/stdout behavior, and updates the local plugin examples.

Validation:
- cargo fmt --all -- --check
- git diff --check
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/fix-2420-rebase cargo test -p codewhale-tui tools::plugin --all-features
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/fix-2420-rebase cargo test -p codewhale-tui tools::registry --all-features
2026-05-31 03:34:54 -07:00
Hunter Bown cef1632d6a feat(cache): track cache warmup keys (#2424)
Harvested from #2391 with thanks to @wplll.

Tracks a cache warmup key across provider, model, base URL, static prefix, tool catalog, project pack, and skills hashes; records base URL and tool catalog from completed turns; reports whether /cache inspect still matches the last warmup key; and computes the warmup key from the actual warmup request sent to the provider.

Validation:
- cargo fmt --all -- --check
- git diff --check
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/harvest-2391-rebase cargo test -p codewhale-tui warmup_status --all-features
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/harvest-2391-rebase cargo test -p codewhale-tui cache_inspect --all-features
2026-05-31 03:34:01 -07:00
Hunter Bown 51906511c5 feat(cache): expose real tool catalog in cache inspect (#2423)
Harvested from #2390 with thanks to @wplll.

Records the actual tool catalog used by the last model request, reports that catalog in /cache inspect JSON and text output, and includes review hardening for stale catalog clearing, JSON/verbose flag handling, and CJK-aware token estimates.

Validation:
- cargo fmt --all -- --check
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/harvest-2390 cargo test -p codewhale-tui cache_inspect --all-features
2026-05-31 03:24:00 -07:00
Hunter Bown 58e45d384e feat(subagents): inherit MCP tools in child runtimes (#2422)
Harvested from #2377 with thanks to @buko.

Threads the parent MCP tool pool into child SubAgentRuntime construction and registers MCP-backed tools for child agents when MCP is enabled, while leaving the broader mention-browser/provider/config work for focused follow-ups.

Validation:
- cargo fmt --all -- --check
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-pr2377-target cargo test -p codewhale-tui tools::subagent
- CARGO_TARGET_DIR=/Volumes/VIXinSSD/codewhale-target/harvest-2377-recheck cargo test -p codewhale-tui tools::subagent --all-features
2026-05-31 03:16:53 -07:00
Hunter Bown 4085f71e2b feat(agent): register AtlasCloud static models (#2421)
Harvested from #2343 with thanks to @lucaszhu-hue.

Registers AtlasCloud static model rows for Pro and Flash resolution, adds provider-hinted alias coverage, and updates neutral provider docs and env examples while leaving promotional assets/copy out.
2026-05-31 03:05:28 -07:00
Hunter Bown 3c0d56d424 test(cache): cover medium tool result dedup (#2419)
Harvested from #2393 with thanks to @wplll.

Strengthens the tool-result dedup regression coverage by exercising repeated medium-sized outputs that are above the dedup threshold but below the truncation budget.
2026-05-31 02:53:29 -07:00
Hunter Bown 3899ca3f58 feat(project-context): stabilize pack ordering (#2418)
Harvested from #2392 with thanks to @wplll.

Makes project context pack path ordering deterministic across Unix and Windows-style separators while keeping README/config/source entries prioritized before general directory noise.
2026-05-31 02:53:08 -07:00
Hunter Bown ce72b0cbc4 fix(tui): clarify shell tool availability errors (#2412)
Harvested from #2402 with thanks to @axobase001.

Keeps `allow_shell` guidance visible for gated shell tools even when missing-tool suggestions exist, removes the nonexistent task_shell_cancel matcher, and broadens regression coverage.

Partially addresses #2328.
2026-05-31 02:52:24 -07:00
Hunter Bown 0dd7f0b802 fix(runtime): harden mobile QR smoke output (#2417)
Harvested from #2415 with thanks to @axobase001.

Keeps the denser mobile QR renderer and replaces the fixed binding-warning sleep with health polling plus an explicit timeout failure path, so slow starts fail with the useful cause instead of drifting into misleading assertions.

Follow-up to #2403.
2026-05-31 02:48:41 -07:00
Hunter Bown 6e8477334d test(shell): cover tty controlling terminal (#2414)
Harvested from #2408 with thanks to @axobase001.

Adds regression coverage proving tty:true shell commands receive a controlling terminal, with a longer wait margin so the test is stable on slower CI hosts.

Partially addresses #2372.
2026-05-31 02:47:48 -07:00
Hunter Bown f38864d801 fix(tui): compact statusline token chip (#2411)
Harvested from #2405 with thanks to @axobase001.\n\nCompacts the statusline token chip to use the short  label while preserving the existing token detail and adding focused coverage for the rendered label.\n\nPartially addresses #2309.
2026-05-31 02:43:38 -07:00
Hunter Bown 26e2de86f0 docs: align configuration paths with codewhale home (#2413)
Harvested from #2400 with thanks to @axobase001.\n\nAligns the configuration docs around CODEWHALE_HOME while preserving the DEEPSEEK_HOME legacy alias and spelling out how legacy checkpoints can still be scanned during cleanup.\n\nCloses #2322.
2026-05-31 02:39:53 -07:00
Hunter Bown a5cef5b2f6 feat(tui): expose auto route in turn metadata (#2410)
Harvested from #2406 with thanks to @axobase001.

Adds auto-selected model and reasoning effort to turn metadata while keeping user text isolated in its own content block. Includes the comment cleanup requested in review.

Partially addresses #2380.
2026-05-31 02:29:21 -07:00
Hunter Bown 42b25a2cb5 docs: add macos python FAQ (#2409)
Harvested from #2407 with thanks to @axobase001.

Adds a first-time macOS Python FAQ and completes the virtualenv flow with the final run command.

Fixes #2351.
2026-05-31 02:27:32 -07:00
Paulo Aboim Pinto a3ae974676 feat(tui): add ExternalTool abstraction layer (#2294)
Harvested with thanks to @aboimpinto.

Includes the ExternalTool abstraction layer plus follow-up fixes for lossy REPL stdout handling and unquoted unicode git diff paths.

Validation included full CI and focused local checks for non-UTF8 REPL stdout, git_diff, and external_tool behavior.
2026-05-31 02:24:25 -07:00
HUQIANTAO 72e8ca45de feat: add mobile smoke tests and QR code for mobile URL (#2403)
* feat: add mobile smoke tests and QR code for mobile URL

#2396: Add scripts/mobile-smoke.sh that launches the compiled binary on
loopback ports and verifies the mobile surface through real HTTP requests:
- Token auth (401/200, Bearer, query param, approval 404)
- Insecure mode (no token required)
- Binding warnings (0.0.0.0, LAN URL hint)

Add mobile-smoke job to CI workflow.

#2397: Add --qr flag to 'codewhale serve --mobile' that renders a
terminal QR code for the mobile URL. Uses the LAN IP when available,
falls back to 127.0.0.1. Adds qrcode crate (pure Rust, no C deps).

* fix: address review feedback on mobile smoke tests

- Fix Test Group 3 subprocess capture: use temp file instead of command
  substitution to avoid hanging and subshell variable isolation
- Allow BINARY path to be overridden via BINARY env var
- Add libdbus-1-dev system dependency to CI job for ubuntu build

* fix: pass auth header in mobile smoke status helper

* fix: send approval JSON in mobile smoke

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 02:04:32 -07:00
Hunter Bown 8f095b882f feat(execpolicy): add typed ask rule foundation (#2404)
* feat(execpolicy): add typed ask rule foundation

* fix(execpolicy): tighten typed ask diagnostics

---------

Co-authored-by: greyfreedom <greyfreedom@163.com>
2026-05-31 01:37:15 -07:00
HUQIANTAO 3aa0a33fe2 feat: add Claude theme (#2267)
* feat: add Claude theme — warm navy & coral palette

Add a new theme aligned with Claude Code's product surface colors:
deep navy surfaces (#181715), cream-tinted text (#faf9f5),
coral accent (#cc785c), and teal secondary (#5db8a6).
Includes cell-level remap pipeline registration and full
WCAG contrast QA compliance.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(theme): address review feedback on Claude theme

- Fix text_dim contrast: #615E58 → #72706A (2.77 → 3.62, passes WCAG AA)
- Fix error_fg/error_border contrast: #C64545 → #E06060 (3.70 → 5.13, passes AA)
- Use amber #E8A55A for accent_action (distinct from accent_primary coral)
- Fix theme_picker test expecting GruvboxDark as last theme
- Remove broken include_str!("../../../web-chat/index.html") reference
  left by incomplete web-chat revert

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix: revert version bump, keep theme-only changes

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 01:18:33 -07:00
zLeoAlex b0e39b8588 fix(tui): remove message-count truncation from session persistence (#2395) 2026-05-31 01:14:11 -07:00