Commit Graph

1781 Commits

Author SHA1 Message Date
Hunter B e7c61deefd fix(tui): key MiMo vision token field off model id 2026-05-30 22:16:01 -07:00
AdityaG 3f4c4496f2 feat: add Xiaomi MiMo provider
Adds native xiaomi-mimo provider configuration, auth/env aliases, model registry entries, TUI request handling, tests, and docs. Keeps credentials in existing provider-scoped config/env/keyring paths and uses placeholders only in docs.
2026-05-30 22:16:01 -07:00
reidliu41 37d4ec963b fix(tui): highlight user messages in cached transcript
Route user cells in the transcript cache through the existing user-message renderer.

  The live chat view renders through lines_with_copy_metadata(), which previously
  bypassed the user-message highlight path. As a result, submitted user prompts did
  not show the intended full-row background in the main transcript.

  Add a regression test for the transcript cache path.
2026-05-30 21:58:21 -07:00
Hunter Bown 7c8df7a6da Merge pull request #1902 from LING71671/fix/config-effective-cost-currency
fix(tui): show effective cost currency context in config view
2026-05-30 21:53:55 -07:00
Hunter Bown 0a1bd9aaf7 Merge pull request #2325 from zlh124/fix/approval-missing-params
fix: approval dialog shows empty params when model response includes text block
2026-05-30 21:53:38 -07:00
Hunter B cd56421cc7 fix(ci): ignore fenced blocks in provider docs span check 2026-05-30 21:51:47 -07:00
Hunter B a419079b31 fix(ci): ignore fenced blocks in provider docs span check 2026-05-30 21:51:47 -07:00
Hunter B 07fd9d0a55 Merge commit 'refs/tmp/pr1902' into HEAD
# Conflicts:
#	crates/tui/src/tui/views/mod.rs
2026-05-30 21:49:51 -07:00
Hunter B 6d9369908d style: format shell gating tests 2026-05-30 21:49:38 -07:00
Hu Qiantao c6cec29f63 fix: remove double-registration of shell tools in engine builder
The second feature-flag gate in tool_setup.rs was calling
with_shell_tools() again when allow_shell was already true, causing
duplicate tool registration. Remove the redundant gate since
with_agent_tools() already handles the allow_shell check.

Also add task_shell_wait to MODES.md alongside task_shell_start.
2026-05-30 21:49:38 -07:00
Hu Qiantao ed81d13782 fix: gate task_shell_start behind allow_shell like exec_shell
task_shell_start delegates to ExecShellTool, providing the same shell
execution capability as exec_shell. Previously, task_shell_start was
registered unconditionally in with_runtime_task_tools while exec_shell
was gated behind allow_shell, creating an inconsistent security gate.

This caused the model to try exec_shell first, fail, then fall back to
task_shell_start — wasting tokens and bypassing the intended security
boundary.

Split TaskShellStartTool and TaskShellWaitTool out of
with_runtime_task_tools into a new with_runtime_task_shell_tools method,
and gate both behind the allow_shell check in with_agent_tools.

Closes #2303
2026-05-30 21:49:38 -07:00
Hunter B a0fd16fa97 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/tui/src/tui/ui.rs
2026-05-30 21:46:33 -07:00
Hunter B b135373bf5 test(tui): cover approval input after message drain 2026-05-30 21:43:24 -07:00
Hunter B fc9a32be1a fix(localization): finish Vietnamese locale after main merge 2026-05-30 21:38:11 -07:00
Lê Hải Đăng 2938334997 Update crates/tui/src/localization.rs
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-05-30 21:38:11 -07:00
Lê Hải Đăng 56f158b212 Update crates/tui/src/localization.rs
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-05-30 21:38:11 -07:00
Lê Hải Đăng 313d456389 Update crates/tui/src/localization.rs
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-05-30 21:38:11 -07:00
LeHaiDang 88000c0481 feat: add Vietnamese (vi) localization support 2026-05-30 21:38:11 -07:00
Matt Van Horn de3a1f7773 feat(tui): FauxStep::Factory for live request-shape assertions
Closes #2074

Adds FauxStep::Factory(Box<dyn Fn(&MessageRequest) -> CannedTurn + Send + Sync>)
to MockLlmClient. When a Factory step is dequeued, its closure runs
against the real outgoing MessageRequest before the response stream is
built, so any assert! panic surfaces directly from the client call
instead of later in stream polling.

