Commit Graph

1190 Commits

Author SHA1 Message Date
Hunter Bown ac6693581f fix(tools): restore checklist and planning tools to default active catalog
PR #2076 deferred planning/checklist tools (checklist_write, update_plan,
task_create, task_list, task_read) to reduce catalog tokens, but the system
prompt actively instructs the model to use these tools. Without them in the
active catalog, the model cannot call them until it first discovers them via
tool_search, which it is not prompted to do for planning tools.

Keep these tools in DEFAULT_ACTIVE_NATIVE_TOOLS so the model can follow
the Constitution's Regulations (Tier 3) and the Mode: YOLO instructions.
2026-05-26 16:40:16 -05:00
Hunter Bown 11e1ec1fe3 docs: add v0.8.47 CHANGELOG entries for composer, CNB mirror, fixes 2026-05-26 16:39:39 -05:00
Hunter Bown 92c8dbc7ce fix(composer): use wrap_input_lines_for_mouse, clamp selection to input length
- Replace visible_line_char_ranges with wrap_input_lines_for_mouse for accurate mouse selection
- Clamp selection_anchor and cursor_position to char_count
- Clear selection on history navigation to prevent stale highlights
- Add test for history-navigation-clears-stale-selection
2026-05-26 16:39:39 -05:00
Hunter Bown 74878dcd30 refactor(tools): replace Semaphore with RwLock for parallel-safe tool execution
- Use OwnedRwLockReadGuard for parallel-safe tools, OwnedRwLockWriteGuard for serial
- Add TOOL_EXECUTION_LOCK_HELD task-local for reentrancy detection
- Add BlockingHandler test harness and parallel-vs-serial concurrency tests
2026-05-26 16:39:39 -05:00
Hunter Bown 60c1b6619c style: rustfmt cleanups and minor formatting fixes
- Line-wrap long function signatures and format arguments
- Fix bracket placement for early returns (consistent style)
- Use [!] instead of [✓] for network-denied skill sync
- Fix copy-selection ordering: clear after success, not always
2026-05-26 16:39:28 -05:00
Hunter Bown 8822e9873a refactor: finish state-root migration — all runtime paths now .codewhale
- .gitignore: add deep-swe/ and all_preds.jsonl to prevent accidental commits
- config.rs: home_config_path(), managed_config, requirements, mcp, notes,
  memory all prefer ~/.codewhale/config.toml with .deepseek fallback
- commands/config.rs: config_toml_path() prefers .codewhale
- commands/anchor.rs: anchors_path prefers .codewhale/anchors.md
- commands/note.rs: notes_path prefers .codewhale/notes.md
- skills/install.rs: cache defaults to .codewhale/cache/skills
- skills/mod.rs: global skills discovery includes .codewhale/skills
- file_frecency, clipboard, onboarding, audit, task_manager: all .codewhale
- project-local paths (onboarding trust) still .deepseek for compat

Closes #2231.
2026-05-26 15:06:04 -05:00
Hunter Bown 236ad4137d feat: harvest 6 community PRs for v0.8.47
Harvested and vetted — no malware, no external deps, no injection:
- #1859 (@harvey2011888): loop guard now reports Failed on halt
- #1870 (@victorcheng2333): honour DEEPSEEK_YOLO env on startup
- #1935 (@IIzzaya): replace [x] with [✓] completion markers
- #1837 (@PurplePulse): fix macOS title centering (pin to top)
- #1967 (@cyq1017): show base_url in /config view
- #1906 (@knqiufan): copy transcript without visual-wrap newlines

Also fix cycle_manager archive_dir_for to use resolve_state_dir
so recall_archive tests pass with the migrated sessions path.

Co-authored-by: victorcheng2333 <victorcheng2333@users.noreply.github.com>
Co-authored-by: IIzzaya <IIzzaya@users.noreply.github.com>
Co-authored-by: PurplePulse <PurplePulse@users.noreply.github.com>
Co-authored-by: cyq1017 <cyq1017@users.noreply.github.com>
Co-authored-by: knqiufan <knqiufan@users.noreply.github.com>
2026-05-26 14:34:21 -05:00
Hunter Bown 0706285bfe feat(update): add CNB mirror support for China-friendly binary downloads
- Add CODEWHALE_RELEASE_BASE_URL as canonical env override for release
  asset base URL (DEEPSEEK_TUI_RELEASE_BASE_URL and DEEPSEEK_RELEASE_BASE_URL
  remain as legacy fallbacks).
- Add CODEWHALE_USE_CNB_MIRROR env var to auto-select the CNB (cnb.cool)
  mirror for binary downloads, avoiding GitHub Releases timeouts in China.
