Repository navigation
fix(btw): side questions ignore the image attached to the message - #150020
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: blocked before merge. Reviewed September 16, 2026, 12:02 PM ET / 16:02 UTC (Revision 6). ClawSweeper reviewWhat this changesPasses attached images into /btw provider and Codex requests, explains omitted images to CLI runtimes, documents support limits, and extracts existing prompts and test setup. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful fix: current main and the latest release still omit current-message images from side questions. No blocking introduced defect was found, and the earlier documentation finding is resolved. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s /btw command answers a side question using the active conversation without adding the exchange to its history. The command resolves message attachments and passes them to the selected provider or harness. flowchart TD
A[Side question and attachments] --> B[Authorized command]
B --> C[Existing image resolver]
C --> D{Selected runtime}
D --> E[Provider or Codex image input]
D --> F[CLI omission notice]
E --> G[Ephemeral side answer]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +18, Tests +472, Docs +9. Total +499 across 18 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one attachment resolver and the existing runtime adapters, preserving text-only compatibility and the explicitly documented image-support limits. Do we have a high-confidence way to reproduce the issue? Yes: an active session followed by a photo captioned /btw reaches a current-main handler that forwards only question text. Source inspection and the recorded Telegram comparison support the failure; this review did not execute it. Is this the best way to solve the issue? Yes: reusing the main turn’s image resolver and existing provider/Codex adapters is a narrow repair. The separate Telegram native-command ingress problem remains owned by the related PR. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ca086327834a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
/btw resolved only the question text, so a photo with a /btw caption (or a replied-to photo a channel supplies as reply media) never reached the side question and the model asked the user to resend the image. Reuse the main run's current-turn image owner in the /btw command and carry the images into the side question: direct provider calls append sanitized image blocks after the question, harness side questions receive them through the side-question params (Codex builds its turn input with the same user-input builder the main turn uses), and CLI runtimes get a text note with the omitted image count instead of guessing.
8a2a9a3 to
4fe803e
Compare
|
Proof: A photo captioned
|
…ts photo (#150028) The broad diff removes the parallel native-command dispatcher and moves its coverage onto the shared message pipeline. ## What Problem This Solves Typed Telegram commands lose replied-to photos, quoted text, and conversation context. Caption commands already use the full message pipeline. ## Why This Change Was Made Native handlers keep `/login` and argument keyboards; other commands continue through message admission, reply-media hydration, and chat-session dispatch. The bespoke turn plan and duplicate delivery policy are removed. One ingress rule owns command authorization. The registered command map translates `/export_session` to `/export-session` without changing raw text. This state has one writer. ## User Impact Typed commands get normal message context. Command-only allowlists and owners retain access outside account-level sender lists; explicit chat and topic sender restrictions still apply. Disabled chats and topics stay disabled. Replies follow `replyToMode` and ordinary tool-progress policy. Session metadata is awaited before dispatch, and hook-suppressed final replies no longer trigger an empty-response fallback. ## Evidence Telegram Test Server, mock provider: hello, bare photo, then `/btw what color is the image I replied to?` replying to it. On `42951671d`, the side-question request has no image; with this change and #150020 at `abb9329291e`, it contains `input_image` and the bot answers. The caption case also passes. Combined tests: 3,349 Telegram, 952 shared-state, and 121 side-question tests pass. Live Telegram authorization check: a command-only sender receives `/status` and the `/think` keyboard. After an explicit chat restriction excludes them, status dispatch is dropped and `/think` returns only an authorization denial. Before the correction, both commands still executed. All 24 direct/group/topic, owner/command-list, included/excluded command tests pass. `node openclaw.mjs qa run --repo-root . --qa-profile smoke-ci --concurrency 1 --scenario telegram-command-prompt-context` fails before the correction and passes after it: export acknowledgement and Telegram prompt context remain in the topic. ## Compatibility Native commands now use the chat session, not `telegram:slash:<userId>`. Menu applicability adds one plugin SDK export; the maintainer approved its exact +1 export and callable budgets. The unchanged menu consumer compiles against shipped 2026.9.4 and candidate package declarations; the new helper compiles against the candidate. No config, schema, or protocol change. ## Consumers Builtin commands use the shared pipeline. Login, keyboards, and plugin commands retain their native executors. ## Invalidation None: context is built per message. ## Tests Registered bot updates cover photo replies, captions, menu/login routing, command-name translation, command-only access, rejected senders, disabled topics, topic sessions, and progress. Removed dispatcher coverage is moved or retired with its deleted behavior. Co-authored-by: Ayaan Zaidi <[email protected]>
…enclaw#150020) Most changed lines move existing tests into sibling files; all coverage remains. ## What Problem This Solves `/btw` asks for an image already attached to its message or supplied as reply context. ## Why This Change Was Made `/btw` now reuses the main turn's image resolver. Direct-provider requests and the bundled app-server side thread receive those images. Prompt assembly and shared test setup move into sibling files to avoid growing oversized files. This state has one writer; side questions still write no transcript. ## User Impact Questions can use the attached image. Text-only CLI runtimes receive an omitted-image count. Other harness plugins may ignore images. ## Evidence Telegram Test Server, mock provider: send hello, then a photo captioned `/btw what color is this image?`. On `c509330cb`, the side-question request has text only. On the final combined candidate `abb9329291e`, it includes `input_image` and the bot answers. The reply-to-photo case also passes with openclaw#150028; this PR alone does not repair Telegram's native-command delivery. Combined tests: 121 side-question, 952 shared-state, and 3,349 Telegram tests pass. ## Compatibility Optional `images` on `AgentHarnessSideQuestionParams`; no config, schema, or protocol change. The same external consumer compiles against shipped 2026.9.4 and candidate package declarations. Candidate image/no-image callbacks pass with matching candidate dependencies; this is not a release-installation test. ## Consumers The direct request and bundled side-thread input consume images; the CLI prompt consumes the omitted count. Shared internal reply options own extracted file images. ## Invalidation None: images are per-call data. ## Tests Command, direct-request, harness, CLI, and app-server input regressions; existing tests moved without removing cases. An image already described by media understanding remains excluded; passing that description to `/btw` is a separate gap. Co-authored-by: Ayaan Zaidi <[email protected]>
…ts photo (openclaw#150028) The broad diff removes the parallel native-command dispatcher and moves its coverage onto the shared message pipeline. ## What Problem This Solves Typed Telegram commands lose replied-to photos, quoted text, and conversation context. Caption commands already use the full message pipeline. ## Why This Change Was Made Native handlers keep `/login` and argument keyboards; other commands continue through message admission, reply-media hydration, and chat-session dispatch. The bespoke turn plan and duplicate delivery policy are removed. One ingress rule owns command authorization. The registered command map translates `/export_session` to `/export-session` without changing raw text. This state has one writer. ## User Impact Typed commands get normal message context. Command-only allowlists and owners retain access outside account-level sender lists; explicit chat and topic sender restrictions still apply. Disabled chats and topics stay disabled. Replies follow `replyToMode` and ordinary tool-progress policy. Session metadata is awaited before dispatch, and hook-suppressed final replies no longer trigger an empty-response fallback. ## Evidence Telegram Test Server, mock provider: hello, bare photo, then `/btw what color is the image I replied to?` replying to it. On `c509330cb`, the side-question request has no image; with this change and openclaw#150020 at `abb9329291e`, it contains `input_image` and the bot answers. The caption case also passes. Combined tests: 3,349 Telegram, 952 shared-state, and 121 side-question tests pass. Live Telegram authorization check: a command-only sender receives `/status` and the `/think` keyboard. After an explicit chat restriction excludes them, status dispatch is dropped and `/think` returns only an authorization denial. Before the correction, both commands still executed. All 24 direct/group/topic, owner/command-list, included/excluded command tests pass. `node openclaw.mjs qa run --repo-root . --qa-profile smoke-ci --concurrency 1 --scenario telegram-command-prompt-context` fails before the correction and passes after it: export acknowledgement and Telegram prompt context remain in the topic. ## Compatibility Native commands now use the chat session, not `telegram:slash:<userId>`. Menu applicability adds one plugin SDK export; the maintainer approved its exact +1 export and callable budgets. The unchanged menu consumer compiles against shipped 2026.9.4 and candidate package declarations; the new helper compiles against the candidate. No config, schema, or protocol change. ## Consumers Builtin commands use the shared pipeline. Login, keyboards, and plugin commands retain their native executors. ## Invalidation None: context is built per message. ## Tests Registered bot updates cover photo replies, captions, menu/login routing, command-name translation, command-only access, rejected senders, disabled topics, topic sessions, and progress. Removed dispatcher coverage is moved or retired with its deleted behavior. Co-authored-by: Ayaan Zaidi <[email protected]>
Most changed lines move existing tests into sibling files; all coverage remains.
What Problem This Solves
/btwasks for an image already attached to its message or supplied as reply context.Why This Change Was Made
/btwnow reuses the main turn's image resolver. Direct-provider requests and the bundled app-server side thread receive those images. Prompt assembly and shared test setup move into sibling files to avoid growing oversized files. This state has one writer; side questions still write no transcript.User Impact
Questions can use the attached image. Text-only CLI runtimes receive an omitted-image count. Other harness plugins may ignore images.
Evidence
Telegram Test Server, mock provider: send hello, then a photo captioned
/btw what color is this image?. On42951671d, the side-question request has text only. On the final combined candidateabb9329291e, it includesinput_imageand the bot answers. The reply-to-photo case also passes with #150028; this PR alone does not repair Telegram's native-command delivery. Combined tests: 121 side-question, 952 shared-state, and 3,349 Telegram tests pass.Compatibility
Optional
imagesonAgentHarnessSideQuestionParams; no config, schema, or protocol change. The same external consumer compiles against shipped 2026.9.4 and candidate package declarations. Candidate image/no-image callbacks pass with matching candidate dependencies; this is not a release-installation test.Consumers
The direct request and bundled side-thread input consume images; the CLI prompt consumes the omitted count. Shared internal reply options own extracted file images.
Invalidation
None: images are per-call data.
Tests
Command, direct-request, harness, CLI, and app-server input regressions; existing tests moved without removing cases. An image already described by media understanding remains excluded; passing that description to
/btwis a separate gap.