Commit Graph
2003 Commits
Author SHA1 Message Date
chengyongru aa257a705e perf: reduce streaming text processing and classic CLI redraws (#5728)
* perf: skip tag parsing for ordinary streamed text

* perf: coalesce classic CLI stream refreshes
2026-09-15 11:48:40 +08:00
chengyongru 1c3c68262f refactor(tools): unify edit summaries with shared fast diffs
Return compact, workspace-relative summaries from edit_file and apply_patch.
Compute one RapidFuzz line alignment per file and reuse it for summary counts
and WebUI unified diffs, checking snapshots before reuse. Summarize batched
edits by their final file state.

Warn only when a recorded file version changed, without asking for a read
after an edit has already succeeded. Preserve existing edit errors.

Validate summary and activity reuse, repetitive files, diff formatting,
snapshot changes, file creation, and read-state behavior.
2026-09-15 11:25:01 +08:00
Kail Tian 3a725b35a7 fix(tools): preserve line boundaries when deleting inline suffixes 2026-09-15 11:25:01 +08:00
chengyongru 60b7c8cf3c fix(cron): recheck pending jobs before execution 2026-09-14 17:48:10 +08:00
Kuang-xianxin 02ca8f6558 fix(cron): defer timer rearming while jobs execute 2026-09-14 17:48:10 +08:00
beeminesandbeemines 93b51121d1 fix(cron): preserve pending runs when editing automation details (#5751)
Co-authored-by: beemines <182060364+beemines@users.noreply.github.com>
2026-09-14 15:30:10 +08:00
ggbond 524e96ff68 test(security): keep proxy-clearing fixtures hermetic on hosts with OS-level proxies 2026-09-14 13:21:45 +08:00
chengyongru ddd6b302c9 fix(webui): support remote project paths and honor picker capabilities (#5673)
* fix(webui): honor remote workspace picker capability

* feat(webui): allow remote project path selection

* test(webui): isolate native picker availability from host platform
2026-09-14 13:14:00 +08:00
chengyongru bfb4f021ed test: align automation integration coverage with current behavior 2026-09-13 05:43:05 +08:00
chengyongru 037438e7d1 fix(webui): show per-run automation replies and simplify details 2026-09-13 05:43:05 +08:00
chengyongru f8c1f2ede0 fix(webui): make headless login self-explanatory (#5735)
* fix(webui): guide headless login

* fix(webui): correct SSH handoff and password fallback
2026-09-13 05:01:13 +08:00
chengyongru 9e71087a2a fix(webui): align legacy trace detail replay identities 2026-09-12 17:09:51 +08:00
chengyongru a490cd629b fix(webui): cache and defer thread history 2026-09-12 17:09:51 +08:00
chengyongru 7ba60c2ef0 fix(webui): bound history replay work 2026-09-12 17:09:51 +08:00
chengyongru 0c5d8443ec fix(responses): omit provider item IDs from chat history 2026-09-12 16:45:52 +08:00
kkkhoo e5a137956f fix(responses): clean up replayed items before sending them to providers
Prevent Responses API errors when conversation history is reused in a new provider request.

Fresh and pending Chat-style history conversions no longer include stale
provider-generated item IDs, while preserving function-call IDs for tool
output linkage.

During opaque Responses state replay, remove unsupported status fields from
reasoning items before sending them to the provider. Preserve encrypted
reasoning content and other valid provider fields.

Add regression coverage for stale item IDs and replayed reasoning items with
unsupported status fields.
2026-09-12 16:45:52 +08:00
Xubin Ren 1640784d45 feat(webui): simplify automation management and unify disclosure motion
Replace the dense automation workspace with a calm list and on-demand details, show current linked-chat titles, and remember manual system-task expansion preferences.

Reuse disclosure transitions across expandable controls, preserve drafts and focus through closing, and release large diffs after their exit animation.

Refs NAN-116
2026-09-11 20:38:38 +08:00
chengyongru 4e865b91ee fix(memory): clarify Dream prompt write permissions (#5734)
* fix(memory): clarify Dream prompt write permissions

* refactor(memory): consolidate Dream prompt rules

* fix(memory): keep agent prompts focused on executable guidance

* fix(memory): limit cleanup to skill instructions
2026-09-11 16:47:34 +08:00
chengyongru e8a29a0087 feat(webui): improve setup flows across chat channels (NAN-112) (#5356)
* feat(webui): improve channel setup flows

* fix(webui): refine channel setup interactions (NAN-112)

* fix(webui): keep email setup sections channel-owned

* fix(webui): remove concrete channel details from shared components

* refactor(webui): remove unused channel setup resources

* fix(webui): finish channel-owned setup boundaries

* fix(webui): update channel switches optimistically

* test(channels): remove obsolete absence assertions

* fix(webui): flatten channel instance settings disclosure

* fix(webui): complete channel setup and connection flows

* fix(whatsapp): wait for session database release

* fix(webui): preserve scrolling channel controls

* fix(webui): stage channel connection checks

* fix(channels): align verification actions

* fix(email): expose connection checks

* fix(webui): align channel field actions

* fix(email): verify account credentials

* fix(wecom): bypass system proxy for websocket

* fix(channels): stabilize async connection cleanup

* fix(webui): autosave channel credentials

* fix(email): make provider presets non-destructive

* test(weixin): isolate persisted QR credentials
2026-09-11 15:22:14 +08:00
chengyongru 73410e0217 fix: stream internal model calls with idle timeouts (#5730)
* fix: stream internal model calls with idle timeouts

* fix(providers): reject streams without terminal events
2026-09-11 13:06:43 +08:00
L4XB 4d712937a5 fix(discord): update the compaction notice in place instead of sending a second message
Automatic compaction delivered two standalone Discord messages,
"Compressing context…" and "Context compacted.", even with
sendProgress off. The lifecycle itself is information the user should
keep seeing (it changes the context of every later turn), so the
dispatcher keeps delivering both events to every channel; the noise is
a presentation problem of the Discord adapter.

The Discord client now remembers the message it sent for a compaction's
"started" event, keyed by compaction_id, and edits that message with the
outcome when it arrives, so one compaction is one message. Without a
stored notice (restart, or the edit being refused) the outcome is sent
as before. The earlier dispatcher-level filtering is dropped, and the
manager test pins that both lifecycle events reach a channel whose
progress messages are off.

Fixes #5719
2026-09-11 11:15:57 +08:00
L4XB a068de8068 fix(channels): keep the compaction outcome visible, gate only the start notice
Rework after review: compaction changes the context of every later turn,
so its outcome (compacted / failed / cancelled) is always delivered,
whether the user or the scheduler started it. Only the transient
"Compressing context…" start notice follows the channel's send_progress
setting, so a channel with progress off receives one notice per
compaction instead of two. The manual flag is gone.
2026-09-11 11:15:57 +08:00
L4XB 92f151ae67 fix(channels): make automatic compaction notices follow send_progress
Idle auto-compaction emitted "Compressing context…" / "Context compacted."
as standalone messages even when the channel had sendProgress: false, so
routine maintenance kept interrupting Discord chats after scheduled turns.

Gate ContextCompactionEvent notices in the outbound dispatch loop on the
channel's send_progress like other progress text. Two cases stay visible
regardless of the setting: a user-requested /compact (the event now
carries manual=True, set by cmd_compact through compact_idle_session)
and a failed compaction.

Fixes #5719
2026-09-11 11:15:57 +08:00
chengyongru 55093dd75b fix(mcp): refresh expired OAuth tokens automatically (#5573)
* fix(mcp): refresh expired OAuth tokens

* fix(mcp): bind refreshed tokens to OAuth issuer

* fix(mcp): activate OAuth tools before probe cleanup

* fix(webui): preserve failed MCP OAuth status

* fix(mcp): preserve OAuth refresh across discovery retries

* test(mcp): align OAuth issuer fixture with SDK validation
2026-09-10 13:27:50 +08:00
Booty Destroyer 6969 dfed706bc0 fix(exec): preserve UTF-8 across streaming output chunks 2026-09-10 11:36:33 +08:00
chengyongru 8ea683679d feat(webui): expand and organize settings with autosave (#5704)
* feat(webui): expand settings with autosave and live configuration

* feat(memory): add long-term memory and idle compaction switches

* refactor(webui): clarify settings hierarchy and align compact controls

* refactor(webui): keep only memory consolidation in memory settings

* refactor(webui): defer runtime changes until explicit restart

* refactor(webui): remove default workspace setting

* fix(webui): align model lists and remove preset counters

* fix(i18n): use natural Chinese labels for chat platforms

* fix(i18n): shorten chat settings navigation label

* fix(webui): match settings navigation icons to text size

* refactor(webui): remove redundant settings sidebar heading

* refactor(webui): use icon-only back navigation in settings

* fix(webui): remove back arrow hover hint

* refactor(webui): remove redundant overview details

* refactor(webui): hide secondary descriptions in settings rows

* style(webui): replace settings dividers with rounded highlights

* refactor(webui): remove redundant model list subtitles and badges

* fix(i18n): restore chat translation namespace boundaries

* fix(i18n): complete settings translations for all locales

* fix(webui): reveal settings only for enabled capabilities

* fix(webui): consolidate capabilities and isolate settings feedback

* fix(webui): clear restart notices when settings are reverted

* fix(webui): anchor restart controls in settings sidebar

* fix(webui): shorten sidebar restart label

* fix(webui): align settings spacing and control sizes

* refactor(webui): unify settings dialogs and interaction feedback

* fix(webui): keep settings option groups on one line without scrolling

* refactor(webui): align settings spacing and sidebar icon proportions

* style(webui): match main sidebar typography to settings

* style(webui): use monospace for sidebar session handles

* refactor(webui): remove heartbeat configuration from automations

* feat(webui): expose configuration actions beside capability toggles

* style(webui): remove ellipsis from configuration actions

* refactor(webui): remove redundant app configuration controls

* feat(webui): add compact sidebar navigation and shortcut hints

* fix(webui): synchronize npm dependency lockfile

* test(webui): align input radius expectation with pill styling

* feat(webui): show daily token usage and cache breakdown

* feat(webui): add model usage details and cache hit rates

* feat(webui): chart daily token usage by model

* refactor(webui): simplify usage details and model labels

* fix(webui): hide usage dialog date range

* refactor(webui): consolidate model usage into chart legends

* fix(webui): enforce restart choices and correct settings test route

* fix(webui): polish settings localization and controls

* fix(webui): avoid repeated usage legend labels

* fix(webui): skip empty usage columns in keyboard navigation

* test(webui): assert settings behavior positively

* feat(webui): refine sidebar navigation and add drag resizing

* style(webui): soften sidebar scroll edges

* style(webui): harmonize sidebar typography and text colors

* feat(webui): move channels to the main sidebar

* style(webui): remove dotted underlines from settings hints

* fix(webui): unify tooltip hover delay

* fix(webui): support Seatbelt sandbox settings

* fix(webui): remove unused appearance density preference

* fix(webui): align settings input values consistently

* style(webui): group compact settings controls before inputs

* feat(webui): edit multiline settings in compact dialogs

* feat(webui): add continuous settings scrolling with gentle snapping

* Revert "feat(webui): add continuous settings scrolling with gentle snapping"

This reverts commit f0978c261a53c844185eeab4d0c3190fbd196fe6.
2026-09-10 11:10:51 +08:00
Young Leeandchengyongru 20f115bf46 feat(providers): send x-opencode-session header for OpenCode session (#5662)
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-09-10 01:16:17 +08:00
Xubin Ren 61ea3ed3c4 test(exec): keep Seatbelt identity fixtures portable on Windows 2026-09-10 00:00:44 +08:00
Xubin Ren 19074b5122 fix(exec): preserve Seatbelt readonly roots and fail closed on cwd errors
Prevent renaming writable ancestors of effective read-only roots while preserving explicit read-write overrides, filesystem case aliases, and unrelated child writes.

Exit before evaluating shell lists when the sandbox working directory cannot be entered. Add native and portable regressions for both boundaries and document the ancestor restriction.
2026-09-10 00:00:44 +08:00
Xubin Ren 8b9e35bf78 fix(exec): tighten Seatbelt filesystem and launcher boundaries
Keep temporary work inside the granted workspace instead of exposing host scratch trees, enforce read-only roots, and pin the system sandbox launcher before PATH lookup. Preserve documented network access and the narrow system paths needed by shell and Git.

Add native macOS containment and launcher regressions plus shared backend contract coverage. Document scratch and custom-tool requirements without changing existing bwrap or Windows behavior.
2026-09-10 00:00:44 +08:00
LuckTerence 947ed17e8b test(sandbox): handle Windows path escaping in Seatbelt backend assertions
On Windows runners, workspace and tmp paths contain backslashes which are escaped by _sbpl_quote into double backslashes in the generated SBPL profile. Use _sbpl_quote in TestSeatbeltBackend assertions and escape backslashes in quote test to ensure assertions pass on Windows.
2026-09-10 00:00:44 +08:00
LuckTerence e217468e0a feat(exec): add a macOS Seatbelt sandbox backend
`tools.exec.sandbox` only supported bubblewrap, which depends on Linux
kernel namespaces, so macOS had no process-level isolation for shell
commands: SECURITY.md told macOS users the sandbox was simply
unavailable.

Add a `seatbelt` backend that generates an SBPL profile for
sandbox-exec(1) with the same policy bwrap applies. The workspace is
read-write, the media directory is read-only, the workspace's parent is
unreadable so config.json and its API keys stay hidden, and everything
else is denied by default.

Two macOS details the profile has to get right, both found by running
the generated command rather than by reading the SBPL reference:

- sh(1) reads `/` while resolving a path, and `(subpath "/usr")` does
  not cover the root itself. Without `(literal "/")` every wrapped
  command aborts during shell startup.
- Denying the parent directory also blocks traversal into the
  workspace, so commands fail with ENOTDIR before they run. The
  ancestors of every allowed path are therefore re-allowed for
  `file-read-metadata` only: they stay searchable, but the config
  directory still cannot be listed or read.

Paths are SBPL-escaped so a quote or backslash in a workspace path
cannot terminate a literal early and widen the rules that follow it.

Network access stays unrestricted to match bwrap, which does not pass
`--unshare-net`. Windows keeps its existing warn-and-run-unsandboxed
path, and selecting `seatbelt` on Linux fails loudly on the missing
sandbox-exec(1) exactly as selecting `bwrap` does on macOS today.

Verified on macOS 26.6.2 against the real sandbox-exec(1): workspace
writes, media reads and /tmp scratch succeed, while writing media,
reading config.json, listing the config directory, writing outside the
workspace and reading ~/.ssh are all denied.

Refs #1448
Refs #2569
2026-09-10 00:00:44 +08:00
chengyongru 1469d4811c perf(webui): reduce repeated work and bound history rendering (#5703)
* perf(webui): reduce repeated work and bound history rendering

* fix(webui): keep continuation reasoning with its answer

* refactor(webui): reuse answer buffers and prepared copy text

* perf(webui): restore conditional replay buffer initialization

* fix(webui): remove code block pagination
2026-09-09 14:02:26 +08:00
Xubin Ren 92a297a6c8 fix(codex): refresh model catalog for Astra
The Codex catalog gates model visibility by client version. Requests advertising 0.144.0 succeed but omit Astra for an otherwise eligible account. Use the validated 0.153.4 catalog version so account discovery can expose it without changing model defaults or fallback entries.

Pin the expected wire version independently in the regression test and cover both Astra and future account models while preserving hidden-model filtering.
2026-09-09 01:03:39 +08:00
n1uz1 104917aaec fix(tools): support recursive glob filters in file searches 2026-09-08 16:13:26 +08:00
f47b8f2315 test(webui): require explicit opt-in for title generation (#5648)
Co-authored-by: zpljd258 <11162658+zpljd258@users.noreply.github.com>
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-09-08 14:17:54 +08:00
chengyongru e77c638f89 fix(agent): keep tool results stable across replay (#5695)
* fix(agent): keep processed tool results stable across replay

* fix(agent): preserve multimodal text and complete result references

* docs: trim tool result persistence comments

* fix(tools): allow complete reads of oversized text lines

* fix: keep read_file interface unchanged in replay fix

* refactor: pass one tool result reference path

* refactor: keep tool result persistence text-only

* fix: keep tool output references stable across workspace changes
2026-09-08 14:10:55 +08:00
Ben Whittaker 7aaff4f66b fix(exec): resolve relative working_dir from workspace 2026-09-08 13:31:28 +08:00
chengyongru 3548aec576 fix: use summary checkpoints for all compaction triggers (#5694)
* fix: exclude archived history after manual compaction

* refactor: share summary checkpoints across compaction paths

* fix: use summary checkpoints for every compaction trigger

* test: assert replay starts at the archived boundary

* fix: preserve nothing summaries without raw fallback

* test: assert compaction results positively

* test: verify checkpoint continuation after session reload
2026-09-08 13:16:45 +08:00
cleverLucky c039a7052a feat(web-search): add AnySearch provider (key-optional, anonymous quota) (#5607)
* feat(web-search): add AnySearch provider (key-optional, anonymous quota)

* docs(configuration): add AnySearch web search provider
2026-09-08 11:41:10 +08:00
Xubin Ren 2363530891 test(mcp): keep reconnect fixture idle across SDK versions
MCP SDK 1.30 treats an open GET notification stream as an in-flight request, so the real-server fixture no longer expires its session and the shutdown regression waits forever for a reconnect that never starts.

Decline the optional notification stream with the protocol-defined HTTP 405 response while retaining real POST, DELETE, lifespan, idle expiry and reconnect handling. Assert that successful recovery replaces the tool wrapper so the first regression cannot pass without reconnecting.

Reproduced the failure with SDK 1.30 before the repair. Both 1.29 and 1.30 now pass, including five repeated 1.30 runs and 141 related MCP tests. Runtime code and timeout limits are unchanged.
2026-09-08 10:04:15 +08:00
Xubin Ren ddf095938e fix(cli): make Desktop attachment checks portable
Avoid a false-positive session-prefix match in the architecture guard without changing endpoint validation. Pass a null pointer as an integer to the native Windows pipe fixture, and name oversized-input cases explicitly so pytest does not exceed the Windows environment-variable limit.

Keep the real owner-authenticated roundtrip and oversized-payload assertions. Local CLI, architecture and gateway checks pass; native Windows verification is rerun in CI.
2026-09-08 10:04:15 +08:00
Xubin Ren d641026fc8 fix(cli): simplify Desktop picker controls [skip ci]
Remove numeric shortcuts and their labels so target selection has one visible navigation model: arrow keys followed by Enter. Keep Ctrl+C cancellation and attachment behavior unchanged.

Update the CLI guide and real-key regression tests to verify that 1 and 2 no longer move the highlight.
2026-09-08 10:04:15 +08:00
Xubin Ren cf74d1c7e5 fix(cli): make Desktop target selection keyboard navigable [skip ci]
Reuse the existing questionary selector so users can highlight a target with arrow keys and confirm with Enter. Retain numeric shortcuts and the current Python executable label without changing discovery or attachment behavior.

Keep cancellation fail-closed with exit code 130. Exercise real navigation, EOF and Ctrl+C through both CLI launchers so cancelling cannot start a Python backend or attach to Desktop. Document the controls.
2026-09-08 10:04:15 +08:00
Xubin Ren 9a594f74ff fix(cli): isolate Desktop compatibility probes [skip ci]
An older terminal can ignore the protocol probe flag and consume inherited gateway credentials or terminal input. Scrub its TUI environment and close stdin before probing, then pass only the selected Desktop resolver metadata to the compatible client.

Validate the complete ready frame before opening mutation gates, not just its identity metadata. Add failing-before regressions and scope the existing recovery test process stub so real lease cleanup remains testable without changing runtime ownership.
2026-09-08 10:04:15 +08:00
Xubin Ren 48e7c4f697 feat(cli): attach terminal clients to the selected Desktop [skip ci]
NAN-104 requires terminal chat and browser attachment without granting a client ownership of Desktop's gateway. Resolve bounded short-lived credentials over authenticated current-user IPC, pin both Desktop and gateway identities, and reject replacement instances or incompatible clients before any mutation.

Reuse the existing TUI artifact resolver behind a narrow Desktop-only entrypoint, keep credentials out of argv/environment/files, and preserve Python-mode reconnect and gateway leases. Add protocol, real-gateway, and anonymous IPC regression coverage; matching native-host and Windows acceptance remain release gates.
2026-09-08 10:04:15 +08:00
Xubin Ren b373a95f5c fix(cli): protect Windows browser credential handoff [skip ci]
Windows browser dispatch can expose bootstrap credentials through BROWSER or native handler command arguments. Send the URL to an isolated helper over stdin and open an owner-only ACL-protected redirect file instead, with no raw-URL fallback.

Keep file ownership and bounded cleanup independent of CLI exit, reject unsafe storage, and cover shared callers, native API contracts, error paths and lifecycle regressions. Document the intentional Windows compatibility tightening; native Windows browser and ACL verification remains pending.
2026-09-08 10:04:15 +08:00
Xubin Ren 29bf9f9ca7 fix(cli): keep macOS bootstrap URLs out of argv [skip ci]
Browser bootstrap URLs contain credentials. Deliver them through native Launch Services instead of the open command, and fail without a subprocess or BROWSER fallback so shared WebUI callers cannot expose the URL in process arguments or errors.

Cover encoding, native failures, resource cleanup and Desktop dispatch with regression tests. Preserve existing browser behavior and leave TUI and non-macOS handoff changes outside this scoped repair.
2026-09-08 10:04:15 +08:00
Xubin Ren dba77b5e74 fix(cli): harden attach-only Desktop selection [skip ci]
Preserve current Python startup when Desktop is not ready before target selection, while refusing fallback after the user chooses Desktop. Keep retained launchers and virtual environment labels consistent.

Authenticate Windows pipe ownership before I/O and drain cancelled operations before releasing buffers. Add entrypoint, failure-path, transport and credential-safe browser regressions without changing backend lifecycle or configuration.
2026-09-08 10:04:15 +08:00
Xubin Ren 8fe0c62d68 feat(cli): add attach-only Desktop target selection
Keep Python and Desktop installations independent while allowing bare interactive commands to choose a running Desktop target. Validate the versioned per-user rendezvous before opening its WebUI, and preserve every explicit Python CLI invocation.

Desktop TUI attachment remains unavailable until its capability contract is published, so that selection fails explicitly without starting, replacing, or stopping a backend.

Refs NAN-104.

[skip ci]
2026-09-08 10:04:15 +08:00