- Update npm install scripts (artifacts.js) with the same env checks.
- Update Rust self-updater (update.rs) with new constants and env cascade.

Fixes #2222.
2026-05-26 14:19:26 -05:00
Hunter Bown 4925be4dda refactor: migrate handoff, notes, mcp, subagent, recall, anchors to .codewhale
- HANDOFF_RELATIVE_PATH → .codewhale/handoff.md with .deepseek fallback
- load_handoff_block reads both paths, prefers .codewhale
- ToolContext notes_path and mcp_config_path use resolve_project_state_dir
- Sub-agent state path prefers .codewhale/state/
- Cycle archive (recall_archive) uses resolve_state_dir for sessions
- Compaction anchors path prefers .codewhale/anchors.md
- Updated marker constants and comments

Part of #2231.
2026-05-26 14:16:02 -05:00
Hunter Bown a1a7b5709a refactor: migrate more state paths to ~/.codewhale with legacy fallback
- Spillover directory (truncate.rs): prefer ~/.codewhale/tool_outputs
- Memory storage (capacity_memory.rs): prefer ~/.codewhale/memory
- Runtime logs (runtime_log.rs): prefer ~/.codewhale/logs
- Crash dumps (utils.rs): prefer ~/.codewhale/crashes
- Automations (automation_manager.rs): prefer ~/.codewhale/automations
- TUI settings (settings.rs): prefer ~/.codewhale/tui.toml

All paths fall back to the legacy ~/.deepseek location when the
canonical path doesn't exist, preserving compatibility for existing
installs.

Part of #2231.
2026-05-26 13:50:31 -05:00
Hunter Bown 9540af268f fix(tests): update save-default-path test for managed sessions dir
The /save command now writes to ~/.codewhale/sessions (or legacy
~/.deepseek/sessions) instead of the workspace root. Update the test
to set CODEWHALE_HOME to a temp directory and pre-create the sessions
subdirectory so resolve_state_dir picks the primary path.

Fixes the first failing test in #2223.
2026-05-26 13:45:18 -05:00
Hunter Bown b9596a9640 fix(tui): flush active cell before inserting steer message in transcript
Steered/queued user messages were being inserted into app.history
before the active cell (holding streaming thinking/tool content) was
flushed, causing the user's message to render above (before) the
thinking block that chronologically preceded it.

Now call app.flush_active_cell() before app.add_message() in
steer_user_message(), matching the pattern used in MessageStarted
and MessageDelta handlers.

Fixes #2225.
2026-05-26 13:39:57 -05:00
Hunter Bown 0251b4e8e8 refactor: migrate snapshot and skill_state paths to ~/.codewhale
- Add resolve_project_state_dir and ensure_project_state_dir to
  codewhale-config, providing project-local .codewhale/.deepseek
  resolution matching the home-directory pattern.
- Migrate snapshot paths to prefer ~/.codewhale/snapshots with
  ~/.deepseek/snapshots fallback (snapshot_base_with_home).
- Migrate skill_state.rs to use codewhale_config::ensure_state_dir
  instead of hardcoded home.join(".deepseek").
- Update doc comments to reference canonical .codewhale paths.

Part of #2231 (state-root migration).
2026-05-26 13:39:01 -05:00
Hunter Bown a554aa9603 feat(project-context): add tracing log when context file is loaded
Emit a tracing::info! line with the file path and byte size when a
project context file (AGENTS.md, CLAUDE.md, etc.) is successfully loaded.
This helps users and maintainers verify which file was used during
prompt assembly, addressing the confusion reported in #2227.
2026-05-26 13:20:25 -05:00
Hunter Bown 84463711b4 feat(composer): mouse + keyboard text selection with copy/cut
Add mouse drag selection and Shift+Arrow text selection in the composer
input box. Ctrl+C copies selected text; Ctrl+X cuts (or toggles mode if
no selection). Selection highlighting uses the theme's selection_bg color.
Mouse coordinate mapping accounts for wrapping, scroll offset, and padding.

Also fix Home, End, Ctrl+A, and Ctrl+E to clear the selection anchor
before jumping, matching the existing Left/Right behavior. Without these
calls a stale anchor silently reforms a selection and can cause unintended
deletions on the next keystroke.

Harvested from #2228.

