Skip to content

fix(channels): record a refused queued request for the owner without replying in the channel - #202252

Merged
obviyus merged 1 commit into
mainfrom
fix/record-revoked-channel-refusal
Nov 20, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/record-revoked-channel-refusal

Conversation

@obviyus

@obviyus obviyus commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

What problem this solves

When a queued channel request is refused at admission because the requester's channel access is gone (ChannelRunAuthorizationError kind denied), the runner meant to stay silent on the channel, but:

  1. Nothing told the session owner why the run stopped. The lifecycle error terminal had no errorNotice, so the transcript and Control UI showed only a generic failure.
  2. The "silent" reply was not marked silent. It returned a bare NO_REPLY text without silentReply metadata. normalizeReplyPayload suppresses only payloads with that metadata (normalize-reply.ts:94-98), and outbound normalization deliberately keeps literal NO_REPLY text (infra/outbound/payloads.test.ts:106-116). So the payload reached the reply dispatcher's deliver. On a channel that reaches this branch, the literal text could be sent to the conversation whose access had just been revoked.

Reach: this branch fires only when a channel supplies a public child-session publication renewal (child-session-publication.ts:29-39, bound in host-context-builder.ts:94-126). Today that is only the X plugin (extensions/x/src/ingress.ts). Discord, for example, never reaches it (see Evidence).

Change

src/auto-reply/reply/agent-runner-error-handler.ts, denied branch only:

  • The existing lifecycle error terminal now carries a fixed, host-authored errorNotice: "This request was not started because the requester no longer has access to this channel." It contains no cause text, requester text, channel ids or policy details.
  • The final payload is marked silent through the existing setReplyPayloadMetadata(..., { silentReply: true }).
  • Unchanged: the token, reply-operation and model-patch failure, the log line, and the unavailable branch, which still replies "could not verify current channel access".

Docs: docs/channels/groups.md states that such a refusal is silent on the channel but recorded for the owner.

Evidence

Proof tier: source (ocx test).

  • New regression in agent-runner-execution-terminal-failures.test.ts, through the real runner and reply dispatcher:
    • exactly one visible run-failed-before-reply receipt with the run id and the notice;
    • the projected history shows it;
    • replaying the same terminal adds no second receipt;
    • a synthetic secret in the nested cause appears in neither the displayed nor the projected text;
    • zero deliver/deliverPrepared calls.
      On unchanged main, the notice assertion fails and deliver receives bare NO_REPLY once.
  • 159 tests across 13 files; production and test typecheck, oxlint, format, four ratchets, docs MDX and format checks: pass.
  • Real Discord run (isolated Gateway, leased Discord QA credentials, real channel; same scenario on main and on this head): message 1 held busy, message 2 queued, the requester removed from the channel's users with config.patch. On both revisions, a fresh message from the removed sender was ignored, confirming the revocation. Message 2 still ran and replied normally, and this branch was not reached, because Discord supplies no publication renewal. So there is no live proof of this branch; the X plugin has no live proof route here.
  • That run found a separate, pre-existing Discord bug, not changed here: message 2 was admitted after the revocation (main: patch 05:15:42.400Z, admission 05:15:43.874Z; head: 05:13:44.596Z then 05:13:46.279Z), because Discord preflight reuses its earlier sender decision (message-handler.preflight.ts:581-605). It will be fixed in its own PR.

Production +9 −2 lines, test +76, docs +2.

@clawsweeper

clawsweeper Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Nov 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 20, 2026
…replying in the channel

