Commit Graph

1700 Commits

Author SHA1 Message Date
zhuang biaowei d26c2128b8 Retry MCP calls after stale SSE connections 2026-05-30 19:17:45 -07:00
zhuang biaowei 58c57cb798 Improve MCP SSE error diagnostics 2026-05-30 19:17:45 -07:00
zhuang biaowei 29417b3b37 Require explicit MCP SSE transport 2026-05-30 19:17:45 -07:00
zhuang biaowei 37f936eda4 Address MCP SSE review comments 2026-05-30 19:17:45 -07:00
zhuang biaowei b907ea123c Fix legacy MCP SSE connections 2026-05-30 19:17:45 -07:00
donglovejava 98cc2a6e50 fix: trailing newline in footer_ui.rs (cargo fmt) 2026-05-30 19:17:42 -07:00
donglovejava 9ef5a6d782 fix(tui): replace standalone compacting label with animated working label 2026-05-30 19:17:42 -07:00
Nightt 5c7209af83 fix: harden startup prompt dispatch 2026-05-30 19:17:39 -07:00
Nightt fde5959e3d feat: keep startup prompts interactive 2026-05-30 19:17:39 -07:00
Justin Gao 43f098965e fix: clear last_pinned_prefix_hash on model/provider switch
clear_model_scoped_telemetry() now resets last_pinned_prefix_hash to
None so /cache stats does not show the previous model/provider cache
scope's fingerprint after a switch.
2026-05-30 19:16:32 -07:00
Justin Gao a053d1e07a fix: address code review — stale hash, cache aggregation, hash clearing
- Move pinned_hash extraction after check_and_update() so the reported
  hash reflects the current prefix state, not the previous turn
- Skip non-cache-aware turns (cache_hit_tokens=None) in /cache stats
  aggregation; infer miss tokens when cache_miss_tokens is None
- Clear last_pinned_prefix_hash to None when pinned_combined_hash is
  empty (e.g. switching to a non-caching model/provider)
2026-05-30 19:16:32 -07:00
Justin Gao dd69f66775 chore: cargo fmt fixes for /cache stats PR 2026-05-30 19:16:32 -07:00
Justin Gao bcdaf81a04 feat: add /cache stats — prefix hash/drift exposure and cache-hit summary (#2264)
Surfaces the current pinned prefix fingerprint hash and stability
diagnostics via a new `/cache stats` subcommand, per the low-risk
0.8.x slice agreed on in #2264.

Changes:
- EngineEvent::PrefixCacheChange now carries pinned_combined_hash
  from PrefixStabilityManager so the TUI layer can surface it
- App.last_pinned_prefix_hash stores the hash per-turn for /cache stats
- New /cache stats command renders three sections:
  - Prefix Stability: pct, checks, changes, last-change description
  - Prefix Fingerprint: full SHA-256 hash, short id, drift warning
  - Cache Hit Rate: aggregated token totals + low-hit advisory
- format_tokens() helper for compact K/M token display
- 6 unit tests covering: no-data, stable, drift warning, hit-rate
  summary, low-hit advisory, token formatting

Refs: #2264
2026-05-30 19:16:32 -07:00
cyq 63be80d835 fix(tui): keep render debug logs in codewhale dir 2026-05-30 19:16:29 -07:00
cyq 8f93713860 feat(tui): add render diff debug log 2026-05-30 19:16:29 -07:00
donglovejava 03c4b6bd24 fix: trailing newline in project_context.rs (cargo fmt) 2026-05-30 19:16:25 -07:00
donglovejava 32f424df26 fix(tui): skip hidden worktrees in workspace discovery to prevent TUI saturation 2026-05-30 19:16:25 -07:00
Hunter Bown cb7614a918 fix(tui): skip hidden worktrees in discovery walks 2026-05-30 19:16:25 -07:00
donglovejava da590e5528 fix: remove spurious #[cfg(target_os = windows)] blocking ratatui import on non-Windows 2026-05-30 19:16:21 -07:00
donglovejava 09d3131dc2 fix(windows): restore ENABLE_WINDOW_INPUT console flag after enable_raw_mode for IME support 2026-05-30 19:16:21 -07:00
donglovejava 1ff5db1663 fix: cargo fmt and suppress dead_code warnings for unused paste-burst methods 2026-05-30 19:16:21 -07:00
donglovejava 09b4f7898b fix(tui): route IME-committed Chinese characters directly to composer instead of paste-burst buffer 2026-05-30 19:16:21 -07:00
donglovejava 5d0a1c848e fix(tools): eagerly load all exec_shell companion tools 2026-05-30 19:16:18 -07:00
Nightt 9d3d453c50 fix: use cached branch in footer 2026-05-30 19:16:15 -07:00
Nightt 06aa24a17a feat: show git branch in default footer 2026-05-30 19:16:15 -07:00
hexin 0b7660ddc5 docs(constitution): Tier 5 Local Law covers EngineConfig.instructions paths
Article VII Tier 5 currently lists four hard-coded path conventions
(AGENTS.md / CLAUDE.md / .codewhale/instructions.md / .deepseek/instructions.md)
as the canonical Local Law sources. Embedders that inject instructions via
`EngineConfig.instructions` (rather than placing files at one of those four
paths) get their files classified by path — and since their paths don't
match, the model defaults to treating their imperatives as Tier 7 Memory
(the lowest tier per Article VII), overridable by a single user sentence.

Adds an explicit clause to Tier 5: '...and any file configured via
`EngineConfig.instructions` (rendered as <instructions source=...> blocks
above). ...embedder-declared imperatives are Local Law, not Memory
preferences.'

Pairs naturally with #2311 (InstructionSource enum) but stands alone — this
is a doc/law clarification, not an API change.

Adds `local_law_tier_covers_engine_config_instructions` test pinning the
new clause's presence.
2026-05-30 19:15:41 -07:00
hexin bb4e876139 perf(prompts): move environment block below volatile boundary for per-session workspace embedders
The environment block (`platform`, `shell`, `pwd`, `lang`) was inserted
above the volatile-content boundary as a workspace-static cache layer. The
original comment claimed 'workspace path is fixed for the run' → static-
cacheable — true for the terminal use case where one process owns one
workspace for its lifetime.

It is **not** true for embedders that swap workspaces between sessions:

- IDE/GUI integrations binding the engine to a per-tab workspace
- Multi-engine pools with one engine per session
- Anything sending Op::SyncSession with a new workspace

For these embedders, `pwd` drifts session-to-session, dragging the entire
static prefix (mode prompt, project context, skills, context management,
compact template) out of cache reuse on every session switch. That's a
~30KB+ cache miss for a few-byte path change.

Moves the environment block below the volatile-content boundary, alongside
the configured `instructions = [...]` block. Effect:

- Static prefix stays byte-stable across sessions even when workspace
  changes (better KV prefix cache hit rate)
- Model still sees `pwd` / `platform` / `shell` (needed for exec_shell
  and structured search tools), just in a slightly later position
- No behavior change for terminal callers (workspace fixed → block content
  unchanged → still in same logical place, just below the boundary)

Added a comment explaining the per-session-workspace motivation.
2026-05-30 19:15:38 -07:00
ningjingkun dc6dcdfda2 docs: add first-run user guide 2026-05-30 19:15:34 -07:00
LING71671 02d1145add docs: clarify custom provider configuration 2026-05-30 19:15:31 -07:00
Nightt 402b186aec test: check tui provider enum drift 2026-05-30 19:15:28 -07:00
Hunter Bown e2099dd691 fix: harden provider registry drift check 2026-05-30 19:15:28 -07:00
Nightt b0e7b67386 style: satisfy current clippy lints 2026-05-30 19:15:28 -07:00
Nightt 9edd2008c4 docs: add provider registry drift check 2026-05-30 19:15:28 -07:00
hexin 30d8d083c5 feat(subagent): add stop-on-failure and bounded-effort guidance to general agent intro
The general-purpose sub-agent intro tells the agent how to plan, but says
nothing about when to *stop*. With less capable models this leads to a
failure mode where the agent retries the same failing tool call (e.g. an
unreachable or rate-limited external API) over and over until it hits the
elapsed/step ceiling, wasting the whole budget and returning nothing useful.

Add two short clauses to GENERAL_AGENT_INTRO:
- Stop quickly on failure: after the same call fails twice, return partial
  results with a one-line note instead of looping.
- Bounded effort: prefer one focused attempt; if the task can't be completed
  within a few tool calls, return current findings so the parent can compensate.

Prompt-only change; no behavioral code paths touched.
2026-05-30 19:14:44 -07:00
reidliu41 c72dc28b38 fix(statusline): keep picker selection visible
Keep the /statusline picker selection visible when navigating through all
  available footer items in smaller terminal windows.

  The picker now scrolls its visible rows as the cursor moves, wraps Up/Down at
  the list edges, and renders the selected row with a continuous, slightly
  brighter background.
2026-05-30 19:14:41 -07:00
jayzhu e2d6d2253a fix(i18n): localize right-click context menu labels and descriptions
The right-click context menu rendered all entries in English regardless of ui_locale. Added 26 MessageId variants with translations for en, ja, zh-Hans, zh-Hant, pt-BR, es-419. ContextMenuView now accepts a localized title. build_context_menu_entries() uses app.tr() instead of hardcoded strings.
2026-05-30 19:14:37 -07:00
reidliu41 d58f10102a fix(composer): allow slash-space messages
Treat inputs like `/ hello` as plain user messages instead of slash commands.
  This lets users start a message with a literal slash while preserving normal
  slash command behavior for `/help`, `/model ...`, and other commands.
2026-05-30 19:13:54 -07:00
Nightt 4bacda64fc fix(tools): raise tool search default results 2026-05-30 19:13:51 -07:00
reidliu41 76089db1dc fix(mcp): avoid nested runtime panic on stdio shutdown
Run the stdio MCP server inside a blocking section when launched from the async CLI entrypoint.

  This prevents Tokio from panicking when the MCP server's internal runtime is dropped after stdin closes.
2026-05-30 19:13:47 -07:00
cyq 0a97f18e78 test(tui): make composer history flush deterministic 2026-05-30 19:13:44 -07:00
dependabot[bot] 5de174ac8b chore(deps): bump tar in the cargo group across 1 directory
Bumps the cargo group with 1 update in the / directory: [tar](https://github.com/composefs/tar-rs).


Updates `tar` from 0.4.45 to 0.4.46
- [Release notes](https://github.com/composefs/tar-rs/releases)
- [Commits](https://github.com/composefs/tar-rs/compare/0.4.45...0.4.46)

---
updated-dependencies:
- dependency-name: tar
  dependency-version: 0.4.46
  dependency-type: direct:production
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-30 19:13:41 -07:00
jayzhu b669ee7b94 fix: update terminal tab title from 'DeepSeek TUI' to 'CodeWhale' 2026-05-30 19:13:37 -07:00
reidliu41 1379d354e4 fix(provider): name DeepSeek in provider help text
Replace the incorrect CodeWhale backend example in /provider help text with DeepSeek.

  CodeWhale is the app name, while deepseek is the actual provider id accepted by /provider.
  Add a regression test for shipped locale descriptions.
2026-05-30 19:12:56 -07:00
Hunter Bown 54151a4bc9 feat(/new): add new session command (#2235)
feat(/new): add new session command
2026-05-26 21:48:06 -05:00
Hunter Bown 1c59cbf770 fix(provider): keep picker selection visible (#2241)
fix(provider): keep picker selection visible
2026-05-26 21:41:06 -05:00
reidliu41 198acc72ba Make the selected row easier to see with a continuous subtle highlight, and
wrap Up/Down navigation between the first and last providers.
2026-05-27 10:34:38 +08:00
reidliu41 5ed741dc8c fix(provider): keep picker selection visible
Make the /provider modal size itself to the provider list when space allows,
  and scroll the rendered list when the selected provider moves past the visible
  rows.

  Also make the selected row use a continuous, subtle highlight so the current
  selection remains visible without looking disconnected.

  Adds regression coverage for bottom providers, initial bottom selection, full
  height rendering, and selected-row highlighting.
2026-05-27 10:24:23 +08:00
reidliu41 ed23a48e04 feat: add new session command
Add /new to start a fresh saved session from the TUI without overloading /clear.
  The command creates a distinct session id, resets conversation state, and keeps
  previous sessions available through /resume.

  Block unsafe switches when pending input or active work exists, with /new --force
  available for explicit discard.
2026-05-27 07:33:27 +08:00
Hunter Bown cdec3e8192 Merge branch 'build/v0.8.47' into integration/v0.8.47-unified 2026-05-26 16:41:10 -05:00
Hunter Bown 663550be35 Merge branch 'feat/2199-goal-tools-runtime' into integration/v0.8.47-unified 2026-05-26 16:41:05 -05:00