Skip to content

fix(agents): deliver Codex input choices in Telegram and web chat - #124146

Merged
obviyus merged 1 commit into
mainfrom
t3code/5b203f54
Aug 15, 2026
Merged

obviyus merged 1 commit into
mainfrom
t3code/5b203f54

Conversation

@obviyus

@obviyus obviyus commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Closes #123561

What Problem This Solves

Fixes an issue where users running the native Codex harness in a message-tool-only turn would never see request_user_input choices in Telegram or web chat. The question remained pending, so the run waited indefinitely.

Why This Change Was Made

Harness-owned input prompts now carry the existing source-suppression delivery marker at their canonical producer. This covers gateway-backed choices and the sibling secret/plain prompt path without Codex-, Telegram-, or UI-specific policy.

Root cause: #110372 added the portable harness question producer, but its block payload lacked the internal delivery marker. message_tool_only therefore suppressed the originating source reply before channel/UI delivery even though Gateway question registration and answer routing were healthy.

Overlap checked: #102261 is a broad interactive-parity feature stack; it does not provide this focused owner-boundary repair. No PR references #123561.

User Impact

Codex questions appear in the originating Telegram chat or web chat while ordinary assistant source replies remain suppressed. Users can answer instead of seeing a silent hang.

Evidence

  • Live pre-fix Telegram reproduction on base 3d643f7b7b6: Codex emitted a two-choice request; Gateway question.list showed it pending; Telegram recorded typing only—no prompt or buttons. Diagnostic resolution reached Codex with the exact answer, proving registration/wait/answer healthy and isolating delivery suppression.
  • Regression test before production edit: delivers gateway-backed choice harness questions in direct message-tool-only turns failed with zero block deliveries.
  • Post-fix grouped owner proof: 8 suites, 427 tests passed, including gateway-backed choice and secret/plain prompt cases.
  • node scripts/run-oxlint.mjs <2 touched files>
  • pnpm tsgo
  • pnpm check:test-types
  • pnpm check:import-cycles — 0 runtime value cycles
  • oxfmt --check <2 touched files> and git diff --check
  • Distill: canonical placement accepted; sibling producer found and covered. Greybeard: zero performance findings.
  • Production LOC: +6/-3, net +3. Tests: +52/-0. Growth is the two existing metadata applications at the canonical harness boundary; no new branch, fallback, or state.

Final exact-head ClawSweeper and Telegram proof follow under the fast-lane gates.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 6:21 AM ET / 10:21 UTC.

ClawSweeper review

What this changes

This PR marks harness-generated user-input prompts so message-tool-only routing delivers choices to the originating Telegram or web chat.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: the patch targets the canonical payload producers and covers the shared dispatcher path, but final Codex-contract verification is blocked because the required sibling source checkout is absent.

Priority: P1
Reviewed head: 62e952ed0f87c442edbd16c28f68d0e3bb825d31
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The owner-boundary patch is focused and behaviorally covered, but final confidence is limited by the unavailable direct Codex contract check and absent branch-specific visible proof.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER PR, but the prepared media documents another PR rather than this branch's after-fix behavior.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER PR, but the prepared media documents another PR rather than this branch's after-fix behavior.
Evidence reviewed 6 items Current-main suppression path: Current main sends both harness prompt shapes without the delivery metadata; the dispatcher only bypasses message-tool-only suppression when that metadata is present.
Canonical producer repair: The PR applies the existing source-suppression delivery marker to both the plain/secret and Gateway-backed question producers.
Caller and dispatcher coverage: The Codex bridge uses the Gateway question path for non-secret input and the plain path for secret input; the added dispatch regression covers both under direct message-tool-only routing.
Findings None None.
Security None None.

How this fits together

Codex native requests become harness question payloads, then flow through the shared reply dispatcher to chat surfaces. The changed metadata preserves these operator-input prompts while ordinary source replies remain suppressed.

flowchart LR
  A[Codex user-input request] --> B[Harness input bridge]
  B --> C[Gateway question payload]
  C --> D[Reply suppression decision]
  D --> E[Telegram delivery]
  D --> F[Web chat delivery]
  E --> G[Operator answer]
  F --> G
Loading

Decision needed

Question Recommendation
Should this maintainer-authored PR wait for a review environment with the required direct Codex source inspection and branch-specific visible delivery proof before its final merge decision? Verify upstream contract and delivery: Use a reviewer environment with the sibling Codex source, then capture a redacted Telegram or web-chat question-and-answer round trip for this head.

Why: Repository policy makes direct upstream Codex inspection mandatory for this Codex-backed behavior, and the supplied media does not show this PR's after-fix flow.

Before merge

  • Resolve merge risk (P1) - The supplied media belongs to the unrelated broad parity PR and does not demonstrate this branch's after-fix Telegram or web-chat behavior.
  • Resolve merge risk (P1) - The direct Codex protocol/runtime contract required by repository policy could not be inspected in this environment.
  • Complete next step (P2) - A maintainer must resolve the direct-Codex-contract and visible-proof gap; the existing branch already contains the focused implementation.
Agent review details

Security

None.

PR surface

Source +55. Total +55 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 58 3 +55
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 58 3 +55

Review metrics

Metric Value Why it matters
Production versus test delta production +3 net, tests +52 The positive production delta is limited to applying existing metadata at two canonical prompt producers, while tests cover both producer shapes through the dispatch boundary.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #123561
Summary: This PR is the focused candidate repair for the reported Codex question-delivery regression.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Mantis proof suggestion

A short Telegram Desktop capture would directly validate the repaired user-visible delivery path. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify and record that a Codex request_user_input prompt appears with choices in the originating chat and that an answer resumes the request.

Merge-risk options

Maintainer options:

  1. Verify the delivery boundary (recommended)
    Before merge, inspect the direct Codex contract and record a redacted after-fix question delivery and answer on Telegram or web chat.
  2. Accept the remaining proof gap
    Merge based on the shared-dispatcher regression only, accepting that this review could not independently verify the upstream request contract or visible flow.

Technical review

Best possible solution:

Keep the shared producer-level marker change, then verify the exact Codex request contract and one redacted Telegram or web-chat round trip before merging.

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

No live reproduction was run in this read-only review, but current-main source directly shows that unmarked harness blocks are suppressed in message-tool-only turns and the PR exercises that path.

Is this the best way to solve the issue?

Unclear: the placement is the narrowest shared OpenClaw repair, but the required direct Codex contract inspection remains unavailable.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against dec4d44618c3.

Labels

Label changes:

  • add P1: A silent failure to deliver a blocking Codex question prevents operators from making required choices in active chat workflows.
  • add merge-risk: 🚨 message-delivery: The change controls whether structured human-input prompts reach the source Telegram or web-chat conversation.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this MEMBER PR, but the prepared media documents another PR rather than this branch's after-fix behavior.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The change determines whether a Codex question and its answer choices visibly arrive in Telegram.

Label justifications:

  • P1: A silent failure to deliver a blocking Codex question prevents operators from making required choices in active chat workflows.
  • merge-risk: 🚨 message-delivery: The change controls whether structured human-input prompts reach the source Telegram or web-chat conversation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this MEMBER PR, but the prepared media documents another PR rather than this branch's after-fix behavior.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The change determines whether a Codex question and its answer choices visibly arrive in Telegram.

Evidence

What I checked:

Likely related people:

  • steipete: Authored merged harness-question convergence and the current shared bridge implementation history. (role: feature owner and recent area contributor; confidence: high; commits: d7de67ae027d, 52adbf4c60ca; files: src/agents/harness/user-input-bridge.ts, extensions/codex/src/app-server/user-input-bridge.ts)
  • obviyus: The PR-head marker lines blame to Ayaan Zaidi, and shortlog shows prior contributions in the shared bridge area. (role: recent area contributor; confidence: medium; commits: 62e952ed0f87; files: src/agents/harness/user-input-bridge.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Inspect the required sibling Codex request-user-input source before final merge review.
  • Capture a redacted after-fix Telegram or web-chat delivery-and-answer flow for this exact head.

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.

@obviyus

obviyus commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

Exact-head Telegram proof (62e952ed0f87c442edbd16c28f68d0e3bb825d31, redacted):

  • Canonical telegram-e2e-userbot real-user DM drove native Codex request_user_input on the built PR head.
  • At 4.6s, Telegram showed “Choose Red or Blue” and then attached one inline keyboard row with Red (Recommended) and Blue.
  • The proof resolved Red (Recommended) through the Gateway question API; question.waitAnswer returned successfully and Telegram rendered Answered: Red (Recommended).
  • Relevant observable lifecycle: 2 SUT messages, 1 content edit, 2 markup edits, 1 deletion of the superseded prompt, and 4 typing events. No provider mock requests; the run used the native Codex app-server path.

This directly exercises the changed source-suppression delivery path. Tester, bot, chat, question, connection, and message identifiers are omitted.

@obviyus

obviyus commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

Final Telegram gate — exact head 62e952ed0f87c442edbd16c28f68d0e3bb825d31 (redacted):

  • telegram-e2e-userbot real-user DM exercised native Codex request_user_input on the built PR head.
  • 5.7s: visible “Choose Red or Blue” prompt.
  • 6.7s: Telegram attached the native inline keyboard with Red (Recommended) and Blue.
  • First answer submission returned answered; question.waitAnswer completed successfully.
  • 32.5s: Telegram visibly rendered Answered: Red (Recommended).
  • Observable side effects: 2 SUT messages, 1 content edit, 2 markup edits, 1 deletion of the superseded prompt, 8 typing events. No separate post-answer model message appeared.
  • Clean gateway log: 1 successful question.waitAnswer; 0 invalid resolutions, lane failures, or embedded-agent failures. Native Codex path; 0 mock-provider requests.

Evidence retained locally: /tmp/telegram-e2e-proof.pr124146-final.parp2I/{events.ndjson,summary.json,gateway.log}. All account/chat/question/message identifiers omitted.

@obviyus

obviyus commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

Direct Codex contract verification for exact head 62e952ed0f87c442edbd16c28f68d0e3bb825d31:

Contract conclusion: OpenClaw owns presenting this blocking server request and returning the keyed answer. The PR changes only that presentation delivery boundary; request/answer protocol shape is unchanged.

@obviyus

obviyus commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

@openclaw-mantis telegram desktop proof: verify and record that a Codex request_user_input prompt appears with choices in the originating chat and that an answer resumes the request.

@obviyus

obviyus commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@obviyus obviyus self-assigned this Aug 15, 2026
@obviyus
obviyus merged commit 0134c78 into main Aug 15, 2026
195 checks passed
@obviyus
obviyus deleted the t3code/5b203f54 branch August 15, 2026 11:42
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…enclaw#124146)

Mark harness-owned input prompts for source-suppression delivery so Codex choices and secret prompts reach the originating chat during message-tool-only turns.

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

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

[Bug]: Codex request_user_input choices are not delivered to Telegram or Control UI

1 participant