Commit Graph
1925 Commits
Author SHA1 Message Date
chengyongruandGitHub 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 da96c5c6eb fix(webui): activate existing model presets safely 2026-09-02 16:25:07 +08:00
Xubin Ren 0274c11bfb fix(webui): keep schema defaults out of model presets 2026-09-02 16:25:07 +08:00
yu-xin-candchengyongru 9ecdc4533f fix(agent): release completed task groups 2026-09-01 17:42:41 +08:00
dda67286f9 fix(dream): stop duplicating SOUL/USER/MEMORY into the Dream prompt (#5622)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-09-01 17:17:35 +08:00
Xubin Ren 22cbfc2fb5 fix(websocket): preserve invalid listener detection 2026-09-01 11:14:34 +08:00
Krislu1221andXubin Ren bd9b74e2c7 fix(websocket): stop treating SO_ACCEPTCONN as portable in listener health check
`_listener_is_serving()` probes `SO_ACCEPTCONN` to decide whether a bound
socket is still accepting connections. That option is not portable: macOS
and the BSDs raise `OSError` with `ENOPROTOOPT` ("Protocol not available")
for it even on a perfectly healthy listening socket.

The surrounding `except OSError: return False` swallows that error, so the
listener is reported as degraded on every check. `_serve_forever()` then
raises `_ListenerUnavailableError("WebSocket listener did not enter a
serving state")`, and because `_is_recoverable_listener_error()` classifies
that exception as recoverable, the channel retries forever (4s -> 8s -> 16s
-> 30s backoff) and never becomes ready. On macOS this leaves the gateway
permanently at `ready: false` with the WebUI unreachable, since the
WebSocket channel is enabled by default.

Reproduced on macOS 26.5.1 / Python 3.14.3:

    >>> s = socket.socket(); s.bind(("127.0.0.1", 0)); s.listen(1)
    >>> s.getsockopt(socket.SOL_SOCKET, socket.SO_ACCEPTCONN)
    OSError: [Errno 42] Protocol not available

Extract `_socket_is_accepting()` and treat `ENOPROTOOPT` / `EOPNOTSUPP` /
`EINVAL` as "this platform cannot answer the question", falling back to the
file-descriptor liveness check that already guarded the expression. Other
`OSError`s still propagate, and a closed socket is still rejected via the
`fileno() < 0` short circuit, so Linux behaviour is unchanged.
2026-09-01 11:14:34 +08:00
chengyongruandGitHub e111b83af6 refactor(agent): unify runner request fitting (#5612)
* refactor(agent): unify runner request fitting

* fix(agent): fit every runner model request

* fix(agent): count resumed state during request fitting

* refactor(agent): consolidate request fitting state
2026-08-31 18:08:21 +08:00
feb33e1f99 docs(tools): clarify edit_file selector exclusivity (#5598)
* docs(tools): clarify edit selector exclusivity

* docs(tools): streamline edit_file guidance

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-08-31 14:28:41 +08:00
chengyongruandGitHub bb34b58f47 refactor(agent): make memory summaries cumulative (#5610)
* refactor(agent): make memory summaries cumulative

Treat the latest session summary as a replacement checkpoint, preserve it through bounded raw fallbacks, and reserve history.jsonl for Dream ingestion.

* fix(agent): preserve cumulative checkpoint context

* fix(agent): preserve memory archive prompt cache

* refactor(agent): state archive prompt positively

* refactor(agent): remove checkpoint version migration

* refactor(agent): summarize full archive context

* test(agent): align cumulative archive prompt assertion

* refactor(agent): clarify memory checkpoint contract
2026-08-31 13:37:20 +08:00
chengyongruandGitHub 6cd7063682 refactor(agent): defer transcript assembly to runner (#5608)
* refactor(agent): defer transcript assembly to runner

Keep persisted history and the fresh turn as explicit inputs until the Runner assembles the provider transcript. Preserve ContextBuilder and direct AgentRunner compatibility while making the save boundary structural.

Refs NAN-81.

* fix(providers): preserve mixed adjacent user content
2026-08-31 00:06:15 +08:00
Xubin Ren 1ac1b35c84 fix(cron): sanitize migrated legacy metadata 2026-08-30 17:24:05 +08:00
Oxygen56andXubin Ren 679a07460e fix(cron): sanitize persisted origin metadata 2026-08-30 17:24:05 +08:00
Oxygen56andXubin Ren 919e3d341e fix(agent): add retry hint to tool exceptions 2026-08-30 17:03:51 +08:00
yu-xin-candXubin Ren 2c55934198 fix(agent): bound session message rate-limit state 2026-08-30 16:46:36 +08:00
Xubin Ren 5afdffff51 fix(agent): settle reasoning close before cancellation 2026-08-30 16:32:08 +08:00
KDBandXubin Ren bfe041def7 fix(agent): close reasoning stream on cancellation 2026-08-30 16:32:08 +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 c02f013b17 fix(providers): harden OAuth model discovery 2026-08-29 21:22:20 +08:00
Xubin Ren 1c6483147e refactor(providers): localize OAuth model discovery 2026-08-29 21:22:20 +08:00
Xubin Ren 7941450a5d fix(providers): recover incomplete Grok searches 2026-08-29 21:22:20 +08:00
Xubin Ren 97fb9aaf72 fix(providers): complete OAuth model discovery 2026-08-29 21:22:20 +08:00
Xubin Ren bc4de246a4 feat(providers): discover OAuth model catalogs online 2026-08-29 21:22:20 +08:00
Xubin Ren 2389ab1f5a feat(providers): add Grok 4.6 subscription model 2026-08-29 21:22:20 +08:00
Xubin Ren 1fe14f2ee6 fix(cli): preserve root shell completion 2026-08-29 11:26:50 +08:00
Xubin Ren 7fc90ca6aa feat(cli): make nanobot launch the terminal agent 2026-08-29 11:26:50 +08:00
chengyongruandGitHub e73cce706c refactor(agent): extract tool execution boundary (#5569)
* refactor(agent): extract tool execution boundary

* test(agent): use extracted tool execution boundary
2026-08-28 13:52:03 +08:00
chengyongruandGitHub cace42af14 refactor(memory): remove consolidation ratio (#5575)
* refactor(memory): remove consolidation ratio

* docs(memory): document fixed consolidation policy

* docs(memory): simplify consolidation overview

* docs(memory): rely on soft wrapping
2026-08-28 13:20:09 +08:00
chengyongruandGitHub 29025f5a8b fix(agent): default request concurrency to unlimited (#5572)
* fix(agent): default request concurrency to unlimited

* test(agent): clarify session serialization coverage
2026-08-27 23:31:38 +08:00
chengyongruandGitHub 3c61fef7e8 refactor(memory): decouple archival from provider state (#5565)
* refactor(memory): decouple archival from provider state

* test(memory): remove obsolete consolidation offset coverage
2026-08-27 21:21:15 +08:00
chengyongruandGitHub b9e7c7f6fe fix: queue concurrent subagents (#5566)
* fix: queue concurrent subagents

* chore: keep spawn schema concise
2026-08-27 17:53:28 +08:00
chengyongruandGitHub 39de4594d7 refactor(agent): decouple loop from message tool state (#5559)
* refactor(agent): decouple loop from message tool state

* refactor(agent): scope message delivery tracking per run

* refactor(agent): clarify message delivery scope name
2026-08-27 17:23:16 +08:00
chengyongruandchengyongru d6c112ab74 refactor(agent): load MyTool through tool loader 2026-08-27 14:05:21 +08:00
chengyongruandchengyongru 91f5a85db0 fix(agent): complete native reasoning lifecycle 2026-08-27 13:20:04 +08:00
chengyongruandGitHub 3a62b0b744 fix(tui): surface chat connection failures (#5543)
* fix(tui): surface chat connection failures

* fix(tui): keep connection copy implementation-agnostic

* test(tui): avoid millisecond timing boundary

* fix(tui): use gateway health for connection status

* fix(tui): use product-level readiness copy
2026-08-27 11:37:30 +08:00
chengyongruandchengyongru 55f85b3c1f refactor(agent): remove duplicate progress streaming path 2026-08-27 10:56:07 +08:00
Xubin Ren 2113870e27 fix(cli): foreground the WebUI browser 2026-08-27 10:45:40 +08:00
chengyongruandGitHub 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
chengyongruandGitHub f9d449ef6c refactor(webui): isolate websocket application orchestration (#5548)
* refactor(webui): extract session attach projection

* refactor(webui): isolate websocket application orchestration

* refactor(webui): tighten websocket application boundary

* test(webui): assert module logger for fork failures
2026-08-26 18:04:38 +08:00
chengyongruandchengyongru a618e80887 refactor(agent): reduce loop runner parameter plumbing 2026-08-26 17:50:52 +08:00
chengyongruandchengyongru c62aec0175 fix(session): reject read_session match-all patterns 2026-08-26 16:58:29 +08:00
bingqilinweimaotaiandchengyongru 23dc344b8d fix: allow unfiltered read_session calls 2026-08-26 16:58:29 +08:00
chengyongruandchengyongru 56aa7296f3 refactor(agent): make checkpoint recovery ownership explicit 2026-08-26 16:33:59 +08:00
qtdsandchengyongru 9f5a56f1ec fix(gitstore): detect rapid same-size rewrites 2026-08-26 16:19:10 +08:00
chengyongruandGitHub 9d34fc5af2 refactor(agent): remove loop iteration state (#5549)
* refactor(agent): remove loop iteration state

* docs(my): remove stale iteration guidance
2026-08-26 15:57:47 +08:00
chengyongruandGitHub 4f6c0aedfa refactor(agent): make run usage explicit (#5546)
* refactor(agent): make run usage explicit

* fix(api): capture usage per run
2026-08-26 15:18:53 +08:00
chengyongruandGitHub 0c84725b13 fix(gateway): retry MCP readiness before turns (#5535) 2026-08-26 11:29:48 +08:00
zpljd258andchengyongru a8ffe0f136 fix(webui): project generated titles onto per-chat sessions under unifiedSession
With unifiedSession enabled, all turns are routed to the shared
unified:default session, so title generation, persistence, and change
notifications all happen on that shared session. The WebUI sidebar,
however, renders per-chat websocket:<id> sessions, so generated titles
never reach the session the user sees and every chat stays "Untitled".

Pass the origin chat_id through maybe_generate_webui_title_after_turn and
add a target_session_key to maybe_generate_webui_title so the title is
written to the per-chat session while conversation content still comes
from the shared (routed) session. When the routed session differs from
the per-chat session, the latest user/assistant exchange is used as the
title prompt since the shared session mixes content from every channel.
The shared session's title metadata is no longer read or written, so
stale shared titles can no longer leak into per-chat sessions.
2026-08-26 10:52:56 +08:00
chengyongruandGitHub 42f37dc4c0 fix(provider): stabilize Codex prompt cache routing (#5540) 2026-08-26 01:36:00 +08:00