Repository navigation
fix(reply): let active turns reach queue policy - #89238
darinkishore wants to merge 1 commit into
Conversation
Same-session visible turns could be received promptly but still sit behind dispatch admission until the active reply operation went idle. That meant messages.queue.mode=steer never got a chance to inject into the active embedded run; the turn only reached get-reply-run after the original run completed. Tried treating this as iMessage inbound debounce first, but live stability events showed message.received and message.queued happened during the shell sleep. The hold was later: dispatch admission waited for the active reply operation before queue policy resolution. This keeps the Slack routed-thread bypass as-is, keeps different non-Slack routed threads serialized, and only lets visible turns in the same route thread pass through to the active-run queue policy. That lets steer/followup/collect/interrupt own the active-run decision instead of the admission fence preempting it. Scaffolding: this is source-level and tested in the vendored checkout. The installed OpenClaw bundle still needs a build/install or hot patch before the live gateway uses it.
|
Thanks for the contribution. This PR has been inactive for a while and still is not in a landable state. Close this external PR as abandoned: its head has had no substantive activity for 31 days, remains conflicting and waiting on the author, and the unchanged head still has the previously reported correctness blocker. The fix direction and Telegram proof remain useful, so a corrected rebased submission would be welcome. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this as inactive for now. If you pick the work back up, push a rebased branch with green checks and reopen (or open a fresh PR) and it will be reviewed again. Review detailsBest possible solution: Rebase the narrow admission change onto current main, return or preserve an explicit accepted-active-queue outcome that suppresses no-visible fallbacks, retain cross-route serialization and the Slack exception, and add focused Feishu-fallback and Slack non-regression coverage before rerunning the existing Telegram proof. Do we have a high-confidence way to reproduce the issue? Yes at source level: the current admission path waits on the active reply operation before queue policy can resolve a same-session visible turn, and the focused test demonstrates the blocked-versus-admitted boundary. Mantis also supplied native Telegram proof, though the exact iMessage path was not shown live. Is this the best way to solve the issue? No in its current form: moving the admission boundary is a plausible narrow fix, but it must carry an explicit accepted-queue result through dispatch so downstream channels do not mistake successful steering or queueing for an empty reply. Security review: Security review cleared: The two-file runtime-and-test diff adds no dependency, workflow, permission, secret, artifact-download, or supply-chain surface, and no concrete security regression was found. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 990e8d24b0d6. |
|
I like the admission-vs-queue-policy split here. One regression I'd be tempted to pin down before merge: an explicit non-regression test for the existing Slack routed-thread bypass path. This patch still preserves that branch in code, but now that same-thread visible turns can also bypass |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIFs for close-together Telegram messages and the resulting bot replies.
Motion-trimmed clips: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 067f73db1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (allowActiveQueuePolicy && admission.reason === "active-run") { | ||
| logVerbose( | ||
| `dispatch-from-config: allowing visible turn for ${dispatchOperationSessionKey} to reach active-run queue policy while a reply operation is active`, | ||
| ); | ||
| return { status: "ready" }; |
There was a problem hiding this comment.
Avoid treating queued active turns as empty replies
When this branch admits a visible turn only so the active-run queue policy can handle it, the normal steer/enqueue paths in runReplyAgent return undefined with zero final replies; dispatchReplyFromConfig then still sets noVisibleReplyFallbackEligible at src/auto-reply/reply/dispatch-from-config.ts:3008-3013. Feishu consumes that flag in extensions/feishu/src/bot.ts:101-109, so a second Feishu direct message during an active steer/followup run gets an immediate “no visible reply” fallback even though the message was accepted into the active run/queue. Please suppress the no-visible fallback for turns admitted through this active-queue-policy path, or return an explicit queued/steered result state.
Useful? React with 👍 / 👎.
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
|
🦞👀 Reason: structured ClawSweeper close marker: close-required (sha=067f73db1a9327de695a876a38a5d706553e9626) Usage: |




Summary
Why
messages.queue.mode = "steer"can only work if the inbound visible turn reaches active-run queue policy while the original turn is still active. In the failing path, iMessage could receive and queue the inbound message during the active run, but dispatch admission waited for the active reply operation to go idle beforeget-reply-runcould resolve steer/followup/collect behavior.This does not replace #73365. That PR covers lifecycle-aware injection once a message reaches the active-run steering path. This PR fixes the earlier admission fence that can keep same-session visible turns from reaching that path at all.
Refs #48003.
Refs #54488.
Validation
node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts(190 passed)