Internal storage moves from VecDeque<CannedTurn> to VecDeque<FauxStep>,
but every existing public method keeps working:

- MockLlmClient::new(Vec<CannedTurn>) wraps each turn in FauxStep::Canned.
- push_turn(CannedTurn) appends as FauxStep::Canned.

Adds push_factory(closure) for tests that want the Factory branch.

Doc comment on the Factory variant captures the DeepSeek V4
thinking-mode tool-call invariant (the v0.4.9-v0.5.1 reasoning_content
drop that produced HTTP 400 on follow-up turns).

Adds:

- crates/tui/tests/reasoning_content_replayed_after_tool_call.rs — a
  regression test whose factory asserts the assistant tool-call turn
  carries a Thinking content block after a thinking + tool-call round.
- An additional unit test in mock.rs covering create_message_synthesizes_from_factory_turn.

All 20 tests in the new file pass, and the existing
integration_mock_llm suite (27 tests) is unchanged.
2026-05-30 21:15:58 -07:00
Hunter Bown a83fa59594 fix(tui): keep task shell tools eagerly loaded 2026-05-30 20:24:06 -07:00
Fann Hoo efb63df66e feat(lsp): add Java and Vue language server defaults 2026-05-30 19:26:42 -07:00
Matt Van Horn f3def32ef9 feat: read global AGENTS.md from ~/.agents/ as vendor-neutral fallback 2026-05-30 19:26:39 -07:00
Ben Gao e2b58e6b22 style: fix rustfmt formatting for user-input route 2026-05-30 19:25:23 -07:00
Ben Gao b8439c16fc fix(runtime): don't clear active_turn in interrupt_turn
Clearing active_turn immediately breaks is_interrupt_requested detection
in monitor_turn, causing turn status to be Completed instead of Interrupted.

Let monitor_turn handle the cleanup after it detects the interrupt flag
and performs full finalization with correct status, usage, and error.
2026-05-30 19:25:23 -07:00
Ben Gao 549ab8a834 fix(runtime): use consistent error handling for user input API
- Change 'not loaded' to 'not found' in submit_user_input and
  cancel_user_input so map_thread_err correctly maps to 404
- Use map_thread_err in submit_user_input API endpoint for
  consistent error response (404 for missing thread, 409 for
  conflict, etc.) instead of always returning 500
2026-05-30 19:25:23 -07:00
Ben Gao 5994a408a2 fix(runtime): remove redundant turn finalization from interrupt_turn
The monitor_turn loop already handles full turn finalization when the
engine shuts down after cancellation, including saving turn status,
usage, error, emitting turn.completed, and clearing active_turn.

Having interrupt_turn also save turn status and emit turn.completed
causes duplicate SSE events and loses usage/error data that
monitor_turn would have captured from TurnComplete.

Keep only the active_turn cleanup so the 409 error is resolved while
monitor_turn remains the single source of truth for turn completion.
2026-05-30 19:25:23 -07:00
Ben Gao af36756e06 feat(runtime): bridge user-input events and API to external GUI clients
Add SSE event forwarding for UserInputRequired, REST endpoint for submitting user input responses, timeout protection for await_user_input, and fix interrupt_turn to clear active_turn immediately.
2026-05-30 19:25:23 -07:00
hexin d7b6c80ec8 fix(fetch_url): optionally trust fake-ip placeholder ranges to avoid SSRF false-positives
The DNS-resolution SSRF guard in `validate_dns_resolved_ip` rejects any
hostname that resolves into a restricted IP range. Under a transparent-proxy
/ TUN setup running in `fake-ip` mode, the local resolver maps *every*
hostname to a reserved placeholder range (commonly `198.18.0.0/15`), so the
guard rejects all outbound `fetch_url` requests even though the proxy will
route them correctly.

Add a narrowly-scoped, opt-in trust list on `NetworkPolicyDecider`:

- `with_trusted_fakeip_cidrs(&["198.18.0.0/15"])` registers IPv4 CIDR ranges
  to treat as benign fake-ip placeholders (default: empty — no behavior
  change unless the embedder configures it).
- `is_trusted_fakeip_addr(ip)` matches only those configured ranges.