- Record a fixed host-authored refusal in the lifecycle error terminal while preserving the denied request failure bookkeeping and leaving access-verification outages unchanged.
- Fix a send-after-revocation bug by marking the retained NO_REPLY token with existing silentReply metadata: bare token text reaches reply-dispatcher deliver on main instead of being suppressed.
- Downstream outbound normalization deliberately preserves literal NO_REPLY (src/infra/outbound/payloads.test.ts:106-116). Discord forwards the nonempty payload through monitor/message-handler.process.ts:495-557 and monitor/reply-delivery.ts:150-191 to send.outbound.ts:276-287; there is no later token-specific suppression in that path. This is source-traced channel-send behavior, not a claimed live platform send.
- Exercise the real runner, dispatcher delivery boundary, lifecycle recorder and chat-history projection: one visible correlated receipt, idempotent replay, fixed notice, no projected nested-cause secret and zero raw/prepared channel delivery calls.
- Red on unchanged production: missing errorNotice assertion; a separate baseline run also observed one deliver call with literal NO_REPLY. Final vitest-source selection passes 159 tests across 13 files.
- Passed production and test typechecks, touched-file oxlint/oxfmt, lifetime/line-cap/session-identity/test-lines ratchets, docs MDX and docs formatting. Document the channel-silent owner receipt behavior.
@obviyus
obviyus force-pushed the fix/record-revoked-channel-refusal branch from 9514e29 to 2db6916 Compare November 20, 2026 05:34
@obviyus
obviyus merged commit 3e7c305 into main Nov 20, 2026
110 checks passed
@obviyus
obviyus deleted the fix/record-revoked-channel-refusal branch November 20, 2026 06:24
obviyus added a commit that referenced this pull request Nov 20, 2026
Problem: several user-facing refusals were honest but had no next step or used internal words: "message action authority is no longer active" for an ended message turn, "approval consumption is no longer available", "approval record is no longer current", "approval run already aborted", the owner notice for a refused queued request (#202252), and "OpenClaw session changed during audit persistence". A Stop during approval preparation could also miss the cancellation sweep, so the user still got an approval prompt for stopped work.

Fix (text in existing owners, no new error types and no identity comparisons): "The message turn has ended. Start a new turn to retry."; "This approval is no longer available. Start a new turn to request approval again."; "The approval run was stopped. Start a new turn to request approval again."; the owner notice adds "Review the channel access settings; once access is restored, ask the requester to send the request again."; the system-agent audit fence reads "This OpenClaw chat changed while the change was being saved. Check the current settings before making a new request." Main's two specific corrective notices are unchanged. Approval registration that finds the run already stopped settles the record as cancelled before any prompt is delivered.

Proof: Stop-during-preparation regression red on base, green with the fix; affected Slack, Teams, approval and system-agent suites; session-identity ratchet, oxlint, format; clean exact-head local ClawSweeper review; real Gateway run (Stop on a real-model exec: no approval prompt, the run cancelled, the new stopped-run wording returned).

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Nov 20, 2026
…rts (#202330)

Problem: on Discord, a message queued behind a busy turn was admitted and run after its sender lost access (real Discord on main: config.patch returned 05:15:42.400Z, the queued message was admitted 05:15:43.874Z and replied). Preflight decided access once at receipt and shared run admission reused that decision; the only admission-time renewal was bound for public child-session publication (X).

Fix: one Discord access decision (resolveDiscordMessageAccess) serves receipt (receipt policy) and queued-run admission (live policy); preflight's copy is deleted and receipt-time native facts are reused without refetch. childSessionPublication.audience becomes optional: the same memoized renewal runs for ordinary user_request and room_event ingress at the start of the queued turn, before memory-flush or compaction model work; child-session publication still requires audience "public" on a user request. A refused queued turn reaches #202252's existing denied handler (silent on the channel, one owner notice). Started turns are not rechecked.

Proof: real queued path (followup-runner, followup-turn-execution, canonical execution, Gateway lifecycle persistence): red on the previous head (no owner notice); green with exactly one persisted owner notice, zero provider requests (including maintenance), zero deliveries, for user_request and room_event; allowed queued messages run once; unavailable verification still warns. 295 tests across 7 files; typecheck, oxlint, format, ratchets; clean exact-head local ClawSweeper review; real Discord run on the exact head (see the PR comment).

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…replying in the channel (openclaw#202252)

Problem: a queued channel request refused at admission because the requester's channel access is gone (ChannelRunAuthorizationError "denied") gave the session owner no reason in the transcript or Control UI, and its "silent" reply was a bare NO_REPLY text without silentReply metadata, so it reached the reply dispatcher's deliver and could be sent to the revoked conversation. Reachable today only through channels that supply a public child-session publication renewal (the X plugin).

Fix: the denied branch's existing lifecycle error terminal carries a fixed host-authored errorNotice ("This request was not started because the requester no longer has access to this channel."), and the final payload is marked silent through setReplyPayloadMetadata. The unavailable branch, token, failure bookkeeping and log are unchanged. docs/channels/groups.md documents the owner-visible, channel-silent refusal.

Proof: source tier (ocx test). New regression through the real runner and reply dispatcher: one visible receipt with the run id and notice, projected history, replay dedupe, no nested secret in displayed/projected text, zero deliver/deliverPrepared calls; the notice assertion is red on unchanged main, where deliver received bare NO_REPLY. 159 tests across 13 files; typecheck, oxlint, format, ratchets, docs checks; clean exact-head local ClawSweeper review; ocx build --dts plus packed install smoke. A real Discord run on main and head confirmed Discord does not reach this branch (no publication renewal) and found a separate pre-existing queued-admission bug, fixed separately.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…#202402)

Problem: several user-facing refusals were honest but had no next step or used internal words: "message action authority is no longer active" for an ended message turn, "approval consumption is no longer available", "approval record is no longer current", "approval run already aborted", the owner notice for a refused queued request (openclaw#202252), and "OpenClaw session changed during audit persistence". A Stop during approval preparation could also miss the cancellation sweep, so the user still got an approval prompt for stopped work.

Fix (text in existing owners, no new error types and no identity comparisons): "The message turn has ended. Start a new turn to retry."; "This approval is no longer available. Start a new turn to request approval again."; "The approval run was stopped. Start a new turn to request approval again."; the owner notice adds "Review the channel access settings; once access is restored, ask the requester to send the request again."; the system-agent audit fence reads "This OpenClaw chat changed while the change was being saved. Check the current settings before making a new request." Main's two specific corrective notices are unchanged. Approval registration that finds the run already stopped settles the record as cancelled before any prompt is delivered.

Proof: Stop-during-preparation regression red on base, green with the fix; affected Slack, Teams, approval and system-agent suites; session-identity ratchet, oxlint, format; clean exact-head local ClawSweeper review; real Gateway run (Stop on a real-model exec: no approval prompt, the run cancelled, the new stopped-run wording returned).

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…rts (openclaw#202330)

Problem: on Discord, a message queued behind a busy turn was admitted and run after its sender lost access (real Discord on main: config.patch returned 05:15:42.400Z, the queued message was admitted 05:15:43.874Z and replied). Preflight decided access once at receipt and shared run admission reused that decision; the only admission-time renewal was bound for public child-session publication (X).

Fix: one Discord access decision (resolveDiscordMessageAccess) serves receipt (receipt policy) and queued-run admission (live policy); preflight's copy is deleted and receipt-time native facts are reused without refetch. childSessionPublication.audience becomes optional: the same memoized renewal runs for ordinary user_request and room_event ingress at the start of the queued turn, before memory-flush or compaction model work; child-session publication still requires audience "public" on a user request. A refused queued turn reaches openclaw#202252's existing denied handler (silent on the channel, one owner notice). Started turns are not rechecked.

Proof: real queued path (followup-runner, followup-turn-execution, canonical execution, Gateway lifecycle persistence): red on the previous head (no owner notice); green with exactly one persisted owner notice, zero provider requests (including maintenance), zero deliveries, for user_request and room_event; allowed queued messages run once; unavailable verification still warns. 295 tests across 7 files; typecheck, oxlint, format, ratchets; clean exact-head local ClawSweeper review; real Discord run on the exact head (see the PR comment).

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 23, 2026
…replying in the channel (#202252)

Problem: a queued channel request refused at admission because the requester's channel access is gone (ChannelRunAuthorizationError "denied") gave the session owner no reason in the transcript or Control UI, and its "silent" reply was a bare NO_REPLY text without silentReply metadata, so it reached the reply dispatcher's deliver and could be sent to the revoked conversation. Reachable today only through channels that supply a public child-session publication renewal (the X plugin).

Fix: the denied branch's existing lifecycle error terminal carries a fixed host-authored errorNotice ("This request was not started because the requester no longer has access to this channel."), and the final payload is marked silent through setReplyPayloadMetadata. The unavailable branch, token, failure bookkeeping and log are unchanged. docs/channels/groups.md documents the owner-visible, channel-silent refusal.

Proof: source tier (ocx test). New regression through the real runner and reply dispatcher: one visible receipt with the run id and notice, projected history, replay dedupe, no nested secret in displayed/projected text, zero deliver/deliverPrepared calls; the notice assertion is red on unchanged main, where deliver received bare NO_REPLY. 159 tests across 13 files; typecheck, oxlint, format, ratchets, docs checks; clean exact-head local ClawSweeper review; ocx build --dts plus packed install smoke. A real Discord run on main and head confirmed Discord does not reach this branch (no publication renewal) and found a separate pre-existing queued-admission bug, fixed separately.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 3e7c305)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 3652c722ed8475e1f6c9ace6d7159f61fa844bfc)
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…rts (#202330)

Problem: on Discord, a message queued behind a busy turn was admitted and run after its sender lost access (real Discord on main: config.patch returned 05:15:42.400Z, the queued message was admitted 05:15:43.874Z and replied). Preflight decided access once at receipt and shared run admission reused that decision; the only admission-time renewal was bound for public child-session publication (X).

Fix: one Discord access decision (resolveDiscordMessageAccess) serves receipt (receipt policy) and queued-run admission (live policy); preflight's copy is deleted and receipt-time native facts are reused without refetch. childSessionPublication.audience becomes optional: the same memoized renewal runs for ordinary user_request and room_event ingress at the start of the queued turn, before memory-flush or compaction model work; child-session publication still requires audience "public" on a user request. A refused queued turn reaches #202252's existing denied handler (silent on the channel, one owner notice). Started turns are not rechecked.

Proof: real queued path (followup-runner, followup-turn-execution, canonical execution, Gateway lifecycle persistence): red on the previous head (no owner notice); green with exactly one persisted owner notice, zero provider requests (including maintenance), zero deliveries, for user_request and room_event; allowed queued messages run once; unavailable verification still warns. 295 tests across 7 files; typecheck, oxlint, format, ratchets; clean exact-head local ClawSweeper review; real Discord run on the exact head (see the PR comment).

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 5148804)

Gap-sweep intake (Dallin, 2026-11-24): ledger-high/P0-P1 fix not yet on 2026.11.10. Clean apply. Later main mentions of #202330: 656de08 test(discord): stop pinning refused-followup notice wording (#202471);.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant