Commit Graph
167 Commits
Author SHA1 Message Date
chengyongru 273582916b perf(webui): batch startup recovery and authenticate before React (#6708) 2026-11-18 22:47:44 +08:00
chengyongru 74d070f699 feat(memory): add progressive wiki and drain Dream history (#4477) 2026-11-18 16:28:43 +08:00
chengyongru e65bec9a6e feat(cli): allow isolated WebUI dev ports 2026-11-13 23:37:07 +08:00
Xubin Renandchengyongru e6b0aec2a8 refactor(sessions)!: retire the global shared session (#6621)
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-11-12 09:55:55 +08:00
Xubin Ren 220d5e6970 refactor(api)!: remove the standalone API server (#6614) 2026-11-10 10:46:14 +08:00
chengyongru 812b92d734 Revert "refactor: remove legacy history and proxy migrations (#6518)"
This reverts commit cb3ba45317.

Keep JSONL history and legacy proxy migration available throughout 0.4.x. Mark their removal for 0.5.0 in code and release guidance, preserving later context graph, archive and recovery changes.
2026-11-06 10:58:10 +08:00
chengyongruandchengyongru 62c2ed4e7e refactor(goal): sustain one ReAct run until the goal closes (#6538)
* refactor(goal): sustain one ReAct run until the goal closes

Keep active goals in the same runner beyond the ordinary iteration limit, with a final answer after successful closure. Remove cross-turn goal handoffs, continuation allowances and rollback bookkeeping while preserving input authorization, recovery, cancellation and terminal lifecycle ownership.

Contributes to NAN-392

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>

* test(goal): consolidate sustained-run regression coverage

Retain lifecycle, history, usage, provider-state privacy and checkpoint cancellation assertions in the existing long-run scenarios. Remove duplicate smoke cases and parameter combinations that do not exercise distinct behavior; keep real Gateway, authorization and generation regressions.
2026-11-03 22:47:00 +08:00
chengyongru 80ac41b1f4 refactor(sessions): persist archive state in SQLite (#6536)
* feat(webui): add archived chat management

* fix(webui): keep archived chats in the sidebar

* feat(webui): scope archived topics to sidebar groups

* fix(webui): reuse group dissolve label

* fix(webui): fail fast when adding panes

* refactor(sessions): persist archive state in SQLite

* refactor: limit archive changes to SQLite storage

* perf(sessions): avoid redundant archive I/O and read barriers

* fix(sessions): archive only persisted conversations
2026-11-03 15:58:41 +08:00
chengyongru 384b763830 fix(runtime): preserve recovery history and prevent unsafe MCP replays (#6537)
* fix(recovery): preserve complete checkpoints and refresh cancellation drafts

Retain earlier tool rounds and consumed follow-ups until the transcript is committed, and classify a fresh session after cancelling active recovery. Keep history and follow-up acknowledgement atomic through the session owner.

* test(recovery): cover completion during cancellation handoff

* fix(gateway): preserve failure exit status after runtime crashes

Report uncaught gateway runtime failures as exit code 1 after the existing cleanup, just like startup failures. Remove the startup-only guard without changing controlled shutdown or supervisor policy.

Reuse lifecycle regression coverage for startup/runtime failure diagnostics and cleanup, and update runtime fault fixtures to expect failure.

Refs: NAN-394

* fix(recovery): make interrupted tool outcomes explicit

* fix(mcp): avoid unsafe replays and retain error states

Recover stale connections before non-replayable tool submissions, and report unknown outcomes without replaying calls after transport loss. Preserve structured error results for resource and prompt wrappers.

NAN-393
NAN-395

* test(recovery): assert unknown outcome guidance

* fix(runtime): revalidate replay contracts and preserve recovery input identity

Bind replay safety to each request session, adopt the rediscovered contract, and stop automatic replay when it loses its safety declaration. Treat cumulative checkpoints as uncommitted deltas rather than deduplicating independent inputs by text, retaining legacy single-batch recovery compatibility.

Extend the existing reconnect and same-text follow-up regressions, and align MCP privacy/proxy fixtures with preflight and explicitly safe replay without relaxing their privacy or routing assertions.

* fix(mcp): report unknown outcomes after submitted tool timeouts

Real HTTP response-loss probing with Codex exposed that the MCP SDK can surface a lost response as a timeout. Preserve preflight timeout semantics, but report possible completed effects after a non-replayable request has started. Never replay or weaken task cancellation.
2026-11-02 17:55:14 +08:00
chengyongru a4d2430140 refactor: remove redundant comments and docstrings (#6527)
* refactor: remove redundant comments and docstrings

* fix(signal): annotate async context manager as a generator
2026-10-30 13:07:03 +08:00
chengyongru cb3ba45317 refactor: remove legacy history and proxy migrations (#6518) 2026-10-29 18:28:44 +08:00
chengyongru acc3750c28 refactor(channels): move tool hint rendering out of core (#6498)
* refactor(channels): move tool hint rendering out of core

* test: align progress privacy check with structured tool events
2026-10-29 10:37:29 +08:00
chengyongru f23a6d1485 refactor: remove verified unused internals (#6460)
* refactor: remove verified unused internals

* test(linear): synchronize webhook shutdown with writer join
2026-10-26 21:45:36 +08:00
chengyongru 084b6bb394 feat(network): centralize proxy settings and add MCP routing (NAN-315) (#6372)
* feat(network): share proxy settings across features and MCP (NAN-315)

* fix(network): address shared proxy review regressions

* test(network): align rebased OAuth fixtures with runtime admission

* fix(webui): configure shared proxy without leaving connection drafts

* feat(webui): add optional shared proxy authentication editor

* fix(webui): align proxy save tests and loading skeleton
2026-10-22 15:49:27 +08:00
Xubin Renandchengyongru fbb61a373f feat(update): integrate managed installs and recoverable in-app updates (#6168)
Add owner-aware Stable and Preview updates with explicit consent, verified release plans, protected process handoff and bounded service recovery. Keep configuration and conversations separate from program rollback.

Include the compact About controls, Windows long-path support, native package recovery checks and optional macOS Dock lifecycle integration. Preserve documented guidance for installations owned by other managers.

This code integration does not publish packages, enable signing or advance the public update channel.

Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com>
2026-10-21 19:16:56 +08:00
chengyongru b32b1327ce refactor(session): unify model and display history storage (#6336)
* refactor(session): persist display history in SQLite

* fix(session): preserve new fork activity timestamps

* test(agent): use SQLite-owned model failure recovery fixture

* test(agent): isolate session slash routing from loop shutdown

Exercise the real inbound dispatcher and await its session worker. Keep response deadlines and behavioral assertions, while leaving full SQLite cleanup to the existing async fixture rather than an unrelated two-second shutdown deadline.

* fix(webui): admit direct deliveries to display history

* docs: clarify session history migration guidance
2026-10-21 16:13:59 +08:00
chengyongru 74942bd190 test: replace false-green checks with behavioral coverage (#6282)
* test: replace false-green checks with behavioral coverage

* test: complete behavior-focused audit coverage
2026-10-18 03:16:25 +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 73c2441abc fix(gateway): retain tasks for staged signal shutdown 2026-10-15 11:50:22 +08:00
chengyongru 328e933d36 refactor: isolate runtime contracts and enforce import boundaries (#6166)
* test: enforce Python import ownership boundaries

* test: protect client import boundaries and rehome shared UI contracts

* refactor: remove gateway and client dependency inversions

* fix: detect dynamic imports in conditional expressions

* refactor(tools): keep configuration contracts with their owners

* docs: keep design guidance focused on ownership and checks

* fix: preserve default threaded turn delivery
2026-10-13 13:56:28 +08:00
chengyongru 41f2eeb7ba fix(webui): support WSL browser launch and clearer startup output (#6150)
* feat(webui): add local first-run access setup

* feat(webui): defer password setup until network access

Keep generated local credentials and provide the full browser login link in every launch mode. Require a chosen password when enabling network access, preserve existing authentication, and show pending listener changes until restart.

Remove mandatory first-run initialization gates and simplify startup output while retaining gateway warnings and errors.

* fix(webui): align access settings with channel contracts

* fix(webui): clarify startup guidance and spacing

* fix(webui): keep setup guidance readable in narrow terminals

* fix(webui): clarify startup and preserve remote password access

* fix(webui): move access explanations into settings hints

* fix(webui): require strong ASCII passwords and reject malformed auth

* fix(webui): simplify access password character rules

* test(webui): reflect pending restart after password save

* fix(webui): open Windows browser from WSL

* fix(webui): clarify public access copy

* refactor(webui): focus on WSL launch and startup output

* fix(webui): preserve platform browser fallback
2026-10-12 10:53:11 +08:00
chengyongru 5eb160099b test(cli): reject proxies on unsupported Azure transport 2026-10-10 01:33:02 +08:00
chengyongru 29f27dcf5d ci: reduce test runtime while preserving coverage (#6101)
* ci: reduce test runtime while preserving coverage

* test: close cached usage stores before temporary directory cleanup
2026-10-08 13:03:56 +08:00
chengyongru 5be1e589f2 feat(providers): share Responses backend with Codex WebSocket continuation (#6096)
* feat(codex): continue sessions over Responses WebSocket

* fix(codex): retain API errors with repeated handshake headers

* test(codex): assert attachment paths before JSON escaping

* refactor(providers): share Responses transport and state backend

* fix(grok): update subscription client version

* docs: keep Codex configuration focused on user settings
2026-10-08 11:54:23 +08:00
chengyongru 6ff96f2a8f feat(subagent): add session-owned task messaging and cancellation (#5985)
let's go!
2026-10-05 05:16:33 +08:00
chengyongru fc3effe39d fix(cli): avoid duplicate WebUI config announcement (#5988) 2026-09-30 15:40:26 +08:00
chengyongru 4a7ad00e4f fix(tokens): warm fallback tokenizer in background (#5861)
* fix(tokens): keep fallback token estimation offline

* fix(tokens): warm fallback tokenizer in background

* test(tokens): isolate agent fixtures from tokenizer readiness

* test(tokens): keep Codex pressure fixtures within byte budget

* docs: remove manual wrapping from troubleshooting prose
2026-09-28 13:50:55 +08:00
chengyongru 6eccc2859a test: consolidate repetitive cases across the suite 2026-09-25 14:28:21 +08:00
chengyongru bfb4f021ed test: align automation integration coverage with current behavior 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
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
chengyongru 0b1fa0c3e4 fix(webui): resume incomplete model setup in the browser 2026-09-07 14:20:06 +08:00
chengyongru a4fe3adf5c ci: parallelize tests and filter unrelated jobs (#5680)
* ci: parallelize tests and filter jobs by paths

* ci: allow manual workflow validation

* ci: isolate terminal output tests from xdist

* ci: speed up Windows test jobs

* ci: use tracked dependency manifest for uv cache

* ci: run Docker checks for Python build configuration changes
2026-09-07 00:42:54 +08:00
chengyongru 192e2e90dc refactor(events): unify scoped runtime notifications across clients (#5670)
* refactor(events): unify scoped runtime notifications across clients

* style(tests): sort auto-compaction event imports

* refactor(events): scope connections and remove retry callback plumbing

* docs: remove runtime notification design write-up

* refactor(bus): route operation events through the message bus

* fix(channels): isolate outbound sends by destination

* style(events): group shared notification imports

* refactor(events): converge runtime and hook delivery on MessageBus

* test(events): migrate fixtures to unified message bus
2026-09-06 02:11:19 +08:00
chengyongru c08172a641 fix(cli): skip WebUI bundle check in dev mode 2026-09-05 22:39:55 +08:00
chengyongru d81aa5a4ab refactor(agent): let runner own context compaction (#5568)
* refactor(agent): consolidate accepted history under pressure

* fix(agent): align provider and session compaction

* refactor(agent): simplify runner context compaction

* refactor(agent): remove background token consolidation

* fix(agent): keep injected transcript messages distinct

* refactor(agent): unify native compaction summaries

* fix(agent): preserve native compaction boundary

* fix(agent): unify context compaction paths

* fix(agent): preserve exact compaction request boundaries
2026-09-02 18:05:54 +08:00
Xubin Ren 2c87143f77 fix(cli): preserve gateway log stream boundaries 2026-08-29 23:03:23 +08:00
Xubin Ren d7df2726de fix(cli): stream gateway logs in WebUI launcher 2026-08-29 23:03:23 +08:00
Xubin Ren 2389ab1f5a feat(providers): add Grok 4.6 subscription model 2026-08-29 21:22:20 +08:00
Xubin Ren 2113870e27 fix(cli): foreground the WebUI browser 2026-08-27 10:45:40 +08:00
chengyongru d8b4f612f2 fix(gateway): recover degraded WebSocket listener (#5544)
* fix(gateway): recover degraded WebSocket listener

* test(websocket): model listener readiness in startup stub

* fix(tui): keep launcher alive during gateway recovery

* test(websocket): colocate listener lifecycle coverage
2026-08-27 10:23:35 +08:00
chengyongru 0c84725b13 fix(gateway): retry MCP readiness before turns (#5535) 2026-08-26 11:29:48 +08:00
Xubin Ren 2cdfba38b2 fix(runtime): preserve interrupted turns on gateway exit 2026-08-24 00:58:04 +08:00
Xubin Ren 12029f8812 feat(runtime): add user-controlled turn recovery 2026-08-24 00:58:04 +08:00
chengyongru dbc1801d3c fix(cron): report reconciled startup job count 2026-08-22 02:38:47 +08:00
aiguozhi123456 20488a585d fix(cron): review follow-ups for system job retirement
- advance the disabled-dream cursor before touching the cron store so
  the #4242 fix still applies when jobs.json is corrupt
- pin the gateway wiring: the disabled-path test now asserts both
  dream and heartbeat are retired, not just unregistered
- cover remove_system_job on a fresh install with no store file
2026-08-22 02:38:47 +08:00
aiguozhi123456 e5718d4de6 fix(cron): retire persisted heartbeat/dream jobs when disabled
Disabling gateway.heartbeat (or agents.defaults.dream) only skipped
job registration on startup; the previously persisted system job in
<workspace>/cron/jobs.json kept firing, and remove_job refuses to
touch protected system jobs. Add CronService.remove_system_job for
startup reconciliation and call it from the gateway disabled branches
so the config toggle takes effect after restart.
2026-08-22 02:38:47 +08:00
chengyongru 2e9c9781e6 fix(webui): detach without waiting for gateway shutdown 2026-08-19 16:34:07 +08:00
Xubin Ren eafc0bc6eb fix(gateway): serialize shared runtime lifecycle 2026-08-17 20:56:10 +08:00
Xubin Ren ddd3b78ed1 test(ci): isolate cross-platform gateway lifecycle 2026-08-17 20:56:10 +08:00