Skip to content

fix(channels): preserve actionable presentation fallbacks - #116990

Merged
steipete merged 2 commits into
mainfrom
codex/qa300-portable-presentation-fallback
Jul 31, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa300-portable-presentation-fallback

Conversation

@steipete

@steipete steipete commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users following a channel-delivered command menu would see only an action label, with no slash command they could enter, when the control exceeded a transport limit or the channel did not support select menus. This affected portable presentation fallbacks across Mattermost, Microsoft Teams, Matrix, and other channel adapters.

Why This Change Was Made

The shared presentation payload owner now formats visible action fallbacks once and both fallback paths reuse that canonical decision. Explicit command actions retain their public slash commands and public links retain their targets, while opaque callback values, approval identifiers, question identifiers, and disabled actions remain private.

User Impact

  1. When a command button cannot render natively, operators see the exact slash command they can type to complete the action.
  2. Unsupported, overflowed, or plain-text-only select menus expose each option's public command instead of leaving an unclickable label.

This is a bounded internal display-owner refactor with zero net production lines; no public SDK, configuration, security, protocol, persistence, or dependency contracts change.

Evidence

  • Frozen canonical baseline: 36b80ada3ceae2de21b3d8710b883d778e4c4578; immutable reviewed candidate: aa4d32229c269cf3c2690161d8b34fcb2832537b.
  • Authentic before/after production-module probes:
Unsupported command button: Actions:\n- Deploy
                         -> Actions:\n- Deploy: `/deploy production`

Unsupported command select: Environment:\n- Production
                         -> Environment:\n- Production: `/deploy production`

Canonical select fallback: Environment:\n- Production
                        -> Environment:\n- Production: `/deploy production`
  • Exact-head repository-native focused test command:
PATH=/Users/steipete/.local/bin:$PATH node scripts/run-vitest.mjs src/channels/plugins/outbound/interactive.test.ts src/interactive/payload.test.ts src/interactive/payload.fallback.test.ts extensions/msteams/src/welcome-card.test.ts extensions/mattermost/src/channel.test.ts extensions/matrix/src/outbound.test.ts
  • 188/188 tests passed across six focused suites and four projects: 85 shared-owner tests, 76 Mattermost action-to-send tests, 16 Matrix outbound renderer tests, and 11 Microsoft Teams Adaptive Card tests.
  • Regression cases explicitly prove callback values, approval transport IDs, question identifiers, and disabled navigation targets remain undisclosed.
  • Production delta: 29 added / 29 removed = net zero; test delta: 191 regression lines added.
  • Fresh exact-head structured Codex autoreview using the canonical absolute repository helper (gpt-5.6-sol, high reasoning, priority P3) returned zero P0/P1/P2/P3 findings, 0.94 confidence, and genuine TruffleHog clean.
  • A separate channel-lane lead independently reviewed the exact corrected immutable branch and confirmed clean, including transport action semantics, secret-nondisclosure boundaries, byte-identical production owners, and unchanged extracted regression coverage.
  • Direct upstream Codex contract inspection: ../codex/codex-rs/app-server-protocol/src/protocol/v2/item.rs:1435, ../codex/codex-rs/app-server-protocol/src/protocol/v2/item.rs:1607, and ../codex/codex-rs/app-server-protocol/src/protocol/common.rs:1512.
  • Direct targeted oxlint passes for all seven changed files plus the restored original payload test, and direct oxfmt passes for both touched payload tests. The original src/interactive/payload.test.ts is byte-for-byte identical to frozen main; the unchanged command/privacy assertion now lives in focused src/interactive/payload.fallback.test.ts, resolving the prior check-lint maximum-lines failure without suppression or lost coverage. git diff --check, immutable baseline ancestry, clean final worktree, and unchanged public Plugin SDK barrel all verified.

No live provider credentials, real channel sends, public contract changes, or persistent-state modifications are included.

@openclaw-barnacle openclaw-barnacle Bot added channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams size: M maintainer Maintainer-authored PR labels Jul 31, 2026
@steipete
steipete marked this pull request as ready for review July 31, 2026 18:58
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 31, 2026, 3:22 PM ET / 19:22 UTC.

