Commit Graph
2906 Commits
Author SHA1 Message Date
Xubin Ren 236185d4f5 fix(matrix): bind and bound SAS requests 2026-09-03 23:49:20 +08:00
dajiaohuangandXubin Ren 04aeec6c0f fix(matrix): complete Element SAS request flow 2026-09-03 23:49:20 +08:00
KDBandXubin Ren f5a4fb8c39 fix(fallback): normalize exception metadata before retry decisions
Provider exceptions may expose numeric error_type or error_code values. Convert those fields at the response boundary before fallback consumers apply string operations, and cover the behavior with a regression test.
2026-09-03 18:31:35 +08:00
KDBandXubin Ren 480c8dd744 fix(providers): preserve retry metadata for raised errors 2026-09-03 18:31:35 +08:00
KDBandXubin Ren b321c63e1a test(fallback): classify authentication exception messages 2026-09-03 18:31:35 +08:00
KDBandXubin Ren 18d1a325b6 fix(providers): apply fallback policy to raised errors 2026-09-03 18:31:35 +08:00
qtdsandXubin Ren 0ec6aee621 fix(signal): honor wildcard in inbound allowlists 2026-09-03 18:10:39 +08:00
Pengyi PengandXubin Ren b909793784 fix(agent): observe session reply timeout task failures 2026-09-03 17:45:13 +08:00
LostInTwilightandXubin Ren eddfa0dd6b fix(tool_hints): respect max_length for plain (non-path/non-command) tool values
Plain tool values (grep patterns, web_search/x_search queries, find_files
globs) were never truncated by format_tool_hints(), so long arguments
overflowed tool_hint_max_length and were pushed to chat/UI verbatim.

Add a hard-truncation fallback for the plain branch, mirroring the existing
truncation used by abbreviate_path / _abbreviate_command. This completes the
same class of fix started in 99209a80 for is_path tools.

Adds 4 regression tests to tests/agent/test_tool_hint.py.
2026-09-03 17:18:21 +08:00
Lanre ShittuandXubin Ren 816a999cac fix(sdk): preserve queued events on stream close
Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
2026-09-03 16:47:23 +08:00
chengyongruandchengyongru 972cdde8da fix(provider): preserve Codex prompt cache affinity 2026-09-03 16:09:51 +08:00
Lanre ShittuandXubin Ren 30509b6d99 fix(channels): bound origin reply fingerprint cache
Signed-off-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com>
2026-09-03 15:37:22 +08:00
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
042f96f6ba fix(webui): delete unpersisted pane sessions (#5624)
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-09-02 13:05:36 +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
chengyongruandchengyongru 3c25f826ea fix(telegram): detect unsupported rich stream edits 2026-08-31 18:39:35 +08:00
Nolanandchengyongru 195e4c281d fix(telegram): preserve final-edit retry contract in rich stream upgrade
Address review feedback on the rich edit error classification:

- Transport, rate-limit, and unexpected errors now propagate instead of
  returning False. Returning False made send_delta fall through to an
  immediate legacy edit_message_text, which under connection-pool
  exhaustion doubled demand and discarded the buffered retry state that
  ChannelManager relies on.
- 'Message is not modified' is treated as success: when the rich edit is
  applied server-side but its response times out, the retry inside
  _call_with_retry reports the edit as already applied, and the previous
  BadRequest branch would have let the legacy edit overwrite the
  successful rich result.
- False is now returned only for capability errors (pre-10.1 servers,
  which still trip the rich latch) and content-shaped rejections, where
  the legacy HTML path is the intended fallback.

Adds regression coverage for a direct NetworkError (propagates, buffer
kept for manager retry) and TimedOut followed by Message-is-not-modified
(treated as success, no legacy overwrite).
2026-08-31 18:39:35 +08:00
Nolanandchengyongru 37663ac947 fix(telegram): upgrade streaming preview to rich in place at stream end
The rich branch in send_delta(stream_end=True) was unreachable: it was
guarded by 'not buf.message_id' after an earlier return had already
ensured buf.message_id is set, so sendRichMessage never fired with
streaming enabled and the final message always went through the legacy
HTML editMessageText path.

Bot API 10.1 added a rich_message parameter to editMessageText, which
upgrades an existing message to rich in place. Use it at stream end via
do_api_request so the streaming preview keeps its identity — no
delete-and-resend, so none of the flickering or dropped line breaks
that made rich-at-stream-end fail in #4470.

Capability errors (server older than 10.1) trip the existing
_rich_send_disabled latch and fall back to the legacy HTML path, which
is unchanged.

Fixes #5516
2026-08-31 18:39:35 +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 d019658501 fix(dingtalk): stop late inbound task creation 2026-08-30 17:56:34 +08:00
yu-xin-candXubin Ren e8385d9257 fix(dingtalk): drain inbound background tasks 2026-08-30 17:56:34 +08:00
Xubin Ren 5c71ef6e49 test(email): assert header-first fetch contract 2026-08-30 17:38:44 +08:00
Till AdamandXubin Ren f573ecfe56 perf(email): fetch headers before body, use UID SEARCH to skip re-fetch
The IMAP poll loop previously downloaded the entire message body for
every UNSEEN message before running any filter (self-sent, SPF/DKIM,
allow-list), and only learned the UID by parsing it back out of that
fetch response. Rejected messages stay unseen and get re-fetched in
full on every subsequent poll.

Switch to UID SEARCH (UIDs come back directly, no per-message fetch
needed to learn them) so already-processed UIDs are skipped before any
network fetch, then fetch headers only to evaluate every filter — the
full body is downloaded only for messages that pass every check and
are actually delivered. No behavior change: filter outcomes and
\Seen semantics are unchanged.
2026-08-30 17:38:44 +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