Commit Graph

83 Commits

Author SHA1 Message Date
Peter Steinberger
5b4940e41c test: guard auto-reply helper assertions 2026-05-11 20:19:34 +01:00
Peter Steinberger
16b33fc91e test: tighten auto reply assertions 2026-05-11 15:51:21 +01:00
Shakker
f9c3d683cd test: cover queued followup retargeting 2026-05-11 15:28:54 +01:00
Feelw00
137d566422 fix(auto-reply): guard FOLLOWUP_QUEUES delete against late drain finally
Regression: the drain IIFE finally (`drain.ts:263-271`) performed an
unconditional `FOLLOWUP_QUEUES.delete(key)` + `clearFollowupDrainCallback(key)`
using only the key, without checking whether the captured `queue` still matched
the map entry. Under the `/stop` + immediate followup sequence, a late-returning
D1 finally could delete the map entry for a fresh Q2 and orphan it until the
next enqueue.

Fix: only remove the map entry and drain callback when `FOLLOWUP_QUEUES.get(key)
=== queue`. Mirrors the identity pattern noted in
`subagent-announce-queue.ts:62-64`.

Adds `src/auto-reply/reply/queue/drain.identity-guard.test.ts` which uses real
`enqueueFollowupRun` / `scheduleFollowupDrain` / `clearSessionQueues` (no
module mocks) and a Deferred gate to park D1 inside `runFollowup`. The test
uses `restartIfIdle=false` on the Q2 enqueue so D1's finally is the only
mutator that can touch the map entry, producing deterministic pre/post-fix
differentiation:
  pre-fix  : get(key) === undefined (Q2 orphaned), depth === 0
  post-fix : get(key) === Q2,                     depth === 1

AI-assisted (fully tested). 1082 auto-reply/reply tests pass, pnpm check +
pnpm build clean.
2026-05-11 14:07:58 +01:00
Vincent Koc
8a23485472 fix(reply): preserve queue metadata after perf cherry-picks 2026-05-06 22:22:39 -07:00
Vincent Koc
468c6a0101 perf(core): trim reply and agent allocation churn 2026-05-06 22:22:39 -07:00
Michael Romero
abed4231aa fix: preserve reply context in embedded prompts 2026-05-03 15:04:02 +01:00
Peter Steinberger
30a2b3049a feat: default active steering to batched delivery 2026-04-30 01:22:43 +01:00
Peter Steinberger
4a6e10ece8 feat: default queueing to steer 2026-04-29 22:48:10 +01:00
scoootscooob
3c636208b0 fix(messages): keep group replies tool-only by default
Rewrites the always-on reply handling so group/channel rooms default to message-tool-visible output, while `messages.groupChat.visibleReplies: \"automatic\"` preserves legacy auto-posting.\n\nThanks @scoootscooob.
2026-04-28 07:36:43 +01:00
Peter Steinberger
e27c32b9b0 refactor(plugin-sdk): publish route helpers 2026-04-28 01:13:01 +01:00
Peter Steinberger
f368d3b49f refactor(channels): share route identity keys 2026-04-28 01:13:00 +01:00
Peter Steinberger
3eec9e4642 refactor(channels): reuse route context helpers 2026-04-28 01:13:00 +01:00
Peter Steinberger
d2320e4d4b fix(models): keep user model switches strict 2026-04-27 23:32:44 +01:00
Peter Steinberger
496a5eb56f fix: dedupe silent reply prompt guidance 2026-04-27 23:31:13 +01:00
Peter Steinberger
f1eef47839 fix(agents): treat empty group replies as silent 2026-04-26 05:17:02 +01:00
Peter Steinberger
6e985a421d fix(webchat): keep runtime context out of visible transcripts
Keep WebChat runtime context available to the model while persisting only the transcript-facing user prompt across gateway, CLI, queued follow-up, and embedded Pi paths.

Adds regression coverage for history sanitization, CLI transcript persistence, media-only auto-reply prompts, and embedded Pi prompt rewrite against a real SessionManager file.