ClawSweeper review

What this changes

This PR centralizes portable-control fallback labels so unsupported or overflowed command buttons and select options show their public slash command or link while opaque callbacks, approvals, questions, and disabled controls remain label-only.

Merge readiness

⚠️ Needs maintainer review before merge - 4 items remain

Keep this PR open for maintainer review. The shared-owner implementation is a coherent way to make unsupported controls actionable while retaining opaque callback privacy, but it changes the documented select fallback contract from label-only to displaying typed slash commands; that product and public-docs decision needs explicit confirmation before merge.

Priority: P2
Reviewed head: aa4d32229c269cf3c2690161d8b34fcb2832537b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The behavioral proof and shared-owner implementation are strong, but the patch needs an explicit product-contract decision and matching documentation before it is merge-ready.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body includes before/after production-module output for command button and select fallbacks plus focused exact-head test results; the shown evidence demonstrates the improved visible behavior without disclosing private values.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body includes before/after production-module output for command button and select fallbacks plus focused exact-head test results; the shown evidence demonstrates the improved visible behavior without disclosing private values.
Evidence reviewed 6 items Current fallback behavior: Current main renders typed command actions for buttons but renders every select option as its label alone, so unsupported selects lose the actionable slash command.
Documented public contract: The Matrix presentation documentation explicitly says command buttons render the command but select blocks render label-only option lines, so the PR changes an established user-facing fallback rule.
Canonical implementation shape: The supplied PR patch adds one shared control-label renderer in the interactive payload owner and reuses it for both generic text fallback and channel-limit fallback, preserving command-versus-callback action discrimination.
Findings 1 actionable finding [P2] Document the new select-command fallback contract
Security None None.

How this fits together

Agent and plugin code emits a portable message presentation that channel adapters render natively when possible or downgrade to text when a transport lacks controls or hits limits. The shared fallback renderer supplies the text sent onward by Matrix, Mattermost, Microsoft Teams, and other channel adapters.

flowchart LR
  A[Agent or plugin presentation] --> B[Shared control fallback renderer]
  B --> C[Channel capability and limit adapter]
  C --> D[Public command or link text]
  C --> E[Opaque action stays label-only]
  D --> F[Channel fallback message]
  E --> F
Loading

Decision needed

Question Recommendation
Should typed select actions with type: "command" be shown as copyable slash commands in plain-text channel fallbacks, changing the current documented label-only select rule? Adopt actionable select fallbacks: Confirm typed command actions are public presentation content, update the fallback documentation, and merge with the existing privacy regression coverage.

Why: The technical implementation is centralized and privacy-aware, but current user-facing Matrix documentation explicitly defines the opposite select fallback behavior; only maintainers can choose the intended portable presentation contract.

Before merge

  • Document the new select-command fallback contract (P2) - Current Matrix docs explicitly promise label-only select fallback lines, while this shared renderer exposes typed command text. Update the public fallback rules after maintainer confirmation so clients and operators have one contract for unsupported select controls.
  • Resolve merge risk (P2) - Merging changes visible fallback output for existing Matrix and other channel users from documented label-only select options to slash-command text; the public contract and privacy rationale need maintainer confirmation and aligned documentation.
  • Complete next step (P2) - A maintainer must decide whether select command text is intentionally public in fallback messages; the current maintainer label also requires explicit human handling.

Findings

  • [P2] Document the new select-command fallback contract — src/interactive/payload.ts:1157-1159
Agent review details

Security

None.

PR surface

Source 0, Tests +191. Total +191 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 29 29 0
Tests 5 191 0 +191
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 220 29 +191

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Confirm and document the new fallback rule (recommended)
    Before merge, approve typed select-command visibility and update the Matrix presentation fallback contract to match the shared renderer.
  2. Preserve the existing select privacy posture
    If label-only selects are intentional, remove select-command expansion while retaining any independently useful button-fallback cleanup.

Technical review

Best possible solution:

Confirm that typed select commands are intentionally public in plain-text fallbacks, then update the Matrix fallback documentation and retain focused coverage that commands are exposed while callbacks, approvals, question identifiers, and disabled controls remain private.

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