Co-authored-by: imkingjh999 <imkingjh999@users.noreply.github.com>
2026-05-26 13:14:55 -05:00
Hunter Bown a06bbe57a6 fix(tools): replace cross-await RwLock with Semaphore to prevent deadlock
Replace `Arc<RwLock<()>>` in ToolCallRuntime with `Arc<Semaphore>` to
eliminate the risk of a tool re-entering and deadlocking on the same lock.
Parallel tools now acquire then immediately drop the permit, allowing
concurrent execution after any in-flight serial tool finishes. Serial
tools hold the permit for the full duration.

Fixes #2157. Harvested from #1856.

Co-authored-by: Fire-dtx <58944505+Fire-dtx@users.noreply.github.com>
2026-05-26 13:09:48 -05:00
Hunter Bown aa83446d6b fix(tests): use cat instead of true in wlcopy test to avoid EPIPE
The wlcopy_helper_succeeds_when_binary_returns_zero test used
`true` as a stand-in for wl-copy, but `true` exits immediately
without reading stdin.  On Linux CI runners the process exits
before the parent can write to the pipe, producing EPIPE and
failing the is_ok() assertion.

Switch to `cat` which reads stdin until EOF (when the pipe is
closed) and then exits 0, faithfully modelling a successful
wl-copy invocation.
2026-05-26 12:23:49 -05:00
Hunter Bown e5e34d4063 fix: resolve clippy warnings for Rust 1.95 — vec_init_then_push, unnecessary_map_or 2026-05-26 12:13:30 -05:00
Hunter Bown 2ef1c3666f chore: bump release lane to 0.8.46 2026-05-26 11:52:48 -05:00
Hunter Bown 586f3f325e test: align windows notification fallback 2026-05-26 11:32:31 -05:00
Hunter Bown 003a81d37d test: align macos CI assertions 2026-05-26 11:21:18 -05:00
Hunter Bown 5774c7d2e2 fix: restore project config guardrails 2026-05-26 11:13:38 -05:00
Hunter Bown 3d8a6cffc5 fix: unblock Windows checkout and version drift 2026-05-26 11:05:55 -05:00
Hunter Bown a0ab16a814 fix: sync CHANGELOGs, add v0.8.46 community credits, remove invalid '...' file
- Sync root and crate CHANGELOG.md for version drift check
- Add community contributor credits to [0.8.46] section
- Remove stray '...' file that broke Windows git checkout
2026-05-26 10:54:19 -05:00
Hunter Bown 34ee957e5e style: fix rustfmt issues from community PR merges 2026-05-26 10:52:13 -05:00
Hunter Bown 1d9917d3f2 fix: resolve compilation errors and clippy warnings from community PR merges
- config/src/lib.rs: remove undefined has_api_key variable (#2062 conflict)
- ui.rs: clone receipt before move into set_receipt_text
- footer_ui.rs: convert &str to String for if/else type consistency
- rlm.rs: use ref bindings to avoid partial moves of stdout/stderr_preview
- file.rs: prefix unused fuzz variable
- update.rs: remove redundant borrows
- tests.rs: allow print_stderr on catalog metrics test function

All clippy warnings resolved. CI should go green.
2026-05-26 10:50:16 -05:00
Ben Younes 73085e6e69 feat(cli): add thread clear-name to remove a custom thread title (1600) (#1939)
Issue 1600 asks for full rename UX: set a custom title, remove it back
to `(unnamed)`. The set side already shipped as `deepseek thread
set-name <id> <name>`, but there was no inverse — users who wanted to
drop a no-longer-relevant title had to either edit the SQLite store by
hand or set a placeholder string.

Add `deepseek thread clear-name <id>`, mirroring the existing
`SetName` arm in `run_thread_command`: look up the thread, set
`name = None`, refresh `updated_at`, upsert. Printed confirmation is
`cleared name for <id>` so it stays distinguishable from the
`renamed` line emitted by `set-name`.

Snapshot help test and the parser-matrix test both gain the new
subcommand. No state-store changes: `upsert_thread` already accepts
`name: None` and `thread list` already prints `(unnamed)` when the
field is empty, so the round-trip is complete with this CLI-only
change.

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-26 10:38:31 -05:00
kunpeng-ai-lab c97c3a7a04 Summarize Cargo failures in tool metadata (#1973)
* Summarize cargo failures in tool metadata

* fix: preserve shell summaries for cargo failures

---------

Co-authored-by: Codex <codex@local>
2026-05-26 10:38:27 -05:00
kunpeng-ai-lab 16728360f1 Expose apply_patch preflight metadata (#1971)
* Expose apply_patch preflight metadata

* test: harden apply_patch preflight metadata

---------

Co-authored-by: Codex <codex@local>
2026-05-26 10:38:23 -05:00
Quentin Lian dca48545df fix(tui): upgrade portable-pty to 0.9 for LoongArch64 support (#1992)
portable-pty 0.8.1 depends on nix 0.25.1, which lacks loongarch64 in
its ioctl cfg blocks, causing a build failure on LoongArch64 Linux.

portable-pty 0.9.0 depends on nix ^0.28, which fully supports
loongarch64. The public API surface used by CodeWhale is unchanged.

Closes #1945
2026-05-26 10:38:17 -05:00
Shen Bowen b6afb4c030 refactor: extract file-tree key handling into key_actions module (#2042)
* refactor: extract file-tree key handling into key_actions module

* refactor: simplify file_tree_key with early Esc return and let-else binding

* fix: address review comments on file-tree key_actions refactor

Restore file_tree_visible guard, remove stale KeyActionResult docs, unify format string style.
2026-05-26 10:38:12 -05:00
New2Niu d1b5cf6f1c feat: fuzzy command (#2043)
Co-authored-by: lei <liulei@8531.cn>
2026-05-26 10:38:07 -05:00
hexin 4f3a0c3cfc feat(engine): allow DEEPSEEK_MAX_OUTPUT_TOKENS env override for tight-context providers (#2147)
The `effective_max_output_tokens` heuristic defaults to 64K for any model
not in the known-context-window table. This is fine for DeepSeek's hosted
API (1M context) but causes immediate HTTP 400s on self-hosted providers
with tight `max-model-len`.

Example: vLLM serving Qwen3.6 with `--max-model-len 65536` rejects
requests because 64000 (output) + ~1500 (input) exceeds the limit by 1
token.

This change lets the operator set `DEEPSEEK_MAX_OUTPUT_TOKENS=16384` (or
whatever fits their deployment) to override the heuristic. The env var
takes precedence over the model-table lookup when set to a positive
integer; otherwise the existing behavior is preserved.

No new config struct field — env-only override keeps the public API
unchanged. Useful for embedded users (e.g. pinvou3) who need to control
output budget without forking the engine config schema.

Co-authored-by: hexin <he.xin@h3c.com>
2026-05-26 10:31:26 -05:00
dongchao 60a3069705 fix(paste): defer large-paste @file consolidation to submit time (#2168) 2026-05-26 10:31:21 -05:00
Justin Gao 0611b86863 feat: session token breakdown in footer and /status (#2152)
* feat: session token breakdown in footer and /status

Add accumulated session token tracking with input / cache-hit / output
breakdown. Rebased from PR #1666 onto post-rebrand main (v0.8.45).

Changes:
- SessionState: new total_input_tokens, total_cache_hit_tokens,
  total_cache_miss_tokens, total_output_tokens fields
- Turn outcome handler: accumulate per-turn token breakdown
- StatusItem::Tokens: new footer chip, enabled by default
- Footer chip: "12K in · 8.1K cch · 2.5K out" format
- /status: expanded with session input/cache/output rows
- /clear and /load: reset accumulated breakdown

* fix: address review feedback — current_session_id, cache guarding, DRY helper

- Restore app.current_session_id assignment accidentally dropped in
  apply_loaded_session during rebase (P1: breaks startup-resume and
  session-sync paths)
- Guard cache-hit/miss accumulation behind is_some() so providers
  that omit cache telemetry don't inflate miss totals
- Extract SessionState::reset_token_breakdown() to avoid duplicating
  the four-field reset in core/session/ui call sites
- Hide the "cch" segment from the footer token chip when no cache
  data has been recorded
- Show "not reported" in /status session-cache row instead of
  "0 hit / 0 miss" when no cache telemetry is available
2026-05-26 10:31:15 -05:00
Zhao Xiaohong ee03d1fd80 feat(web): add Metaso as a web search provider (metaso.cn) (#2059)
Adds Metaso AI Search as a new SearchProvider option alongside Bing,
DuckDuckGo, Tavily, and Bocha.

Co-authored-by: Zhao Xiaohong <zhaoxiaohong@metasota.ai>
2026-05-26 10:31:09 -05:00
庄表伟 bba5617942 Improve update release channels (#2145)
* Improve update release channels

* Address update channel review feedback

* Prevent beta update downgrades
2026-05-26 10:30:58 -05:00
hexin 795de325d7 fix(grep_files): wrap walk in spawn_blocking + 30s timeout (#2146)
grep_files runs its directory walk and per-file regex synchronously inside
the async execute(). On a large tree this pins the runtime worker for
minutes, so the turn loop can't observe the cancel token and the stop
button stays unresponsive — the same failure file_search fixed in #2035.

Mirror that fix: move the blocking walk onto spawn_blocking, bounded by a
30s hard timeout with a biased select on the cancel token, via a
run_blocking_grep helper that parallels run_blocking_file_search. Output
and the existing per-file/per-line cancel checks are unchanged.

Co-authored-by: hexin <he.xin@h3c.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:30:52 -05:00
Hanmiao Li 81480ba099 fix: vLLM provider — pass through reasoning_effort, downgrade max to high (#2169) (#2170) 2026-05-26 10:30:47 -05:00
Shen Bowen d107b7468d fix(paste): preserve Enter suppression window after non-char keys during paste (#2174)
* fix(paste): preserve Enter suppression window after non-char keys during paste

* chore(paste): add debug_assert for buffer precondition in deactivate_keep_window

Documents the invariant that buffer must be flushed before calling deactivate_keep_window. The assert fires in debug builds only, catching future misuse without masking upstream bugs.
2026-05-26 10:30:42 -05:00
Sskift 2c12371257 fix(cli): avoid default env overrides for profiles (#2119)
* fix(cli): avoid default env overrides for profiles

* test(cli): lock auth mode profile handoff behavior

* test(cli): restore prompt flag coverage

---------

Co-authored-by: liushiao <liushiao@bytedance.com>
2026-05-26 10:30:36 -05:00
Lellansin Huang e03f7f945d fix(tui): skip project-scope config merge when workspace is home directory (#2055)
When the workspace is the user's home directory, the project-scope
config file (~/.deepseek/config.toml) is also the global config file.
Skip the merge to avoid redundant processing and a misleading
"project-scope config key ignored" warning on every launch from ~.

Fixes the home-directory false-positive in the #417 deny-list
check: the deny-list correctly refuses dangerous keys at project
scope, but when cwd == $HOME the project file *is* the global file
so the warning is noise.
2026-05-26 10:30:31 -05:00
nanookclaw d022d2b293 fix: show search provider in doctor output (#2135)
Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
Co-authored-by: Nanook <nanookclaw@users.noreply.github.com>
2026-05-26 10:30:20 -05:00
dongchao 5fcb399a38 fix(rlm): route large stdout/stderr via var_handle instead of inlining (#2163) 2026-05-26 10:29:03 -05:00
dongchao 87f7f05fee fix: improve user feedback during long operations and on turn completion (#2166)
Three interrelated feedback issues resolved:

1. Windows desktop notifications (notifications.rs)
   - resolve_method() now returns Method::Bel on Windows instead of
     Method::Off, so windows_bell() (MessageBeep) fires a system
     notification sound when a long turn completes.

2. Tool output summary truncation (history.rs)
   - TOOL_TEXT_LIMIT increased from 180 to 300 characters, reducing
     the chance that meaningful tool output is cut short in the
     one-line summary shown in tool cards.

3. Turn completion status visibility (ui.rs)
   - Added a push_status_toast(Info, 10s TTL) call alongside the
     existing set_receipt_text() in the TurnComplete handler. The
     receipt text is now visible in both the composer border (8s)
     and the footer status bar (10s).

4. Footer working-time feedback (footer_ui.rs)
   - Footer state label now includes elapsed seconds from
     turn_started_at immediately, instead of waiting 30 seconds for
     the stall_reason classification to kick in.
   - When app.is_loading is true, the label shows elapsed time so
     users see ongoing progress during model-loading phases.
2026-05-26 10:28:58 -05:00
Paulo Aboim Pinto cd357de0c8 feat: QoL — taskbar progress, animated title spinner, and configurable completion sound (#1871) 2026-05-26 10:28:21 -05:00
dongchao 5fcc460c33 fix(runtime): truncate assistant summary on UTF-8 char boundary to prevent CJK panic (#2167) 2026-05-26 10:10:06 -05:00
dongchao 7c0e242895 fix(edit_file): always retry fuzzy fallback on first search miss (#2154) 2026-05-26 10:10:01 -05:00
hongqitai 6bd702d6a6 test(settings): handle TERM_PROGRAM env var in no_animations_env_reco… (#2171)
* test(settings): handle TERM_PROGRAM env var in no_animations_env_recognises_truthy_spellings_only

Clear and restore TERM_PROGRAM environment variable during tests
to prevent low_motion being forced in vscode, ghostty and Termius.

* test(settings): handle other environment variables that can independently force low_motion in no_animations_env_recognises_truthy_spellings_only

---------

Co-authored-by: hqt <you@example.com>
2026-05-26 10:09:56 -05:00
Hunter Bown 2a41102e0c feat: defer low-value native tools by default, reduce catalog tokens 73% (#2076) 2026-05-26 10:08:09 -05:00