`validate_dns_resolved_ip` now allows a resolved IP if it is either in a
configured fake-ip range or the host is on the existing trusted-proxy list.
Real private/loopback/link-local/cloud-metadata IPs match neither and stay
blocked, so this does not widen SSRF exposure for default configurations.
Includes CIDR parsing/containment helpers and a unit test covering the
placeholder-allowed / real-private-blocked / nothing-configured cases.
2026-05-30 19:25:12 -07:00
hexin d31caf40c5 fix(web_search): decode HTML entities in Bing result URLs
Bing wraps every SERP result URL in a `/ck/a?...&u=<base64>` click-tracking
redirect, and in the raw HTML the separators are `&amp;` entities.
normalize_bing_url parsed the href without decoding entities first, so
extract_query_param looked for `u` while the actual key was `amp;u`. The
base64 redirect target was never recovered: every result collapsed to a
`bing.com` root domain, is_likely_spam_results rejected the whole batch,
and Bing — the default backend — returned zero results.

Decode HTML entities before extracting the redirect target. Adds a
regression test.
2026-05-30 19:23:16 -07:00
liushiao a800f7469e fix(tui): clear footer cells before rendering spans 2026-05-30 19:23:13 -07:00
liushiao 95a737b592 fix(tui): clear footer row before rendering statusline 2026-05-30 19:23:13 -07:00
Hunter Bown 0c446bf4c5 fix(tui): pin header to absolute top row with defensive two-pass layout
The header bar was reported to appear vertically centered on macOS
Terminal.app with large blank space above and below. While the existing
Constraint::Min(1) layout with default Flex::Start should place the
header at row 0, some ratatui/flex interactions can produce unexpected
centering on certain terminal sizes.

Restructure the render layout into a defensive two-pass system:
1. First pass: split the terminal into header (Length(1)) + body (Min(1))
   with explicit Flex::Start, pinning the header to the absolute top.
2. Second pass: split the body area for chat, preview, composer, footer.

This guarantees the header is never vertically centered regardless of
ratatui Flex defaults or terminal dimensions.

Fixes #1834
2026-05-30 19:23:09 -07:00
hqt 72798e5b69 fix: upsert_thread will not set current_leaf_id now, clear_messages will also clean current_leaf_id,
update tests
2026-05-30 19:23:07 -07:00
hqt 042b4b2f50 fix: fix sort of list_messages to ASC, use id to sort and use transaction in init, update tests 2026-05-30 19:23:07 -07:00
hqt 7993f97f88 feat(state): add parent_entry_id on the message table for fork support 2026-05-30 19:23:07 -07:00
hexin 3aea6d29a2 feat(prompts): support inline string sources in EngineConfig.instructions
EngineConfig.instructions was Vec<PathBuf>, which forces embedders that
compute instructions at runtime to stage content to a disk file just to
satisfy the path API. That has two awkward side-effects:

1. The disk file looks like editable config but gets overwritten on
   every launch, confusing for users browsing the install dir.
2. Multi-engine setups need per-engine paths to avoid `rehydrate`
   re-reading the wrong session's content across concurrent engines.

Add an `InstructionSource` enum (`File(PathBuf)` / `Inline { name,
content }`) covering both shapes. `render_instructions_block` dispatches:
File sources read disk (original behavior preserved), Inline sources use
the content directly with `name` becoming the `<instructions source=...>`
attribute.

`From<PathBuf> for InstructionSource` is provided so the existing CLI /
runtime call sites upgrade with a single `.into_iter().map(Into::into).
collect()` chain — no behavior change for callers passing paths.

New test `render_instructions_block_handles_inline_source` covers Inline
empty / oversize-truncate / File+Inline mixed-ordering. The 5 existing
`render_instructions_block_*` tests are updated to use `.into()` on
`PathBuf` and continue to assert File-variant behavior.
2026-05-30 19:23:03 -07:00
Paulo Aboim Pinto 568fbe2c54 feat: enforce allowed tools for custom commands 2026-05-30 19:23:00 -07:00
Hunter Bown 2e73634ab0 fix(tui): make sidebar failure clearing order-aware 2026-05-30 19:22:02 -07:00
Hunter Bown da3a0efeef fix(tui): clear stale tool failures from sidebar (#1884)
Deduplicate failures per tool name, clear stale failures when
the same tool succeeds, and cap visible failures at 2 so old
failures don't crowd the sidebar after the task moves on.
2026-05-30 19:22:02 -07:00
lei 88d8ba853a fix: test 2026-05-30 19:21:59 -07:00
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