Commit Graph

1575 Commits

Author SHA1 Message Date
cyq baba81cfb9 fix(tui): show session timestamps in listings 2026-06-01 19:21:53 -07:00
Hu Qiantao b1cc344d21 fix(tui): force full repaint on theme switch to prevent stale sidebar colors
When switching themes, ratatui's incremental diff engine may miss
color-only changes in sidebar cells that were rendered with
theme-resolved UiTheme fields rather than palette constants routed
through the backend remap layer.  This manifests as the sidebar
retaining the previous theme's colors until a window resize or
conversation turn triggers a full repaint.

Add a force_next_full_repaint flag on App that is set whenever a
theme or background_color ConfigUpdated event is processed.  The
main render loop merges this into the existing force_terminal_repaint
mechanism, which clears the terminal and redraws every cell.
2026-06-01 19:21:53 -07:00
Hu Qiantao 556e0b46fb fix(tui): use theme colors in sidebar panels instead of hardcoded palette constants
The task, work, agents, and context sidebar panels were using hardcoded
palette::DEEPSEEK_SKY, palette::TEXT_MUTED, palette::STATUS_WARNING etc.
constants (Whale dark theme colors) that never change when the user
switches themes. This caused the sidebar content to remain in Whale dark
colors even after switching to Claude, Catppuccin, Dracula, or other
community themes.

Root cause:
- task_panel_lines() used palette::DEEPSEEK_SKY, TEXT_MUTED, STATUS_* etc.
- work_panel_lines() and helpers used palette::TEXT_MUTED, STATUS_* etc.
- subagent_panel_lines() used palette::DEEPSEEK_SKY, TEXT_DIM, STATUS_* etc.
- render_context_panel() used palette::DEEPSEEK_SKY, TEXT_MUTED, TEXT_DIM
- tool_status_marker() returned hardcoded palette::STATUS_* colors
- agent_status_marker() returned hardcoded palette::STATUS_* colors

Fix:
- All sidebar panel functions now accept &UiTheme and use theme fields
- task_panel_lines: uses app.ui_theme directly
- work_panel_lines: passes ui_theme to all helpers
- subagent_panel_lines: accepts theme parameter
- render_context_panel: uses app.ui_theme
- tool_status_marker/agent_status_marker: accept theme parameter
- All palette::DEEPSEEK_SKY -> theme.accent_primary
- All palette::TEXT_MUTED -> theme.text_muted
- All palette::TEXT_DIM -> theme.text_dim
- All palette::STATUS_WARNING -> theme.warning
- All palette::STATUS_SUCCESS -> theme.success
- All palette::STATUS_ERROR -> theme.error_fg

This ensures sidebar panels immediately reflect the active theme when
switching, without requiring a conversation turn to trigger a refresh.

Also creates a theme modification guide for future contributors.
2026-06-01 19:21:53 -07:00
cyq 0842b3f528 test(config): use real legacy home on windows 2026-06-01 19:21:53 -07:00
cyq eff4e99a2c test(config): stabilize migration home on windows 2026-06-01 19:21:53 -07:00
cyq 6144d64914 fix(config): report legacy config migration 2026-06-01 19:21:53 -07:00
cyq 537afcf07e fix(subagent): cap truncated response retries 2026-06-01 19:21:42 -07:00
cyq 650d1a6195 fix(subagent): guard truncated tool calls 2026-06-01 19:21:42 -07:00
cyq 5becfda03b fix(tui): use effective model window in context inspector 2026-06-01 19:17:58 -07:00
reidliu41 c81cdabc09 feat(tui): add bang shell command shortcut
Support `! <command>` and `!command` in the TUI composer to run shell commands through the existing exec_shell path.

  The shortcut keeps normal approval, sandbox, policy, transcript, and work-panel handling, while avoiding model context
  pollution from local-only tool results.

  Refs #1546
