Commit Graph
643 Commits
Author SHA1 Message Date
chengyongru e68afef670 fix(agent): log mid-turn injected messages (#5878)
* fix(agent): log messages consumed by mid-turn injection

* fix(agent): log injected batches after appending to transcript

* fix(agent): narrow injection metadata dictionary types

* refactor(agent): keep injection logging preview inline
2026-09-23 14:58:26 +08:00
chengyongru 3fe109bf01 test(utils): simplify atomic write tests and remove stale note 2026-09-23 14:48:29 +08:00
Frank_zhu 23de1f1e34 refactor(utils): dedupe atomic JSONL write helper
Extract atomic_write_lines so history.jsonl, session JSONL saves, and
WebUI transcript rewrites share unique temp files, optional fsync, and
BaseException cleanup.

Closes #5290
2026-09-23 14:48:29 +08:00
chengyongru d149232621 fix: isolate maintenance-session compaction notifications (#5874)
* fix: keep heartbeat compaction notices off user channels

* refactor: centralize maintenance session identity
2026-09-23 14:05:54 +08:00
chengyongru c8ed6a1209 fix(tools): keep searches scoped and results resumable 2026-09-23 14:04:08 +08:00
chengyongru 8a7ca8a654 fix: improve log reliability and correlation 2026-09-21 17:36:24 +08:00
Xubin Ren d37d7c07c0 fix(agent): redact private recovery and reconnect diagnostics 2026-09-21 15:24:38 +08:00
Xubin Ren 2640251076 fix(agent): respect temporary chat privacy in tool execution 2026-09-21 15:24:38 +08:00
Xubin Ren 448767d147 fix(webui): identify OAuth reauthentication behind fallback replies 2026-09-21 00:13:46 +08:00
chengyongru a478c96bde test(agent): provide history consolidator in response source test 2026-09-20 22:48:35 +08:00
chengyongru 0983762fe5 refactor(webui): remove legacy message projection (#5823)
* refactor(webui): defer oversized replay traces as events

* fix(webui): type deferred trace index set

* refactor(webui): remove legacy message projection

* fix(webui): type event protocol boundaries

* test(webui): assert canonical thread events
2026-09-20 16:48:13 +08:00
chengyongru 29ba4c7f2d fix(agent): remove local context tail truncation (#5820)
* fix(agent): remove local context tail truncation

* fix(agent): defer subagent type annotations

* fix(agent): require context consolidator for runner

* refactor(agent): minimize consolidator contract diff
2026-09-20 16:00:44 +08:00
Xubin Ren 8d0430c761 feat(webui): show persisted fallback preset on replies (NAN-133) 2026-09-20 15:16:35 +08:00
Xubin Ren fa754c2204 test(agent): verify stopped followups stay canceled across restarts 2026-09-20 10:38:08 +08:00
yu-xin-c 1127b3ea20 fix(agent): discard stopped follow-up recovery journal 2026-09-20 10:38:08 +08:00
chengyongru 078e35f317 fix(agent): run explicit recovery continuations 2026-09-18 18:07:03 +08:00
chengyongru a0a99f24da test(agent): consolidate session inbox coverage 2026-09-17 22:18:38 +08:00
chengyongru 5f378c9aff fix(session): keep compaction continuations out of later turns 2026-09-17 22:18:38 +08:00
chengyongru 28d9721bfd fix(agent): complete automation cancelled before execution 2026-09-17 22:18:38 +08:00
chengyongru b669c2036c refactor(agent): unify session message admission 2026-09-17 22:18:38 +08:00
chengyongru 7208fb663f fix(agent): preserve queued turn semantics and completion 2026-09-17 22:18:38 +08:00
chengyongru b15a5e8cb4 test(agent): await session inbox admission 2026-09-17 22:18:38 +08:00
chengyongru 4e2173c9eb fix(agent): serialize session inbox processing 2026-09-17 22:18:38 +08:00
chengyongru 56f7afcfe4 fix(agent): preserve per-session message order 2026-09-17 22:18:38 +08:00
Xubin Ren 122a0f5d6f fix(memory): sanitize raw history before lossless chunking 2026-09-17 21:13:23 +08:00
dajiaohuang d4e23dec12 fix(memory): preserve full consolidation input 2026-09-17 21:13:23 +08:00
chengyongru d386ba138e fix(tools): scope file-read dedup to model context (#5775)
* fix(tools): scope file-read dedup to model context

* refactor(tools): narrow file-read context and build results lazily
2026-09-15 16:09:56 +08:00
Xubin Ren 8c4eb2c807 fix(session): bound retained history search results across pages
Discard raw replay pages after filtering, retaining only the requested latest matches while counting pages for stable global message indexes. Cover raw-page release and durable-source precedence across index rebuilds and restart.
2026-09-15 14:11:59 +08:00
beemines 151173c8ba fix(session): search older pages of persisted conversation history 2026-09-15 14:11:59 +08:00
chengyongru f4843ba11e fix(memory): recover archive tool calls before raw fallback (#5774)
* fix(memory): recover archive tool calls

* refactor(memory): reuse provider state controller
2026-09-15 11:55:12 +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
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 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
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
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
chengyongru 26027e6d37 fix(memory): invalidate provider state after idle compaction 2026-09-07 16:03:19 +08:00
chengyongru b581a496a6 fix(ui): surface model retry status (NAN-34) (#5504) 2026-09-07 15:12:39 +08:00
KDB db918bddd3 test: stabilize flaky and environment-dependent tests
- test_catalog_bounds_failure_only_keys failed 3/5 runs on Windows: all
  three get() calls land within one time.monotonic() tick, so the eviction
  victim in _reserve() is decided by hash-seeded set iteration order among
  tied recency keys. Pin the catalog to a synthetic strictly-increasing
  monotonic clock (the constructor already accepts one) so the oldest
  entry is evicted deterministically. 5/5 stable after, 3/5 failures before.
- test_equivalent_workspace_paths_share_one_store requires directory
  symlinks, which need admin/developer mode on Windows (WinError 1314).
  Skip with the same pattern the file already uses for file symlinks.
- tests/agent/conftest.py: make_provider() assigned through a spec'd mock
  by reading provider.estimate_prompt_tokens first, which raises
  AttributeError because the attribute is not on the LLMProvider class
  spec; assign a MagicMock directly instead. Latent - no test hit the
  default-provider path until now.
2026-09-07 10:54:26 +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 3495281282 test: remove obsolete nonexistence checks 2026-09-05 23:58:38 +08:00
chengyongru 63cc5f270d refactor: remove unused internal helpers and state (#5667)
* refactor: remove unused internal helpers and state

* test(tui): await deferred submissions before reconnect attach
2026-09-05 22:09:12 +08:00
chengyongru f37ba60ed4 refactor(agent): remove context block budget override (#5668)
* refactor(agent): remove context block budget override

* test: drop redundant retired config field assertions
2026-09-05 21:39:14 +08:00
chengyongru 5229989f28 feat: make context compaction visible in channels (#5656)
* feat: surface context compaction lifecycle

* fix: complete and simplify context compaction notifications
2026-09-05 20:21:54 +08:00
chengyongru 6b82d642fc feat(webui): visualize context usage by logical round (#5649)
* feat(webui): visualize per-request context reuse

* refactor(webui): report usage by logical round

* fix(webui): align context chart with logical rounds

* refactor(webui): derive turn usage from logical rounds

* fix(webui): polish context usage details
2026-09-04 15:13:17 +08:00
KDB 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
KDB 480c8dd744 fix(providers): preserve retry metadata for raised errors 2026-09-03 18:31:35 +08:00
KDB b321c63e1a test(fallback): classify authentication exception messages 2026-09-03 18:31:35 +08:00