Commit Graph

1738 Commits

Author SHA1 Message Date
lei f889948c0e fix: format 2026-05-30 19:21:59 -07:00
lei 5b0bc68c88 fix: format 2026-05-30 19:21:59 -07:00
lei 0597e5fc00 fix: review 2026-05-30 19:21:59 -07:00
lei 23eac3346e feat: macos display notification 2026-05-30 19:21:59 -07:00
Hunter Bown c206c30693 fix(runtime): preserve session tool detail fields 2026-05-30 19:21:56 -07:00
Ben Gao 53fb8b3150 fix(session): serialize tool_use/tool_result blocks in session detail API 2026-05-30 19:21:56 -07:00
Hanmiao Li 1f569d5a00 fix: address code review — preserve indentation, remove per-line alloc, rename test for accuracy (#2266) 2026-05-30 19:21:52 -07:00
Hanmiao Li 59e31737d0 fix: clean PDF-extracted text to reduce TUI clutter — collapse blank lines, strip NUL, normalize spaces (#2226) 2026-05-30 19:21:52 -07:00
Hunter Bown f077d87970 fix(tui): require uploaded release assets 2026-05-30 19:19:26 -07:00
Hunter Bown b6edd87135 fix(tui): make update hint transient 2026-05-30 19:19:26 -07:00
Hunter Bown 78f8e11952 test(tui): cover terminal theme palette remap 2026-05-30 19:19:23 -07:00
liushiao b370d6f618 refactor(tui): use Magenta + DarkGray for Terminal theme accents
Adopt Gemini code-assist review on PR #1831:

- mode_plan: Yellow -> Magenta. Plan chip now contrasts with
  status_warning (still Yellow) so the two never visually collide
  in the status row.
- status_ready: Reset -> DarkGray. Ready chip now reads as a
  distinct subdued accent instead of blending into body text
  (which also resolves to Reset on this theme).

No surface change otherwise -- backgrounds and body text still use
Color::Reset to inherit the host terminal's color scheme.
2026-05-30 19:19:23 -07:00
liushiao 0ea84dce7d feat(tui): add "Terminal" theme that fully inherits the host terminal's colors
Adds a new selectable theme `terminal` (alongside System / Whale / Whale
Light / Grayscale / Catppuccin / Tokyo Night / Dracula / Gruvbox) that
paints every surface with `Color::Reset` instead of any RGB so the
host terminal's own background, foreground, and palette show through.

The existing `system` theme only chose between two RGB themes (Whale dark
or Whale Light) based on COLORFGBG / macOS appearance — useful, but it
still painted brand-colored RGB surfaces. Users with custom terminal
themes (Solarized, Nord, transparent backgrounds, custom Ghostty/iTerm
schemes) had no way to make the TUI respect their terminal palette.

Implementation:
- New `TERMINAL_UI_THEME` const where every `*_bg` and most text slots
  are `Color::Reset`, and accents (mode_agent/yolo/plan, status_working,
  status_warning) use ANSI named colors so they also inherit the user's
  terminal palette rather than DeepSeek brand RGB.
- `ThemeId::Terminal` plumbed through `from_name` / `name` /
  `display_name` / `tagline` / `ui_theme` / `SELECTABLE_THEMES`, and
  registered in `normalize_theme_name` with aliases `term`,
  `transparent`, `follow-terminal`, `inherit` so existing
  user-friendly config strings just work.
- `theme_remap_active(Terminal) → true` so the existing per-cell remap
  in `ColorCompatBackend` rewrites every hard-coded palette constant
  (`DEEPSEEK_INK`, `DEEPSEEK_SLATE`, `BORDER_COLOR`, `TEXT_BODY`, …) to
  `Color::Reset`. Without this, the many render sites that reach for
  the named palette constants directly would still paint brand RGB.
- `theme_green` / `theme_red` return `Color::Green` / `Color::Red`
  for Terminal so diff "+"/"−" stay green/red but follow the user's
  terminal palette.
- `theme_diff_added_bg` / `theme_diff_deleted_bg` return `Color::Reset`
  for Terminal — diff highlight is conveyed by foreground color only.
- The new theme is the second entry in `SELECTABLE_THEMES` (right after
  System) so it surfaces prominently in the `/theme` picker.

theme_picker tests: the new theme is inserted in row 2 of
`SELECTABLE_THEMES`, which shifts the indices three existing tests
relied on — `arrow_down_previews_next_theme`,
`enter_commits_with_persist_true`, and `digit_jumps_to_row` — so those
expectations are updated to match the new ordering. No production
behavior change in those tests, just index arithmetic.

Default (`theme = "system"`) is unchanged; existing users see no
difference. Users who want full terminal pass-through opt in via
`/theme` or `theme = "terminal"` in settings.toml.
2026-05-30 19:19:23 -07:00
Hunter Bown 95e13155a5 fix(tui): retry composer history atomic writes 2026-05-30 19:19:20 -07:00
Paulo Aboim Pinto e3899091e5 fix(tui): use raw args for cmd payloads 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto 8104c4789f fix(tui): handle bash on windows separately 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto 4fb6a2268a fix(tui): tighten shell review followups 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto 0ca7d3cc9f test(tui): make shell helpers match detected shell 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto ec643c5054 fix(tui): align shell tests with detected shell 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto f1afcf316f fix(tui): restore raw mode conditionally 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto ab95512c8f fix(tui): gate Windows shell detection 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto 45e7b12583 style(tui): format shell dispatcher stack 2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto 6e5d8ddf01 feat(shell_dispatcher): harden PowerShell detection and add execution logging
- find_exe(): fall back to known install dirs when PATH lookup fails
  (C:\Program Files\PowerShell\7, System32\WindowsPowerShell\v1.0)
- Encoding prefix: use idiomatic [Console]::OutputEncoding for PowerShell
  instead of cmd.exe chcp 65001 >NUL
- Execution logging: write exec via <ShellKind> entries to
  SHELL_DISPATCHER_LOG when set
- System prompt: use ShellDispatcher detection instead of raw $SHELL
  so model knows it has PowerShell and generates native cmdlets
- display_command(): strip PowerShell encoding prefix for display
- Add tests for find_exe PATH + known-dir fallback

Refs #1779
2026-05-30 19:18:38 -07:00
Paulo Aboim Pinto 29625945de feat: add ShellDispatcher for shell-agnostic command execution
Introduces a central shell abstraction that replaces hardcoded
Command::new("cmd") / Command::new("sh") across the execution path.

- Shell detection at startup (pwsh -> powershell -> cmd -> sh)
- Correct quoting per shell (PowerShell uses -NoProfile -Command)
- Scope guards restore crossterm raw mode on all spawn paths (#1690)
- Direct program+args builder for sandbox ExecEnv integration

Files:
- crates/tui/src/shell_dispatcher.rs (new, 12 tests)
- crates/tui/src/main.rs (register module)
- crates/tui/src/eval.rs (exec_shell delegates to dispatcher)
- crates/tui/src/sandbox/mod.rs (CommandSpec::shell uses dispatcher)
- crates/tui/src/tools/shell.rs (raw mode guards on all spawn paths)

Closes #1690
Refs #1779
2026-05-30 19:18:38 -07:00
reidliu41 e32bd1af6d feat(update): add check-only release diagnostics
Add `codewhale update --check` so users can compare the installed version with
  the latest release without downloading or replacing binaries.

  Surface the same release check in `codewhale doctor`, and share release lookup,
  mirror handling, timeout, and version comparison logic between update and doctor.
2026-05-30 19:18:34 -07:00
LING71671 56d62edad4 fix(prompt): make tool taxonomy mode-aware 2026-05-30 19:18:31 -07:00
LING71671 a8c2728f54 feat(prompt): add core tool taxonomy block 2026-05-30 19:18:31 -07:00
Paulo Aboim Pinto bed328b7b5 test(tui): cover windows verbose state restore 2026-05-30 19:17:59 -07:00
Paulo Aboim Pinto 79cb61c1ac fix(tui): gate verbose snapshot helper on windows 2026-05-30 19:17:59 -07:00
Paulo Aboim Pinto e70f456abd fix(tui): preserve verbose state across windows alt-screen 2026-05-30 19:17:59 -07:00
Paulo Aboim Pinto 2077644ac2 fix(tui): gate verbose suppression behind alt-screen 2026-05-30 19:17:59 -07:00
Paulo Aboim Pinto 007140ec9e fix: suppress verbose CLI logging on Windows alt-screen to prevent TUI leak, restore on cleanup
On Windows, stderr cannot be redirected to the log file (no dup2). Suppress verbose CLI logging once the alt-screen is active so eprintln! calls from crate::logging don't leak into the TUI buffer. Also restores verbose logging on all cleanup paths after leaving alt-screen.
2026-05-30 19:17:59 -07:00
Zhuoran Deng 57625af4f8 docs(docker): tighten toolbox compose defaults 2026-05-30 19:17:55 -07:00
Zhuoran Deng 127f0565dd docs(docker): add toolbox compose template 2026-05-30 19:17:55 -07:00
Zhuoran Deng 2533c5a7e6 fix(tui): avoid live receipt history clones 2026-05-30 19:17:52 -07:00
Zhuoran Deng 17698b1820 fix(tui): receipt live large tool outputs 2026-05-30 19:17:52 -07:00
Zhuoran Deng 5e6b68b995 fix(tui): refine activity detail review feedback 2026-05-30 19:17:49 -07:00
Zhuoran Deng c2b572d969 feat(tui): enrich activity detail context 2026-05-30 19:17:49 -07:00
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