2026-06-01 17:42:04 -07:00
cyq f185d46917 fix(tui): expose mention behavior in config 2026-06-01 17:33:41 -07:00
cyq 73cd721665 feat(tui): add mention browser completions 2026-06-01 17:33:41 -07:00
cyq 908a25d0f6 test(mcp): close stale-session mock responses cleanly 2026-06-01 17:30:05 -07:00
cyq 7c06cf5981 fix(tui): guide bug reports toward failure causes 2026-06-01 17:14:59 -07:00
Hunter Bown eba019ae43 test(tui): align activity labels with semantic tools 2026-06-01 17:03:18 -07:00
cyq d71cba692e test(tui): wait for background shell completion 2026-06-01 16:57:07 -07:00
Hunter Bown 57c10c78d6 fix(tui): compact tool-call UI and context 2026-06-01 16:55:10 -07:00
Hunter Bown c52769e5f5 feat(tools): add parallel verifier ensemble 2026-06-01 16:40:30 -07:00
Hunter Bown 91c5bb64bd fix(tui): keep tui prefs under codewhale home
Refs #2369

Harvested from PR #2516 by @cyq1017
2026-06-01 16:22:40 -07:00
cyq 0eb2ff59ae fix(tui): isolate settings path fallback tests 2026-06-01 16:17:43 -07:00
cyq 3b5727f283 fix(tui): prefer codewhale settings path 2026-06-01 16:17:43 -07:00
Hunter Bown bc7f98a6a0 fix(tui): refresh prompt on mode changes
Refs #2379

Harvested from PR #2534 by @cyq1017
2026-06-01 16:14:59 -07:00
cyq 46de1a9b2d fix(tui): refresh prompt on model switch 2026-06-01 16:09:29 -07:00
cyq 1605d8de44 fix(sandbox): allow tty device in seatbelt profile
Refs #2372

Harvested from PR #2524 by @cyq1017
2026-06-01 16:04:58 -07:00
Hunter Bown 9f33c4d594 fix(tui): suppress wl-paste trailing newline
Refs #1920

Harvested from PR #2540 by @cyq1017
2026-06-01 16:01:05 -07:00
cyq e2201b87dd fix(tui): read Wayland clipboard via wl-paste 2026-06-01 16:00:06 -07:00
cyq 29f57665eb fix(tui): narrow mention depth hint 2026-06-01 15:31:55 -07:00
cyq a976758245 fix(tui): hint mention depth cap on misses 2026-06-01 15:31:55 -07:00
Hunter Bown c81d1c272f test(mcp): cover invalid stdio preview redaction
Refs #2475
2026-06-01 15:31:45 -07:00
cyq 588e54f84d fix(mcp): surface invalid stdio output 2026-06-01 15:31:00 -07:00
Hunter Bown 3d5edfee80 test(config): cover legacy workspace shell opt-in
Refs #2523
2026-06-01 15:30:47 -07:00
cyq 1d8cbbd40c fix(config): normalize windows workspace paths 2026-06-01 15:30:14 -07:00
cyq 7dfec0ed4a fix(config): honor workspace shell opt-in 2026-06-01 15:30:14 -07:00
Hunter Bown 4ff9bba750 fix(tui): keep config scope column visible 2026-06-01 14:23:41 -07:00
Hunter Bown 472cd442ba fix(tui): expose auto-compact threshold in config view 2026-06-01 14:14:20 -07:00
Hunter Bown bb64018a15 feat(tui): add configurable auto-compact threshold
Refs #1722

Preserves auto_compact as opt-in, adds the saved threshold setting, keeps the 500K hard floor, and wires Ctrl+L as a manual compaction shortcut for context-pressure recovery.

Harvested from PR #1723 by @aboimpinto

Co-authored-by: Paulo Aboim Pinto <aboimpinto@gmail.com>
2026-06-01 14:09:49 -07:00
Paulo Aboim Pinto 2ca2927657 fix: clippy needless_return and fmt compliance
Remove unneeded return in utils.rs (crates/tui/src/utils.rs:256) that was caught by clippy on the new commit. Also run cargo fmt to satisfy format checks.
2026-06-01 14:01:11 -07:00
Paulo Aboim Pinto 77b57bd903 fix: initialize hook_executor for fresh sessions to fix greptile P1 review 2026-06-01 14:01:11 -07:00
Paulo Aboim Pinto cc923d634c fix: address greptile review comments — remove double-firing, wrap blocking execute in spawn_blocking
- Remove ToolCallBefore observer firing from tool_routing.rs (the turn-loop gate now handles it) to prevent double-firing hooks for each tool call (greptile P1).

