Commit Graph

1567 Commits

Author SHA1 Message Date
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
Hunter Bown b3c50e0c90 fix(tui): let mouse capture keep history arrows on Windows (#1720)
* fix(tui): let mouse capture keep history arrows on Windows

* test(tui): update arrow-scroll mouse capture expectation
2026-05-26 10:06:51 -05:00
Hunter Bown 1763261503 v0.8.46: release archives, sandbox depth, quick fixes, web install, docs
* docs: v0.8.46 CHANGELOG — platform archives, palette, sub-agents, sandbox, web install, search fixes

Closes #2188

* feat(v0.8.46): quick fixes — palette, model picker Esc, sub-agent sidebar, shell chip, model name casing, CVE bump (#2212)

* fix: bump qs to >=6.15.2 for CVE-2026-8723

Add qs override in feishu-bridge package.json to force transitive
dependency resolution to >=6.15.2, addressing CVE-2026-8723.

Refs: #2198

* fix: Esc in model picker applies last-highlighted choice

Previously Esc reverted to the initial model when the user hadn't
moved the selection. Now Esc always applies the currently highlighted
model and thinking-effort tier, making Esc consistent with Enter.

Also updates the picker footer hint from 'Esc cancel' to 'Esc apply'.

Refs: #2196

* feat: show ' shell running' chip in TUI footer

Adds a footer_shell_chip function that displays a ' shell running'
status chip in the footer's right cluster whenever a foreground shell
command is active via exec_shell. The chip is always visible regardless
of user-configured status items.

Refs: #2194

* feat: auto-collapse finished sub-agents in sidebar

When a sub-agent completes (status = 'done'), its detail lines
(id, steps, duration, progress) are now hidden in the sidebar agents
panel. Only the summary label line is shown, keeping the sidebar
compact. Running agents still show full detail.

Refs: #2195

* feat: refresh Whale dark palette for better contrast

Improve contrast and layer separation in the Whale dark theme:
- Deepen base background for more depth (10,17,32)
- Lighten panel (22,34,56) for clearer distinction from bg
- Lighten elevated surface (36,52,78) for better elevation
- Lighten selection (48,68,100) for clearer selected state
- Boost text hint (138,150,174) and dim (118,130,156) readability
- Brighter border (52,88,145) for better edge definition
- Update tool surface colors for consistency

Refs: #2197

* fix: preserve model name casing in normalize_model_name_for_provider

When the user enters a model name like 'DeepSeek-V4-Flash', the
normalizer was lowercasing it to 'deepseek-v4-flash' via the
canonical_official_deepseek_model_id function. Now the normalizer
preserves the caller's casing when the input already matches a known
model id case-insensitively. Compact aliases like 'deepseek-v4pro'
are still rewritten to 'deepseek-v4-pro'.

Refs: #2109

* feat(web): install download tile with arch detection, SHA256, China mirrors + companion binary fix (#2213)

* fix(web): download both codewhale and codewhale-tui binaries in install snippets

The SNIPPETS map only fetched one binary per platform, causing the
dispatcher to fail with MISSING_COMPANION_BINARY. Every arch now
downloads both codewhale AND codewhale-tui side-by-side.

- macOS/Linux: added second curl + combined chmod/xattr/mv for tui
- Windows: added second Invoke-WebRequest for codewhale-tui.exe
- VERIFY: PowerShell now hashes both binaries; Unix --ignore-missing
  covers all present binaries in a single sha256sum pass

* feat(web): add install download tile with arch detection, SHA256, and China mirrors (#2192)

* feat(sandbox/linux): process hardening — PR_SET_DUMPABLE, NO_NEW_PRIVS, RLIMIT_CORE (#2214)

* feat(sandbox/linux): add process hardening module — PR_SET_DUMPABLE, NO_NEW_PRIVS, RLIMIT_CORE (#2183)

* feat(sandbox/linux): seccomp filter + bwrap passthrough

- seccomp: BPF filter whitelisting safe syscalls, denying ptrace/mount/kexec
  and other dangerous syscalls. Uses raw BPF instructions via libc prctl to
  avoid external dependencies (#2182).
- bwrap: optional bubblewrap passthrough when /usr/bin/bwrap is present
  and [sandbox] prefer_bwrap=true in config. Creates read-only rootfs with
  write access limited to the working directory (#2184).
- landlock detect_denial extended to recognize seccomp SIGSYS/"Bad system
  call" patterns alongside existing Landlock EACCES/EPERM detection.
- SandboxManager gains prefer_bwrap field; set_prefer_bwrap on ShellManager.
- EngineConfig gains prefer_bwrap field, wired through main/ui/runtime_threads.
- Diagnostics now reports bwrap_available and cgroup_version.
- config.example.toml documents the prefer_bwrap key.

Pre-existing clippy fixes picked up in the same build:
- collapsible_if in ui.rs version-check
- cmp_owned in goal.rs test
- consecutive str::replace in normalize_auth_mode

Closes #2182, closes #2184

* docs: add cross-links to issue and PR templates in CONTRIBUTING.md (#2215)

- Link .github/ISSUE_TEMPLATE/bug_report.md and feature_request.md from
  the Reporting Issues section
- Link .github/PULL_REQUEST_TEMPLATE.md from the Pull Request Guidelines
  section

* feat(release): bundle platform archives with install scripts (#2216)

- Add bundle job to release workflow that creates per-platform archives
  (tar.gz for Linux/macOS, .zip for Windows) containing both codewhale
  and codewhale-tui binaries plus install scripts
- Create install.bat (Windows) — copies binaries to %USERPROFILE%\bin
- Create install.sh (Unix) — copies binaries to ~/.local/bin
- Windows gets a portable .zip variant without install script
- Release notes updated to promote archives as primary download method
- Individual binaries retained for npm wrapper and scripting

Closes #2193

* fix(web_search): fall back to DuckDuckGo when Bing returns zero results (#2130)

When the configured search provider is Bing and the query returns zero
results (common for technical/compound queries), fall through to the
DuckDuckGo path instead of reporting empty. A provenance message is
surfaced: "Bing returned no results; used DuckDuckGo fallback".

Also adds Security and Code of Conduct cross-links to CONTRIBUTING.md
per the sub-agent renovation (#2203).

* docs: SANDBOX.md threat model + RFCs for persistence and MCP + SandboxExecutor trait

- docs/SANDBOX.md: complete threat model describing each platform's sandbox
  (Seatbelt, Landlock, seccomp, process hardening, bwrap, Windows v1).
  Covers defense-in-depth layering, config keys, denial detection, limitations.
- docs/rfcs/2189-persistence-sqlite.md: RFC for SQLite migration (drafted by sub-agent)
- docs/rfcs/2190-mcp-modularization.md: RFC for MCP crate split into
  protocol/client/server with OAuth support
- crates/tui/src/sandbox/policy.rs: SandboxExecutor trait definition and
  SafetyLevel→SandboxPolicyBehavior mapping function with tests

Closes #2180, closes #2186, closes #2189, closes #2190

* feat: sandbox parity tests + remove sub-agent 100-turn cap

- Add sandbox parity tests covering platform detection, denial patterns,
  bwrap preference, and policy consistency across modes (#2187)
- Remove arbitrary 100-turn sub-agent cap: DEFAULT_MAX_STEPS changed
  from 100 to u32::MAX. Sub-agents now run until they produce a final
  text response, are cancelled by the parent, or hit a configured
  explicit budget (#2034)

Closes #2187, closes #2034
2026-05-26 09:52:22 -05:00
Hunter Bown a953cc2be8 docs: refresh CodeWhale screenshot 2026-05-26 08:46:57 -05:00
Hunter Bown e92702f081 Merge pull request #2181 from Hmbown/fix/search-excludes-and-version-hint
fix: grep_files skips large dirs; add version-update footer notification
2026-05-26 07:59:57 -05:00
Hunter Bown 923911ae1d fix: use semver comparison for version-update hint
Replaced naive  with parse_semver tuple comparison
so dev builds (e.g. "0.8.46-pre") don't trigger false update hints.
Falls back to string compare when either side is non-semver.

Caught by Gemini Code Assist review on PR #2181.
2026-05-26 07:58:40 -05:00
Hunter Bown e0c8e8d89a fix: grep_files skips large dirs; add version-update footer notification
grep_files default excludes now include bare directory names
(e.g. "node_modules") alongside the "dir/*" variants. The glob
matcher requires a '/' to match "dir/*", so the bare form skips
the directory traversal entirely instead of descending and filtering
each file — fixes 7MB result payloads from node_modules (#2200).

Added a background version check that fetches the latest GitHub
release tag once per TUI session. When a newer version is available,
the footer renders a persistent toast:
  "vX.Y.Z available — run `codewhale update` and restart"
Silent on network errors (5s timeout).
2026-05-26 07:31:53 -05:00
Hunter Bown 325aec396d docs: v0.8.45 harness framing — READMEs, website, metadata, contributors
- README: new tagline, What Is It/Key Features → harness framing
- README.zh-CN/ja-JP: matching Chinese/Japanese translations
- web/app/page.tsx: updated hero, description, three-column grid, flywheel
- web/app/layout.tsx: metadata title + description for harness framing
- website/index.html + zh/: hero, feature grid, install command
- README: updated contributor credits for v0.8.45 (idling11, gaord, h3c-hexin, cyq1017, reidliu41, wdw8276, zlh124)
2026-05-26 06:40:12 -05:00
Hunter Bown c47ed896dc fix: DeepSeek-first v0.8.45 — CODEWHALE_* env aliases, remove public Kimi/Moonshot promotion
Closes #2164 (superseded).
2026-05-26 06:03:10 -05:00
Hunter Bown 6011888cfd Merge pull request #2158 from Hmbown/fix/kimi-api-key-setup
fix(kimi): support API-key setup for Kimi Code
2026-05-25 23:47:05 -05:00
Hunter Bown ab38635f78 fix(kimi): support API-key setup for Kimi Code 2026-05-25 23:39:34 -05:00
Hunter Bown 2f3750b850 Merge pull request #2153 from Hmbown/docs/v0.8.45-communications
docs(v0.8.45): complete changelog, README, and website refresh
2026-05-25 23:15:04 -05:00
Hunter Bown c4e91446af test(cli): format provider env regression cases 2026-05-25 23:07:12 -05:00
Devin AI 0628adab38 test: add table-driven env-forwarding regression test for all providers
Covers Openrouter, Novita, NvidiaNim, Fireworks, Sglang, Vllm, Ollama,
Atlascloud, and WanjieArk — the providers that were silently expanded
by the generic provider_env_vars loop but had no test coverage beyond
the existing Moonshot and OpenAI cases.

Co-Authored-By: bot_apk <apk@cognition.ai>
2026-05-26 03:47:42 +00:00
Hunter Bown 64c870f35c docs(web): sync v0.8.45 facts and provider surface 2026-05-25 22:07:10 -05:00
Hunter Bown 85e9a46ddf docs(readme): refresh provider list and Windows surface 2026-05-25 22:06:51 -05:00
Hunter Bown 05e4b08335 fix(cli): allow Moonshot Kimi TUI delegation 2026-05-25 22:06:44 -05:00
Hunter Bown af1f99e85d docs(changelog): add missing v0.8.45 entries 2026-05-25 22:06:39 -05:00
Hunter Bown 70a655cddb test: use open model sentinels 2026-05-25 18:51:05 -05:00
Hunter Bown 228372935e chore(release): prepare v0.8.45
Harvested from PR #2118 by @Hmbown.

Includes Kimi/Moonshot OAuth, v0.8.45 release prep, the Codex/ChatGPT OAuth removal, open-source-first model defaults, and the safe green PR batch merged into main before the release branch refresh.
2026-05-25 18:45:36 -05:00
kitty c7bd7f161e feat: session title in composer
Harvested from PR #2108 by @wdw8276.

Co-authored-by: kitty <dw_wang126@126.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 18:29:22 -05:00
Hanmiao Li 1a78e3cc7e feat(tui): add sidebar hover tooltip for truncated Work/Tasks lines
Harvested from PR #2110 by @idling11.

Co-authored-by: Hanmiao Li <894876246@qq.com>
2026-05-25 18:28:48 -05:00
Hanmiao Li b45287133b feat: embed user prompt in snapshot labels for readable /restore listings
Harvested from PR #2111 by @idling11.

Co-authored-by: Hanmiao Li <894876246@qq.com>
2026-05-25 18:28:04 -05:00
cyq 43f317d524 fix(tui): start actionable goal prompts
Harvested from PR #2097 by @cyq1017.

Co-authored-by: cyq <15000851237@163.com>
2026-05-25 18:27:24 -05:00
cyq 7976374e91 fix(tui): emit subagent completion before terminal update
Harvested from PR #2120 by @cyq1017.

Co-authored-by: cyq <15000851237@163.com>
2026-05-25 18:26:39 -05:00
hexin 9c8e482607 fix(engine): keep auto-compaction working on sub-500K self-hosted windows
Harvested from PR #2060 by @h3c-hexin.

Co-authored-by: hexin <he.xin@h3c.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 18:25:58 -05:00
hexin aa468c3078 fix(engine): use user role for sub-agent completion runtime message
Harvested from PR #2057 by @h3c-hexin.

Co-authored-by: hexin <he.xin@h3c.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 18:25:07 -05:00
Reid c238aec638 fix(tui): keep model picker selection on Esc
Harvested from PR #2056 by @reidliu41.

Co-authored-by: reidliu41 <reid201711@gmail.com>
2026-05-25 18:18:03 -05:00
Reid c483cd525d fix(tui): simplify approval confirmation flow
Harvested from PR #2143 by @reidliu41.

Co-authored-by: reidliu41 <reid201711@gmail.com>
2026-05-25 18:17:31 -05:00
Hunter Bown 37dd821f33 Add Kimi OAuth provider support
Adds Moonshot/Kimi provider support with Kimi CLI OAuth reuse and review fixes for secure refresh writes, model completion, CLI auth, and secret-store behavior.
2026-05-25 17:48:05 -05:00
Hunter Bown a6bd5ac08b v0.8.45: add voice input, RLM session objects, and slash recovery fix (#2047)
* feat(tui): add command palette voice input

* feat(rlm): expose active session objects

* fix(tui): do not restore slash commands as retry drafts

* fix(config): expose voice input settings rows

* fix: sync ActiveTurnState.auto_approve when remember is set

When a user checks 'Remember for this tool' and approves a tool call,
remember_thread_auto_approve() only persisted thread.auto_approve to disk
but did not update the in-memory ActiveTurnState for the current turn.
This meant subsequent tool calls within the same turn would still require
manual approval, making the remember checkbox appear non-functional.

Now remember_thread_auto_approve() also sets
ActiveTurnState.auto_approve = true, so active_turn_flags() returns
the correct value and the approval_decision() logic auto-approves
remaining tool calls in the current turn.

(cherry picked from commit 2ccf048c8984d61e3341a4304d0796a1f965d3e7)

* test(runtime): cover remembered auto approve on active turn

---------

Co-authored-by: Ben Gao <bengao168@msn.com>
2026-05-24 22:19:50 -05:00
jayzhu de9937c7a7 fix(skills): parse YAML block scalars in SKILL.md frontmatter (#1908)
Closes #1907. Thanks @zlh124 for the clear parser-level repro, implementation, and block-scalar/chomping test coverage.
2026-05-24 21:20:10 -05:00
Hunter Bown d22da53e2d feat(v0.8.45): land control-plane workstream slices (#2035)
Includes cancellable file_search/list_dir behavior, deterministic sub-agent whale-species nicknames, and an honest /balance command scaffold for the provider-billing work. Reviewed the overlapping file-search cancellation contribution in #2044 from @h3c-hexin; that PR's Windows failure was unrelated to the cancellation code, and the contributor context is preserved here.
2026-05-24 21:18:54 -05:00
Reid 4a9f7cbb2b fix(tui): highlight user messages in transcript (#1995)
Closes #1672. Thanks @reidliu41 for the focused TUI contrast fix and tests, and @lpeng1711694086-lang for the original visual distinction request.
2026-05-24 21:11:09 -05:00
Hunter Bown b220113a79 fix(release): keep receipt test stable on 1.88 2026-05-24 17:57:27 -05:00
Hunter Bown f13108bb81 fix(release): keep receipt truncation stable 2026-05-24 17:50:39 -05:00
Hunter Bown dbbc51a700 fix(release): satisfy v0.8.44 parity clippy 2026-05-24 17:17:03 -05:00
Hunter Bown 0ebc04f043 fix(tests): repair Windows CI failures
- composer_history: raise deadline to 10s on Windows for writer thread
- prompts: make memory_guidance tier-order assertion CRLF-agnostic
- gitattributes: enforce LF line endings for include_str!() prompt files

Regression from the v0.8.44 release changes — the writer thread batching
and the updated constitutional tier ordering in memory_guidance.md both
uncovered Windows-only test flakes.
2026-05-24 17:11:26 -05:00
Hunter Bown 1d0c74125b docs(readme): sync localized contributor credits 2026-05-24 17:11:26 -05:00
Hunter Bown 411ae89c19 fix(release): repair v0.8.44 gates 2026-05-24 17:11:26 -05:00
Hunter Bown 93ee76810b feat(v0.8.44): one-time config migration from ~/.deepseek/ to ~/.codewhale/
migrate_config_if_needed() copies config.toml on first launch.
Called in run_interactive after config creation. Non-fatal,
never overwrites an existing primary config.
2026-05-24 16:25:17 -05:00
Hunter Bown 1a311c591f chore: bump version to 0.8.44
Workspace version 0.8.43 → 0.8.44. All path dependency pins
and npm package version updated accordingly.
2026-05-24 16:22:44 -05:00
Hunter Bown a21f67f59f docs: finalize CHANGELOG v0.8.44 with all features 2026-05-24 16:13:38 -05:00
Hunter Bown 11d1d5c277 feat(v0.8.44): human-readable agent role labels in transcript cards
#1981: DelegateCard now shows readable roles (scout, builder,
reviewer, etc.) instead of raw agent_type strings, and uses the
completion summary as the primary detail when available. Raw
agent_ids are truncated to 8 chars as secondary detail.
2026-05-24 16:13:10 -05:00
Hunter Bown 80111ffad3 feat(v0.8.44): plan detail display + session picker on startup
#834: PlanPromptView now renders the plan explanation and steps
(when update_plan was called) before the action options. Uses
PlanSnapshot from the shared plan state.

#1638: Session picker auto-opens on clean startup when saved
sessions exist and no --resume/--continue/--fresh was specified.
No new TuiOptions field needed — uses existing resume_session_id.
2026-05-24 16:07:03 -05:00
Hunter Bown c63d042c15 feat(v0.8.44): steer instead of queue when busy-waiting (#2009)
When the model is busy but not actively streaming text (waiting on
tool results, sub-agents, or shell commands), Enter now tries to steer
the message into the current turn rather than silently queueing it.
If steering fails, the message falls back to queuing.

During active streaming, Enter still queues to avoid interrupting
in-flight reasoning. Ctrl+Enter forces Steer in all busy states.
2026-05-24 15:39:14 -05:00
Hunter Bown 698722c946 feat(cli): --continue/-c flag forwards to TUI resume path
Other agent: root_tui_passthrough() builds forwarded args, rejects
--continue + -p combo (directs to codewhale exec --continue).
Tests: parses_top_level_continue, top_level_continue_rejects_one_shot.

Session picker: formatting cleanup on test calls.
2026-05-24 15:36:54 -05:00