Co-authored-by: 91wan <91wan@users.noreply.github.com>
2026-04-24 22:17:03 +01:00
Peter Steinberger
3e2bc28e51 fix: forward chat images to acp dispatch 2026-04-23 19:06:19 +01:00
Peter Steinberger
6b41ef311f fix: isolate external direct-message runtime policy 2026-04-23 01:39:56 +01:00
Peter Steinberger
ea29e654d7 fix(cli-session): forward static prompt hash input 2026-04-22 19:21:51 +01:00
Peter Steinberger
712644f0d9 fix(queue): preserve pending items during drains 2026-04-18 20:37:13 +01:00
Peter Steinberger
155162a8cd chore(lint): enable additional cleanup rules 2026-04-18 20:37:13 +01:00
Agustin Rivera
43d4be9027 fix(queue): split collect batches by auth context (#66024)
* fix(queue): split collect batches by auth context

Co-authored-by: zsx <git@zsxsoft.com>

* fix(queue): keep overflow summary on splits

* fix(queue): preserve grouped collect retry semantics

* fix(queue): drop USER.md from pr

* fix(queue): keep overflow summary in first auth group

* fix(queue): clear overflow summary state after first auth group

* fix(queue): narrow auth split key

* fix(queue): flush collect summary-only drains

* changelog: note collect-mode auth-context batch split (#66024)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
2026-04-13 13:35:39 -06:00
Tak Hoffman
7c09ba70ef fix(trace command): Improve trace raw diagnostics and trace command UX (#66089)
* improve trace raw diagnostics and command acks

* address trace review feedback

* avoid sync transcript reads in raw trace

* preserve raw cli output for trace

* gate trace emission at reply time

* reflect raw trace mode in status surfaces
2026-04-13 14:26:57 -05:00
Vincent Koc
74e7b8d47b fix(cycles): bulk extract leaf type surfaces 2026-04-11 13:26:50 +01:00
Peter Steinberger
10dcd57846 perf: keep queue and group parsing pure 2026-04-11 08:05:05 +01:00
Peter Steinberger
39d1a817fa lint: enable small oxlint rules 2026-04-11 02:15:21 +01:00
Peter Steinberger
3a2e347dc7 refactor: dedupe auto-reply lowercase parsers 2026-04-07 12:18:22 +01:00
Peter Steinberger
74ea9de6f2 refactor: dedupe reply lowercase helpers 2026-04-07 10:37:39 +01:00
Peter Steinberger
687bb21b28 refactor: dedupe reply routing readers 2026-04-07 06:07:14 +01:00
Peter Steinberger
9c04bdf6de refactor: dedupe session control readers 2026-04-07 06:07:14 +01:00
Peter Steinberger
d9f1c61361 refactor: dedupe reply session readers 2026-04-07 06:07:14 +01:00
Peter Steinberger
06f2b90a0f perf(auto-reply): skip provider runtime in fast reply tests 2026-04-06 20:00:35 +01:00
Peter Steinberger
14cfcdba1a docs(test): refresh stale model refs 2026-04-04 08:05:49 +01:00
Peter Steinberger
622b91d04e fix: queue model switches behind busy runs 2026-04-01 16:14:10 +09:00
Peter Steinberger
f21abb2151 fix: harden queue cleanup lane resolution 2026-03-31 23:20:24 +01:00
Vincent Koc
af694def5b fix(agents): fail closed on silent turns (#52593)
* fix(agents): fail closed on silent turns

* fix(agents): suppress all silent turn emissions

* fix(agents): pass silent turns into embedded subscribe
2026-03-29 17:40:20 +09:00
Vincent Koc
02e07a157d fix(reply): clear idle followup callbacks 2026-03-23 11:11:06 -07:00
Vincent Koc
3de42e946a fix(reply): preserve no-debounce inbound concurrency 2026-03-23 11:11:06 -07:00
Vincent Koc
a35dcf608e fix(reply): refresh followup drain callbacks 2026-03-23 11:11:06 -07:00
Sathvik Veerapaneni
d2e8ed3632 fix: keep session transcript pointers fresh after compaction (#50688)
Co-authored-by: Frank Yang <frank.ekn@gmail.com>
2026-03-23 22:58:07 +08:00
Peter Steinberger
47db5abece test: inject thread-safe base seams 2026-03-23 04:59:15 -07:00
Peter Steinberger
9428b38452 refactor: consolidate core runtime state helpers 2026-03-22 18:09:45 +00:00
Vincent Koc
4ca84acf24 fix(runtime): duplicate messages, share singleton state across bundled chunks (#43683)
* Tests: add fresh module import helper

* Process: share command queue runtime state

* Agents: share embedded run runtime state

* Reply: share followup queue runtime state

* Reply: share followup drain callback state

* Reply: share queued message dedupe state

* Reply: share inbound dedupe state

* Tests: cover shared command queue runtime state

* Tests: cover shared embedded run runtime state

* Tests: cover shared followup queue runtime state

* Tests: cover shared inbound dedupe state

* Tests: cover shared Slack thread participation state

* Slack: share sent thread participation state

* Tests: document fresh import helper

* Telegram: share draft stream runtime state

* Tests: cover shared Telegram draft stream state

* Telegram: share sent message cache state

* Tests: cover shared Telegram sent message cache

* Telegram: share thread binding runtime state

* Tests: cover shared Telegram thread binding state

* Tests: avoid duplicate shared queue reset

* refactor(runtime): centralize global singleton access

* refactor(runtime): preserve undefined global singleton values

* test(runtime): cover undefined global singleton values

---------

Co-authored-by: Nimrod Gutman <nimrod.gutman@gmail.com>
2026-03-12 14:59:27 -04:00
Mariano
e3df94365b ACP: add optional ingress provenance receipts (#40473)
Merged via squash.

Prepared head SHA: b63e46dd94
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-03-09 04:19:03 +01:00
Peter Steinberger
7e59803df2 refactor(queue): use stable tuple key for recent message dedupe 2026-03-08 01:14:16 +00:00
Peter Steinberger
5edcab2eee fix(queue): land #33168 from @rylena
Landed from contributor PR #33168 by @rylena.

Co-authored-by: Rylen Anil <rylen.anil@gmail.com>
2026-03-08 00:51:11 +00:00
Peter Steinberger
b645654923 fix: avoid stale followup drain callbacks (#31902) (thanks @Lanfei) 2026-03-02 19:38:08 +00:00
Jealous
60130203e1 fix(queue): restart drain when message enqueued after idle window
After a drain loop empties the queue it deletes the key from
FOLLOWUP_QUEUES.  If a new message arrives at that moment
enqueueFollowupRun creates a fresh queue object with draining:false
but never starts a drain, leaving the message stranded until the
next run completes and calls finalizeWithFollowup.

Fix: persist the most recent runFollowup callback per queue key in
FOLLOWUP_RUN_CALLBACKS (drain.ts).  enqueueFollowupRun now calls
kickFollowupDrainIfIdle after a successful push; if a cached
callback exists and no drain is running it calls scheduleFollowupDrain
to restart immediately.  clearSessionQueues cleans up the callback
cache alongside the queue state.
2026-03-02 19:38:08 +00:00
Peter Steinberger
54648a9cf1 refactor: centralize followup origin routing helpers 2026-02-24 23:28:58 +00:00