- Wrap hook_executor.execute() call in tokio::task::spawn_blocking so the Tokio worker thread is not blocked by child.wait_timeout() during hook execution (greptile P1).
2026-06-01 14:01:11 -07:00
Paulo Aboim Pinto 2622db4935 fix: cargo fmt formatting for lint compliance 2026-06-01 14:01:11 -07:00
Paulo Aboim Pinto 796e95caa6 fix: address PR #2511 review comments 2026-06-01 14:01:11 -07:00
Paulo Aboim Pinto 242899d4b6 feat: run ToolCallBefore hooks before tool execution 2026-06-01 14:01:11 -07:00
Paulo Aboim Pinto 2c256d7b3a fix(tui): close Windows job before foreground joins
(cherry picked from commit 96adffb243801dcef6c6332611728930e438f1a1)
2026-06-01 09:49:54 -07:00
Paulo Aboim Pinto 54a93994f6 test(tui): cover Windows job cleanup fallbacks
(cherry picked from commit f46eb7e6644acc20d0ad9be8f9a86e1733bc7b00)
2026-06-01 09:49:54 -07:00
Paulo Aboim Pinto 14ea0721a8 fix(tui): close Windows job before output joins
(cherry picked from commit 4db07a451682fb120c902d4254a11b532b24b82a)
2026-06-01 09:49:54 -07:00
implecao a09af2024a feat(web_search): enable parallel execution for read-only search tool
Override `supports_parallel()` to return `true` in `WebSearchTool`,
allowing the engine to batch multiple concurrent web_search calls
into a `FuturesUnordered` parallel group instead of serializing them.

The tool is already read-only, auto-approved, and non-interactive —
parallel-safe by all other criteria. This change removes the final
gate (`supports_parallel() -> false` default) so co-issued searches
run concurrently rather than one-at-a-time.

Closes the ~55s serial wall-clock for 3 simultaneous web searches
(now ~20s, the slowest individual call).

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit a7dcf63c556268b53ff430747ae2e141e4cd4451)
2026-06-01 07:41:33 -07:00
cyq bc34cd13ea fix(tui): hold subagent cap until status reconciles
(cherry picked from commit 5f01dda291e8354e779cc9220f38754fe0c3786f)
2026-06-01 07:06:45 -07:00
Paulo Aboim Pinto 382635e4aa fix(tui): harden Windows job cleanup
(cherry picked from commit 3ab06d92ab7c74f43473af5ddf4ffdd31cfd5f3d)
2026-06-01 05:50:49 -07:00
Paulo Aboim Pinto cb4f660a20 fix(tui): contain Windows shell process trees
(cherry picked from commit 6cdea3288637267d282015fbdc1074da5d8a97db)
2026-06-01 05:50:49 -07:00
Hu Qiantao 49791905f9 feat(tools): add byte-level schema canonicalize for prefix-cache stability
When MCP servers return tool schemas, the field order within each schema
object and the order of entries in required / dependentRequired arrays
can vary across reconnections. This causes the serialized tool catalog
bytes to change even when the logical schema is unchanged, busting
DeepSeek's KV prefix cache.

Add schema_canonicalize::canonicalize_schema which recursively:
- Sorts every required array alphabetically
- Sorts every dependentRequired sub-array alphabetically
- Rebuilds object keys in alphabetical order
- Recurses into all nested objects and arrays

The canonicalize step runs after schema_sanitize in build_api_tools,
so each tool's input_schema is first cleaned then byte-stabilized.
The existing OnceLock api_cache pins the result, ensuring the tool
catalog bytes are identical across reads and across process restarts.

8 unit tests cover: required sorting, dependentRequired sorting,
equivalent-ordering byte match, recursive nesting, empty schemas,
deeply nested schemas, non-required array preservation, and key
ordering.

(cherry picked from commit 7cee9cd5e12a74e8072bf2f6a1b18555ed0db0bf)
2026-06-01 05:46:07 -07:00