Skip to content

fix: show why channel messages fall back from steering - #165876

Merged
steipete merged 2 commits into
mainfrom
codex/channel-steering-fallback-logs
Oct 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/channel-steering-fallback-logs

Conversation

@steipete

@steipete steipete commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150918

What Problem This Solves

Fixes: channel messages that fall back from steering have no explanation in default logs, so a deliberate wait can look like lost input.

User Impact

Operators can see a bounded rejection reason and distinguish a follow-up policy decision, confirmed queue admission, rejected admission, and a known queue-cap drop. No configuration or upgrade steps are required.

Why This Change Was Made

The reply owner previously logged these decisions only with verbose logging. Warnings now omit message text, attachments, session keys, and raw exceptions. Terminal-reply and pending-source-operation paths report the actual enqueue outcome, including rejection.

The source-operation completion barrier from #165788 is preserved, along with its original source-keyed ordering and image regression. Steering still targets the current target-session operation. The privilege-mismatch case uses the real queue's acceptance and delivery lifecycle, avoiding the unrelated 15-second settlement timeout. Related receipt cases stay in the existing companion file, and the oversized test file shrinks.

Evidence

  • On the composition with main 80d27bdf9111d1aa2d5c1334432d099a6dd4a4f7, all 38 active-steering cases pass. The restored source-barrier case first passed its original ordering/image assertions and failed only the added warning assertion; it passes with source-operation-pending logging. Earlier controls also reproduced missing warnings for backend rejection, terminal receipts, queue-cap outcomes, and rejected enqueue.
  • OPENCLAW_E2E_USE_PREBUILT_DIST=1 pnpm test src/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts --maxWorkers=1 -t 'runReplyAgent active steering': 50.37 s wall, 47.21 s Vitest, with completed E2E prerequisites reused. Privilege-mismatch and source-barrier cases took 2.034 s / 0.890 s. CI timing is not available yet.
  • Historical whole-order runs on pristine 5e685462 and the initial logging candidate both produced 222/224, taking 201.82 s / 213.81 s wall. One failure was a stale enqueue assertion; the other protected the real source-completion defect subsequently fixed by fix(auto-reply): wait for source operations before draining followups #165788. The original regression is retained. The complete 225-case suite has not been repeated after integration.
  • On pinned 5e685462, an isolated built Gateway exercised real Telegram ingress, durable storage, reply runtime, and completions requests. Both a plain correction and a 2,152-character forwarded correction reached the first provider continuation after a running tool; each produced one final reply and completed ingress without retries. Full forwarded text and origin context survived. Telegram and the model were local API stand-ins: this is runtime-boundary evidence, not live Telegram/model proof. The historical long ingress hold was not reproduced or attributed to this PR.
  • Staged changed checks against the captured main passed, including core types, all 27 test type graphs, lint, formatting, and invariant guards. Independent P2 review of the composed five-file change is clean; deslop and whitespace checks passed.

Report bounded steering rejection reasons and distinguish follow-up policy,
confirmed queue admission, rejected admission, and known queue-cap drops.
Keep message content and raw errors out of default diagnostics.

Repair stale authority queue fixtures to observe actual acceptance and final
delivery through the current session owner without waiting for a timeout.

Related: #150918
@clawsweeper

clawsweeper Bot commented Oct 6, 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: M labels Oct 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 8:58 PM ET / October 6, 2026, 00:58 UTC (Revision 2).

ClawSweeper review

What this changes

The PR adds privacy-conscious warning logs explaining why incoming channel messages fall back from steering, documents their fields, and updates queue regression coverage.

Merge readiness

✅ Ready for maintainer review

The prior completion-barrier finding is resolved, and no remaining introduced correctness defect was found. Current main still lacks these diagnostics, so the PR remains useful.

Priority: P2
Reviewed head: 435d646e05dac569b1449f34582715c6d3d8a4a7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused diagnostic repair with the previous regression blocker resolved and no remaining actionable finding.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The production change adds reply-owner diagnostics without changing authority or stored data; reported tests are supplemental, and the older Gateway experiment does not prove these new warnings.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The production change adds reply-owner diagnostics without changing authority or stored data; reported tests are supplemental, and the older Gateway experiment does not prove these new warnings.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head diff changes warning diagnostics and regression fixtures; steering target selection, authority checks, enqueue behavior, and source-completion scheduling remain intact.
Current-main necessity: Pinned main contains the original production blobs, matching the introduced diff's base: fallback explanations remain verbose-only rather than the proposed structured warnings. The merged source-barrier repair addresses ordering, not these diagnostics.
Previous finding resolved: The restored regression registers the provided operation under a source-only key, prohibits draining before completion, requires draining afterward, and verifies the image payload. Relative to the pinned base, its original assertions remain and the warning assertion is added.
Findings None None.
Security None None.

How this fits together

The channel reply runner decides whether incoming messages join an active agent turn or enter the follow-up queue. These diagnostics expose that decision and queue admission outcome to operators.

flowchart TD
  A[Incoming channel message] --> B[Reply runner]
  B --> C{Steering eligible?}
  C -->|Yes| D[Active turn injection]
  C -->|No or rejected| E[Follow-up queue policy]
  E --> F[Warning with reason and disposition]
  E --> G[Later reply or recorded rejection]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +175, Tests -36, Docs +10. Total +149 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 197 22 +175
Tests 1 20 56 -36
Docs 1 10 0 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 227 78 +149

Review metrics

Metric Value Why it matters
Production versus regression growth production +38 net lines; tests +101 net lines Production growth implements structured warnings, while test growth strengthens queue acceptance and final-delivery coverage.

Technical review

Best possible solution:

Keep fallback diagnostics in the existing reply owner, with bounded reasons and accurate admission outcomes that preserve queue ordering and privacy.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main routes steering rejection explanations through verbose logging, leaving default logs without these reasons. No runtime reproduction was executed.

Is this the best way to solve the issue?

Yes. Adding bounded diagnostics at the existing decision owner avoids another routing mechanism and preserves the original source-completion regression.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 43b33cecb225.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The production change adds reply-owner diagnostics without changing authority or stored data; reported tests are supplemental, and the older Gateway experiment does not prove these new warnings.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This improves operator visibility into channel fallback decisions without changing message routing or configuration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies a MEMBER author, so the external-contributor proof gate does not apply. The production change adds reply-owner diagnostics without changing authority or stored data; reported tests are supplemental, and the older Gateway experiment does not prove these new warnings.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-06T00:33:21.177Z sha dae5a3b :: blocked before merge. :: [P2] Restore the source-owned completion-barrier regression

Integrate main to resolve the authority-test conflict while preserving its
source-owned completion barrier separately from steering target selection.
Retain the original source-keyed ordering and image regression and report
source-operation-pending through the same bounded fallback diagnostics.

Related: #150918
@steipete
steipete marked this pull request as ready for review October 6, 2026 00:52
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 6, 2026
@steipete
steipete enabled auto-merge (squash) October 6, 2026 00:59
@steipete
steipete merged commit dbab3d4 into main Oct 6, 2026
198 checks passed
@steipete
steipete deleted the codex/channel-steering-fallback-logs branch October 6, 2026 01:01
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
Report bounded steering rejection reasons and distinguish follow-up policy,
confirmed queue admission, rejected admission, and known queue-cap drops.
Keep message content and raw errors out of default diagnostics.

Repair stale authority queue fixtures to observe actual acceptance and final
delivery through the current session owner without waiting for a timeout.

Related: openclaw#150918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant