Commit Graph
4925 Commits
Author SHA1 Message Date
chengyongru 7edd377352 fix(webui): keep search activity summaries on one line 2026-10-18 01:45:53 +08:00
chengyongru c91e2bd553 fix(webui): preserve list semantics around links
Classify compact title-plus-URL previews at the Markdown AST boundary instead of flattening arbitrary list descendants. Preserve ordinary prose, nested lists, independent links, numbering, task status, and inline formatting across streaming modes.

Refs NAN-269.
2026-10-18 00:48:07 +08:00
chengyongru 756f6a6fe5 refactor(agent): deduplicate model request preparation 2026-10-18 00:26:19 +08:00
chengyongru 1a4cee5815 fix(webui): align mention overlay spacing with the native caret 2026-10-18 00:25:47 +08:00
Xubin Ren 61666c495a fix(webui): reuse preview tabs for resolved file aliases 2026-10-18 00:14:36 +08:00
Xubin Ren 0869c928a2 feat(webui): preview Markdown files with a source toggle 2026-10-18 00:14:36 +08:00
chengyongru 742ea48df3 fix(webui): keep CLI Apps reads off the event loop 2026-10-18 00:05:14 +08:00
chengyongru 8de03ac0a2 fix(webui): use file-type icons in file change activity 2026-10-17 23:27:00 +08:00
chengyongru d076e4ef13 docs(automations): keep Markdown paragraphs on one line 2026-10-17 18:26:15 +08:00
Xubin Ren 508cedff31 fix(channels): retain scheduled results across pre-send outages 2026-10-17 12:49:03 +08:00
Xubin Ren 61db036cee test(cron): narrow delivery review to saved-chat routing 2026-10-17 12:49:03 +08:00
Xubin Ren 8691bdedd5 test(cron): cover WebUI-origin cross-channel delivery 2026-10-17 12:49:03 +08:00
Xubin Ren 182ada6825 fix(channels): preserve recovery order and adapter ownership 2026-10-17 12:49:03 +08:00
Xubin Ren 9c1b16b3cc fix(channels): retain scheduled results across pre-send outages 2026-10-17 12:49:03 +08:00
faf1efaf09 fix(consolidation): trigger compaction from reported usage, not just tiktoken estimates (#6260)
Co-authored-by: Muzhen2000 <254800372+Muzhen2000@users.noreply.github.com>
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-17 02:47:42 +08:00
Gianfranco DemarcoandCursor bd779e9f54 fix(webui): hide provider models past OpenAI shutdown_date
The settings picker mirrored GET /v1/models without reading shutdown_date,
so retired chat-latest snapshots stayed selectable until a turn failed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-17 02:01:19 +08:00
chengyongru 559107172a fix(webui): hide recovery notice while resumed tasks run
Render recovery decisions only for awaiting_user and failed states so a reload cannot resurrect a resuming banner. Preserve the runtime recovery state and normal running controls.

Refs NAN-260
2026-10-16 18:25:40 +08:00
chengyongru 8f6a5594fb refactor(session): centralize state ownership in SQLite (#5943)
* fix(session): move persistence off event loop

* refactor(session): isolate async persistence boundary

* refactor(session): keep a single session manager

* refactor(session): use stateless async adapters

* fix(session): serialize local persistence without file-lock contention

* refactor(session): own async persistence and snapshot commits

* refactor(session): narrow persistence changes to async adapters

* refactor(session): remove redundant async forwarding helpers

* fix(command): offload compact session persistence

* fix(session): adapt idle compaction to current main

* fix(webui): offload session metadata persistence

* refactor(session): centralize state ownership in SQLite

* fix(session): skip storage for non-recoverable followups

* test(webui): honor the full gateway event deadline

* perf(session): persist incremental changes and reuse owner snapshots

* test(agent): allow durable worker shutdown in burst test

* fix(gateway): drain session storage on Windows console shutdown

* fix(session): enforce bounded ownership and lifecycle-safe persistence

* fix: reject unresolved home paths and stabilize platform tests

* fix(session): preserve request context compatibility and owner-backed tests

* docs: focus configuration guide on user-facing behavior

* fix(session): adapt goal admission to async ownership after rebase

* fix(session): integrate current gateway and subagent contracts

* fix(session): align rebased workspace admission and async tests

* fix(session): support compatible SQLite schema evolution

* test(agent): use session owner in workspace context regressions

* test: stabilize Windows lifecycle and browser checks

* refactor(session): remove premature JSONL file export

* ci: bound Windows full-suite worker concurrency

* chore: remove session state refactor notes

* fix(session): queue writes and retain worker connections

* perf(webui): read detached metadata for session and task lists

* perf(agent): bound prompt preparation and local token counting

* docs: remove internal session storage guide

* perf(session): skip archived transcripts during idle scans

* fix(session): coordinate turns and isolate legacy session data

Bind WebUI input generations to the execution session and serialize idle
and SDK compaction with turns. Keep turn drafts through preparation so the
latest channel route persists.

Move imported workspace JSONL and checkpoints to durable private backups
before gateway admission, resuming cleanup after interruptions. Remove
committed child sessions when task creation is cancelled.

Validation: focused Python and frontend regressions, Ruff, BasedPyright,
import boundaries, WebUI build, and isolated gateway/browser flows.

* fix(agent): keep cancellation hooks independent of prompt preparation

* fix(session): preserve admission, delivery, and migration contracts

* fix(agent): preserve cancellation settlement after rebase

* fix(session): preserve request attribution through async ownership
2026-10-16 17:28:47 +08:00
chengyongru 33ff520d12 fix: preserve subtask request attribution after restart (#6247)
* fix: preserve request origin across recovery continuations

* fix: bind request origin to each continuation

* fix: capture origin when queuing continuation messages

* chore: remove redundant request context comment

* fix: persist origin for independent system turns
2026-10-16 16:46:39 +08:00
hazelxue 6d84786efa Require dulwich>=0.24.0: GitStore.diff_commits uses porcelain.diff
porcelain.diff only exists from dulwich 0.24.0 (0.22.x and 0.23.x have
init/add/commit/status but not diff). On the declared floor every call to
GitStore.diff_commits / show_commit_diff raised GitStoreError, and the
dream line-ending test failed for the same reason. tests/agent/test_git_store.py
and tests/agent/test_dream.py pass with 0.24.0 and the other dependencies
still at their minimum versions.
2026-10-16 16:01:15 +08:00
Willow Lopezandchengyongru d2aaa8e54b fix(webui): preserve sidebar state after failed initial fetch (#6009)
* fix(webui): wait for sidebar state before persisting edits

* test(webui): load sidebar state in temporary chat fixtures

* fix(webui): preserve sidebar pushes during initial reads

* fix(webui): require successful session reads before pruning

Treat sidebar initialization and session-list completeness as separate permissions. Retain sidebar metadata, workbench panes, activity markers, and workspace overrides when the session list fails or only a partial reload cache is available.

Add integration coverage for recovery with and without cached sessions, successful deletion reconciliation, and successful empty session lists.

* test(webui): align sidebar recovery fixture with current schema

Remove obsolete preview and timestamp settings from the raw API fixture. Assert supported view preferences while retaining exact metadata and workbench comparisons.

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-16 15:47:15 +08:00
chengyongru f101a24571 refactor(cli): use Questionary for onboarding selection (#6251)
* fix(cli): require compatible terminal prompt dependencies

Require prompt-toolkit 3.0.52 for Windows VT100 input flushing and Questionary 2.1.1 for compatibility with its prompt layout. Keep the existing major-version bounds and Python minimum.

* refactor(cli): use Questionary for onboarding selection

Delegate menu navigation, selection and scrolling to questionary.select. Retain the existing back/cancel contract, palette and position feedback through a thin adapter and exercise real prompt keyboard behavior instead of viewport arithmetic.
2026-10-16 15:34:49 +08:00
chengyongru 67248790c7 test(shell): remove scheduling race from partial-byte idle check 2026-10-16 15:05:56 +08:00
chengyongru e4fc8788c4 refactor(providers): remove duplicate chat response parsers 2026-10-16 15:05:56 +08:00
chengyongru 0d09b3dc09 perf(webui): avoid subtree style invalidation while typing 2026-10-16 15:00:38 +08:00
chengyongru b8df1f0418 refactor(settings): preserve domain controller objects 2026-10-16 14:57:33 +08:00
chengyongru 0d1beac3aa refactor(webui): centralize client run lifecycle state 2026-10-16 14:54:37 +08:00
chengyongru 6f04038d21 fix(webui): preserve custom shell runtime editing 2026-10-16 14:09:55 +08:00
chengyongru 3ccc181d29 fix(webui): load history for running sessions 2026-10-16 14:07:10 +08:00
chengyongru 6310a39bac fix(shell): separate wait, idle, and runtime limits (#6228)
* fix(shell): separate wait, idle, and runtime limits

* fix(shell): separate wait, idle, and runtime limits

* fix(exec): preserve settings aliases and reclaim completed sessions

* fix(webui): make shell runtime limits explicit
2026-10-16 13:44:15 +08:00
chengyongru 70ac000ad9 fix(webui): space other tasks from following messages 2026-10-16 13:40:14 +08:00
chengyongru 836092424d fix(webui): resume queued prompts after turn completion (#6242)
* fix(webui): resume queued prompts after turn completion

Persist the lifecycle turn each queued prompt waits for and use canonical completion identities to resume after navigation or reconnect. Release one entry at a time, and retain stopped or rejected entries for manual sending.

* fix(webui): drain temporary chat prompts on live completion

* perf(webui): resume queued prompts from live completion
2026-10-16 13:33:41 +08:00
chengyongru 3abcfe70c5 perf(agent): prepare prompts outside the event loop (#6224)
* perf(agent): prepare prompts outside the event loop

* fix(agent): preserve cancellation during run cleanup

* refactor(agent): clarify prompt preparation boundaries

* revert(agent): restore original prompt preparation structure

This reverts commit 484cb96a08bf3a805f5828d5a65316be7decaaa5.
2026-10-16 13:16:13 +08:00
chengyongru fdeda8a468 fix(webui): reconcile turns after reconnect (#6211)
* fix(webui): reconcile turns after reconnect

* perf(webui): bound reconnect recovery and index turn reconciliation

* refactor(webui): simplify reconnect reconciliation

* fix(webui): preserve turn authority during recovery

* fix(webui): validate canonical completion identities
2026-10-16 11:38:05 +08:00
chengyongru aeca1c0f1a fix(webui): avoid blocking the gateway on skill loading 2026-10-16 11:21:28 +08:00
chengyongru a721eb8476 fix(webui): keep sheet close focus rings keyboard-only 2026-10-16 10:34:38 +08:00
chengyongru 31b193236f fix(cli): reject misplaced gateway instance selectors (#6229)
* fix(cli): inherit gateway instance selectors in subcommands

* fix(cli): reject misplaced gateway instance selectors

* test(cli): strip ANSI styling from gateway usage assertions
2026-10-16 01:24:50 +08:00
akinolurandchengyongru 9d2762a4f1 feat(provider): langfuse tracing for codex (#5520)
* feat: trace Codex requests via Langfuse native SDK

Codex has no OpenAI SDK client for Langfuse's usual swap trick, so
log one generation per request through langfuse's native SDK
instead. Tracing failures never affect the returned Codex response.

* docs: note Codex Langfuse tracing support

* fix: trace every Codex request, close every generation

- Move the Langfuse generation inside _send so the compaction
  sub-request gets its own trace too, not just the main request.
- Derive traced model/input from the wire body (post extra_body
  override, post response-item-ID stripping) instead of the
  pre-normalized one.
- Wrap package detection in the same try/except as the SDK call, so
  a broken find_spec() can't turn a valid Codex request into an error.
- Make generation finalization idempotent and cancellation-safe via
  try/except/else/finally, so update() failures or a cancelled
  request no longer leave a generation open.
- Add tests for compaction tracing, update() failures, and
  cancellation.

* docs: fix cli-reference.md langfuse plugin row

* fix: don't trace a rejected compaction as success

- Add a validate hook to _send so a transport-successful compaction
  reply with no usable item traces as an error, not a success.
- Add regression tests for a find_spec() failure, for the traced
  model/input matching the actual wire body (extra_body override,
  ID-stripped replayed items), and for the rejected-compaction case.

* fix: convert LLMUsage to dict for Langfuse usage_details

LLMResponse.usage is now the LLMUsage dataclass upstream, not a
plain dict - Langfuse's usage_details param needs the latter.

* fix: satisfy basedpyright strict on compaction items

* fix(providers): normalize Codex Langfuse cache usage

* fix(providers): migrate Langfuse tracing to SDK 4

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-16 00:44:17 +08:00
cristianchiriac a148eabc9f fix(cli): set SPT_NOENV only on Linux
SPT_NOENV only keeps the title out of /proc/PID/environ on Linux. On macOS
it confines the title to the argv area, where setproctitle drops the last
byte, and its import-time getproctitle() then fails to decode a command
line ending in a multibyte character, so every such CLI call crashed.

Fixes #6231
2026-10-16 00:17:47 +08:00
chengyongru 12e869d047 refactor(skills): shorten built-in skill descriptions 2026-10-16 00:15:55 +08:00
chengyongru 4fa125e134 fix(exec): filter terminal control sequences from shell output 2026-10-16 00:11:21 +08:00
chengyongru 32f5cc76a4 fix(agent): trim redundant system prompt context 2026-10-16 00:01:24 +08:00
chengyongru 841d2b880c fix(agent): make tool error guidance neutral (#6227)
* fix(agent): make tool error guidance neutral

* refactor(tools): share tool error guidance
2026-10-15 16:58:39 +08:00
chengyongru c24153db86 fix(ui): keep theme text and selections readable (#6226)
* fix(ui): keep theme text and selections readable

* fix(tui): theme the blank composer cursor cell

* refactor(webui): centralize diff theme colors

* fix(tui): keep conversation selections readable

* fix(ui): preserve nested syntax colors and selection lifetimes
2026-10-15 15:21:28 +08:00
chengyongru 73c2441abc fix(gateway): retain tasks for staged signal shutdown 2026-10-15 11:50:22 +08:00
chengyongru 7177ca05e3 perf(providers): estimate missing usage outside the event loop 2026-10-15 11:48:13 +08:00
chengyongru e604c23fca fix(sdk): validate imported messages before session changes 2026-10-15 10:54:12 +08:00
chengyongru c58bfa71bc perf(agent): skip transcript snapshots without run hooks 2026-10-15 10:48:59 +08:00
chengyongru 2ad0da786d fix(session): serialize compaction with active turns 2026-10-15 10:43:02 +08:00
chengyongru 1d43b46e54 fix(exec): reject shell paths with unresolved home directories 2026-10-15 09:51:53 +08:00