Yes, source-reproducible: current main renders command buttons with their command but renders select options as labels only in src/interactive/payload.ts:1122 and src/interactive/payload.ts:1151; the supplied PR evidence shows the proposed before/after output.

Is this the best way to solve the issue?

No, not yet: placing the formatter in the shared payload owner is the best technical layer, but the PR must first resolve the documented label-only select contract and align the public docs with the chosen behavior.

Full review comments:

  • [P2] Document the new select-command fallback contract — src/interactive/payload.ts:1157-1159
    Current Matrix docs explicitly promise label-only select fallback lines, while this shared renderer exposes typed command text. Update the public fallback rules after maintainer confirmation so clients and operators have one contract for unsupported select controls.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Existing users and clients receive different plain-text fallback output than the currently documented label-only select behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes before/after production-module output for command button and select fallbacks plus focused exact-head test results; the shown evidence demonstrates the improved visible behavior without disclosing private values.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a bounded but user-visible portable-channel fallback behavior change with a defined documentation conflict.
  • merge-risk: 🚨 compatibility: Existing users and clients receive different plain-text fallback output than the currently documented label-only select behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes before/after production-module output for command button and select fallbacks plus focused exact-head test results; the shown evidence demonstrates the improved visible behavior without disclosing private values.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes before/after production-module output for command button and select fallbacks plus focused exact-head test results; the shown evidence demonstrates the improved visible behavior without disclosing private values.

Evidence

What I checked:

  • Current fallback behavior: Current main renders typed command actions for buttons but renders every select option as its label alone, so unsupported selects lose the actionable slash command. (src/interactive/payload.ts:1122, 629d3c2144ae)
  • Documented public contract: The Matrix presentation documentation explicitly says command buttons render the command but select blocks render label-only option lines, so the PR changes an established user-facing fallback rule. Public docs: docs/channels/matrix-presentation.md. (docs/channels/matrix-presentation.md:51, 629d3c2144ae)
  • Canonical implementation shape: The supplied PR patch adds one shared control-label renderer in the interactive payload owner and reuses it for both generic text fallback and channel-limit fallback, preserving command-versus-callback action discrimination. (src/interactive/payload.ts:1157, aa4d32229c26)
  • Privacy boundary in current owner: Current action normalization distinguishes command payloads from callback payloads, and the existing button fallback test already verifies commands remain visible while callback values remain private. (src/interactive/payload.ts:164, 629d3c2144ae)
  • Feature provenance: The current presentation delivery and fallback owner were introduced together by the recent presentation-delivery repair, making its author the strongest routing candidate for this contract decision. (src/interactive/payload.ts:1091, f18d619c025c)
  • Candidate-object limitation: The candidate commit exists locally, but its missing promisor objects could not be fetched because GitHub DNS resolution failed; exact-head source review therefore relies on the supplied GitHub patch context and should be refreshed against GitHub's merge result before landing. (aa4d32229c26)

Likely related people:

  • steipete: The current shared fallback owner and channel-limit adapter both most recently trace to the presentation-delivery repair authored by Peter Steinberger, who is also the PR author. (role: introduced current presentation delivery behavior; confidence: high; commits: f18d619c025c; files: src/interactive/payload.ts, src/channels/plugins/outbound/presentation-limits.ts)

Rank-up moves

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

  • Obtain maintainer confirmation that typed select commands are public in plain-text fallbacks.
  • Update docs/channels/matrix-presentation.md to match the chosen select fallback behavior.
  • Refresh the exact-head merge review once the checkout can materialize the candidate objects.

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-07-31T19:05:24.781Z sha 2195767 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed 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. labels Jul 31, 2026
@steipete
steipete merged commit c572982 into main Jul 31, 2026
203 of 212 checks passed
@steipete
steipete deleted the codex/qa300-portable-presentation-fallback branch July 31, 2026 19:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
…16990)

* fix(channels): preserve actionable presentation fallbacks

* test(interactive): isolate presentation fallback regression coverage

---------

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

Labels

channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant