Repository navigation
fix: ask_user suggests tapping options without buttons - #137978
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 11:16 AM ET / 15:16 UTC. ClawSweeper reviewWhat this changesThe PR makes structured question prompts reuse typed-reply instructions and adds coverage for Teams cards that omit question buttons. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and v2026.9.2 retain the misleading guidance. The focused repair has sufficient boundary proof and no identified blocking findings. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw converts agent questions into shared text and interactive presentations, which channel plugins render for users. This change corrects the shared instructions while preserving existing buttons and typed-answer handling. flowchart LR
A[Agent question and choices] --> B[Shared question presentation]
B --> C[Typed reply guidance]
C --> D[Channel renderer]
D --> E[Text and supported buttons]
E --> F[User answer]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2, Tests +54. Total +52 across 3 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one shared typed-reply instruction that remains accurate when channel renderers omit question buttons. Do we have a high-confidence way to reproduce the issue? Yes, from source: main emits tap guidance while the Teams renderer omits question actions. This review did not execute a reproduction. Is this the best way to solve the issue? Yes. Reusing the existing typed-reply helper fixes the shared producer without adding channel capability APIs or changing answer behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against aa947ec2812a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper The requested running-Gateway behavior proof is now in the PR description under Evidence → Running-Gateway behavior proof: PASS, for unchanged head
Scope is clearly disclosed: the external model and channel APIs were mocked on loopback; this is not live Telegram/Test Server proof. Existing CI failures remain, and no merge-readiness claim is being made. Posting this separate comment to make the newly added evidence visible alongside the review. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper rereview |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Remove the intermediate presentation assertion so the regression exercises the real card renderer before checking guidance. Retain the complete card and plain-text expectations. Co-authored-by: harshitgupta31415 <[email protected]>
Merge protected main 0ebb320 to pick up openclaw#140018's preflight output repair. Preserve the original contributor history and the unchanged three-file question guidance fix. Historical renderer red/green proof remains retained. The composed candidate passed 217 tests across five suites; exact-head CI is pending. Co-authored-by: harshitgupta31415 <[email protected]>
|
Merged via squash.
|
* fix: avoid tap-only guidance in question prompts * test: use public Teams API in question prompt contract * test: assert question guidance through Teams rendering Remove the intermediate presentation assertion so the regression exercises the real card renderer before checking guidance. Retain the complete card and plain-text expectations. Co-authored-by: harshitgupta31415 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: harshitgupta31415 <[email protected]>
Closes #135354
Maintainer validation update
Composed head:
70e8a5c96abc042a6ae74e1a40478f406d687035.This refresh incorporates protected main
0ebb320906da7e1727934b3cf816cedf98270357, including the landed CI output-size repair #140018, while preserving the contributor's commit history and the same guidance fix. Production remains net −2 lines; tests are net +54.The historical hosted run verified two intended failures at the real Teams card assertion and 209 passing candidate tests. Main subsequently added question-delivery generation tracking and unrelated handler coverage. The composed candidate has fresh source reviews and a completed green refresh: 217 tests passed across five suites, including both real Teams renderer cases and the tool/harness delivery-generation cases, with all three source hashes verified. Fresh exact-head CI passed at this head, including the restored fork-profile preflight. The Gateway/Telegram evidence below remains explicitly attributed to the original synthetic run.
What Problem This Solves
Fixes an issue where users answering an
ask_userprompt are told to tap an option when their channel renders no tappable question control. MS Teams, for example, preserves the instruction while omitting unsupported question actions.Why This Change Was Made
Reuse the existing plain-text reply guidance in the shared rich presentation so both describe the supported typed-reply path. Existing question actions, option order, custom-answer behavior, and channel capabilities remain unchanged; this does not add buttons to individual channels or introduce a capability API.
User Impact
Users receive accurate reply instructions whether their channel renders native question buttons or text-only options. Channels with question buttons retain those controls. No configuration or dependency changes are required.
Evidence
Running-Gateway behavior proof: PASS
Added in response to the behavior-proof review, on unchanged head
391b9c323d23e998fb17d8f47e7ad5ce1803a867.A real ephemeral Gateway and the real Telegram plugin completed both native typed-reply flows. Only the external model and Telegram HTTP API were mocked on loopback. This uses the repository's
createQaGatewayChildandstartQaMockOpenAiServerhelpers; the full verdict, wire transcript, and test-only reproduction driver are below. This is the mock-channel + mock-provider + ephemeral-Gateway evidence shape permitted by AGENTS.md, not a claim of live Telegram verification.2Production 🚀ASK-USER-SINGLE-OK | deploy=Production 🚀night-shiftnight-shiftASK-USER-SINGLE-OK | deploy=night-shiftBoth actual outgoing
sendRichMessagerequests contain:reply_markup.inline_keyboard; declared-choice callback data is nonempty and within the Telegram size limit. This run checks retained controls, not clicking them.pendingtoansweredthrough normal inbound Telegram updates. The resumed model request contains the real returned tool answer, followed by the channel's final rich-message delivery. Noquestion.resolveRPC, renderer mock, answer-handler mock, or product auth-policy bypass is used.Scope and limitations
This is deterministic local HTTP evidence, not screenshots, a live Telegram client, Teams service, Feishu service, or Telegram Test Server/userbot proof. The live Telegram skill's required shared-account tooling/auth was unavailable, so that path was not bypassed. Telegram rich messages were explicitly enabled to cover the changed presentation; streaming was off.
A prior Teams mock-Connector run also captured a genuinely sent buttonless Adaptive Card with the corrected instruction (below). Its operator-created question could not be answered by a different channel identity: the normal caller-policy guard rejected it. That attempted Teams roundtrip failed and is not counted as a passing end-to-end case. The two passing complete roundtrips above are native Telegram-origin questions and replies from the same synthetic chat/user.
Windows setup needed a parent-process-only staging adapter: privileged file symlinks were copied byte-for-byte into the harness-owned staging tree; directory links use junctions when needed. Product child-process code and access checks were not patched. The installed Crabline recorder separately rejected this machine's directory permissions; that failed fixture was abandoned, not weakened. The successful run uses a small explicit loopback Bot API fixture with an allowlist of two synthetic users, an authenticated local injection endpoint, and strict failure on unimplemented Bot API methods. Its rich-message request/response shape follows the installed grammY types and Telegram's Bot API contract. All identifiers below are synthetic test identifiers; no real account credentials or private conversations are included.
Exact successful verdict JSON
{ "verdict": "PASS", "head": "391b9c323d23e998fb17d8f47e7ad5ce1803a867", "buildHead": "391b9c323d23e998fb17d8f47e7ad5ce1803a867", "startedAt": "2026-09-04T08:13:31.357Z", "finishedAt": "2026-09-04T08:15:55.677Z", "environment": "Windows; real Gateway + real Telegram plugin; mock model + loopback mock Bot API", "entrypoint": "Both prompt and typed answer arrive as native Telegram updates for the same synthetic user/chat", "liveTelegram": false, "questionResolveRpcUsed": false, "telegramConfig": { "richMessages": true, "streaming": { "mode": "off" } }, "mockApi": "Loopback-only HTTP Bot API fixture implementing getUpdates and sendRichMessage using installed grammY contract; no renderer or answer-handler mocks", "windowsStaging": { "copiedFileSymlinks": 5822, "directoryJunctions": 0, "productRuntimeModified": false }, "cases": [ { "case": "number", "questionId": "ask_3ed577c709e067d8f9cb55acaeb96389", "pendingStatus": "pending", "promptMethod": "sendRichMessage", "richMessageRequest": { "blocks": [ { "type": "paragraph", "text": "Where should this deploy?" }, { "type": "list", "items": [ { "blocks": [ { "type": "paragraph", "text": "Staging (Recommended): Safer default" } ] }, { "blocks": [ { "type": "paragraph", "text": "Production 🚀: Ship to users" } ] } ] }, { "type": "paragraph", "text": "Reply with the number, the option text, or your own answer." } ] }, "inlineKeyboard": [ [ { "text": "Staging (Recommended)", "callback_data": "tgq1:ask_3ed577c709e067d8f9cb55acaeb96389:0" } ], [ { "text": "Production 🚀", "callback_data": "tgq1:ask_3ed577c709e067d8f9cb55acaeb96389:1" } ], [ { "text": "Other…", "callback_data": "tgqo1:ask_3ed577c709e067d8f9cb55acaeb96389" } ] ], "typedInbound": "2", "terminalStatus": "answered", "terminalAnswers": { "answers": { "deploy_target": [ "Production 🚀" ] } }, "toolOutput": "Deploy: Production 🚀\n\n{\n \"status\": \"answered\",\n \"answers\": {\n \"answers\": {\n \"deploy_target\": [\n \"Production 🚀\"\n ]\n }\n }\n}", "finalMethod": "sendRichMessage", "finalRichMessage": { "blocks": [ { "type": "paragraph", "text": "ASK-USER-SINGLE-OK | deploy=Production 🚀" } ] }, "deliveredFinal": "ASK-USER-SINGLE-OK | deploy=Production 🚀" }, { "case": "custom-text", "questionId": "ask_67012e0c1995652e9cb4018cbe3e7ab9", "pendingStatus": "pending", "promptMethod": "sendRichMessage", "richMessageRequest": { "blocks": [ { "type": "paragraph", "text": "Where should this deploy?" }, { "type": "list", "items": [ { "blocks": [ { "type": "paragraph", "text": "Staging (Recommended): Safer default" } ] }, { "blocks": [ { "type": "paragraph", "text": "Production 🚀: Ship to users" } ] } ] }, { "type": "paragraph", "text": "Reply with the number, the option text, or your own answer." } ] }, "inlineKeyboard": [ [ { "text": "Staging (Recommended)", "callback_data": "tgq1:ask_67012e0c1995652e9cb4018cbe3e7ab9:0" } ], [ { "text": "Production 🚀", "callback_data": "tgq1:ask_67012e0c1995652e9cb4018cbe3e7ab9:1" } ], [ { "text": "Other…", "callback_data": "tgqo1:ask_67012e0c1995652e9cb4018cbe3e7ab9" } ] ], "typedInbound": "night-shift", "terminalStatus": "answered", "terminalAnswers": { "answers": { "deploy_target": [ "night-shift" ] } }, "toolOutput": "Deploy: night-shift\n\n{\n \"status\": \"answered\",\n \"answers\": {\n \"answers\": {\n \"deploy_target\": [\n \"night-shift\"\n ]\n }\n }\n}", "finalMethod": "sendRichMessage", "finalRichMessage": { "blocks": [ { "type": "paragraph", "text": "ASK-USER-SINGLE-OK | deploy=night-shift" } ] }, "deliveredFinal": "ASK-USER-SINGLE-OK | deploy=night-shift" } ], "proxyErrors": [], "cleanup": { "process": "confirmed-stopped", "errors": [] } }Actual successful wire transcript (JSONL)
{"timestamp":"2026-09-04T08:15:25.333Z","direction":"bot-api-control","method":"deleteWebhook"} {"timestamp":"2026-09-04T08:15:25.337Z","direction":"bot-api-control","method":"deleteMyCommands"} {"timestamp":"2026-09-04T08:15:25.527Z","direction":"bot-api-control","method":"deleteMyCommands"} {"timestamp":"2026-09-04T08:15:26.524Z","direction":"bot-api-control","method":"setMyCommands"} {"timestamp":"2026-09-04T08:15:29.952Z","direction":"inbound","chatId":"100001","text":"Structured question QA check. Ask one deploy question and read its actual returned answer. QA routing marker: tool search qa check target=ask_user ask_user_fixture=single.","httpStatus":200,"messageId":1} {"timestamp":"2026-09-04T08:15:30.598Z","direction":"bot-api-control","method":"setMyCommands"} {"timestamp":"2026-09-04T08:15:31.896Z","direction":"bot-api-control","method":"sendChatAction"} {"timestamp":"2026-09-04T08:15:39.565Z","direction":"bot-api-control","method":"sendChatAction"} {"timestamp":"2026-09-04T08:15:43.593Z","direction":"outbound","method":"sendRichMessage","request":{"chat_id":"100001","rich_message":{"blocks":[{"type":"paragraph","text":"Where should this deploy?"},{"type":"list","items":[{"blocks":[{"type":"paragraph","text":"Staging (Recommended): Safer default"}]},{"blocks":[{"type":"paragraph","text":"Production 🚀: Ship to users"}]}]},{"type":"paragraph","text":"Reply with the number, the option text, or your own answer."}]},"reply_markup":{"inline_keyboard":[[{"text":"Staging (Recommended)","callback_data":"tgq1:ask_3ed577c709e067d8f9cb55acaeb96389:0"}],[{"text":"Production 🚀","callback_data":"tgq1:ask_3ed577c709e067d8f9cb55acaeb96389:1"}],[{"text":"Other…","callback_data":"tgqo1:ask_3ed577c709e067d8f9cb55acaeb96389"}]]}},"accepted":true,"messageId":10000000} {"timestamp":"2026-09-04T08:15:43.711Z","direction":"inbound","chatId":"100001","text":"2","httpStatus":200,"messageId":2} {"timestamp":"2026-09-04T08:15:44.758Z","direction":"bot-api-control","method":"sendChatAction"} {"timestamp":"2026-09-04T08:15:45.741Z","direction":"outbound","method":"sendRichMessage","request":{"chat_id":"100001","rich_message":{"blocks":[{"type":"paragraph","text":"ASK-USER-SINGLE-OK | deploy=Production 🚀"}]}},"accepted":true,"messageId":10000001} {"timestamp":"2026-09-04T08:15:45.814Z","direction":"inbound","chatId":"100002","text":"Structured question QA check. Ask one deploy question and read its actual returned answer. QA routing marker: tool search qa check target=ask_user ask_user_fixture=single.","httpStatus":200,"messageId":3} {"timestamp":"2026-09-04T08:15:46.273Z","direction":"bot-api-control","method":"sendChatAction"} {"timestamp":"2026-09-04T08:15:47.891Z","direction":"outbound","method":"sendRichMessage","request":{"chat_id":"100002","rich_message":{"blocks":[{"type":"paragraph","text":"Where should this deploy?"},{"type":"list","items":[{"blocks":[{"type":"paragraph","text":"Staging (Recommended): Safer default"}]},{"blocks":[{"type":"paragraph","text":"Production 🚀: Ship to users"}]}]},{"type":"paragraph","text":"Reply with the number, the option text, or your own answer."}]},"reply_markup":{"inline_keyboard":[[{"text":"Staging (Recommended)","callback_data":"tgq1:ask_67012e0c1995652e9cb4018cbe3e7ab9:0"}],[{"text":"Production 🚀","callback_data":"tgq1:ask_67012e0c1995652e9cb4018cbe3e7ab9:1"}],[{"text":"Other…","callback_data":"tgqo1:ask_67012e0c1995652e9cb4018cbe3e7ab9"}]]}},"accepted":true,"messageId":10000002} {"timestamp":"2026-09-04T08:15:47.990Z","direction":"inbound","chatId":"100002","text":"night-shift","httpStatus":200,"messageId":4} {"timestamp":"2026-09-04T08:15:49.563Z","direction":"outbound","method":"sendRichMessage","request":{"chat_id":"100002","rich_message":{"blocks":[{"type":"paragraph","text":"ASK-USER-SINGLE-OK | deploy=night-shift"}]}},"accepted":true,"messageId":10000003}Additional Teams card delivery evidence — not a completed roundtrip
Captured by the loopback Bot Framework Connector at
2026-09-04T07:54:33.396Z, after the real Gateway / Teams outbound path. The actual Adaptive Card has noactionsfield:{ "type": "AdaptiveCard", "version": "1.4", "body": [ { "type": "TextBlock", "text": "Where should this deploy?", "wrap": true }, { "type": "TextBlock", "text": "- Staging (Recommended): Safer default\n- Production 🚀: Ship to users\n\nReply with the number, the option text, or your own answer.", "wrap": true } ] }The later ordinary Teams reply was rejected with:
question answer caller policy does not match its creator. Cleanup confirmed the Gateway stopped. This is supporting buttonless-card delivery evidence only, not a PASS verdict.Reproduce the passing Gateway + Telegram run
On this exact PR head with repository dependencies installed, build the private QA runtime:
PowerShell equivalent: set
$env:OPENCLAW_BUILD_PRIVATE_QA='1'before thenodecommand. The exact-head build completed successfully, including the runtime post-build checks and build stamp.Save the following test-only driver as
extensions/qa-lab/.qa-ask-user-telegram-proof.mts, then run from the repo root:The driver asserts an unchanged tracked checkout and matching build stamp; it emits
verdict.json,transcript.jsonl, and diagnostics under.artifacts/qa-e2e/ask-user-telegram-<timestamp>. It exits nonzero unless both cases and cleanup pass. The driver is evidence tooling only and is not included in the three-file production/test PR diff.Existing regression and static checks
isOther=falseandisOther=true) failed because the presentation containedTap an optioninstead of the expected typed-reply guidance.msteams/channel-plugin-api.js. This was reproduced locally: the boundary suite reported the same offending import (1 failed, 9 passed).391b9c323d23e998fb17d8f47e7ad5ce1803a867changes only that import to the existing, permittedmsteams/api.jsbarrel, which exports the same plugin. No assertions, production exports, or boundary rules were changed.git diff --check, and the complete changed-file gate for this one-file follow-up passed, including the core TypeScript graph boundary, root-test type-check, script lint, and changed-test lint.build-artifactspassed. The gate remains red on memory-recall and Gateway lifecycle timeouts (extensions/memory-core/src/tools.recall-tracking.test.ts:45andsrc/gateway/server-plugins.lifecycle.test.ts:185); these files are unchanged by this PR. The new behavior proof does not claim green CI.Focused tests (Windows, Node 26.2.0;
OPENCLAW_VITEST_MAX_WORKERS=1):Follow-up changed-file gate: