Skip to content

fix(feishu): preserve commands in select fallback cards - #130515

Merged
steipete merged 1 commit into
mainfrom
codex/qa-feishu-select-fallback-20260826
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-feishu-select-fallback-20260826

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #130514

What Problem This Solves

Fixes an issue where users receiving Feishu select fallback cards would see option labels without the copyable command when a presentation was sent through native send or thread-reply actions.

Why This Change Was Made

Feishu kept its own label-only select fallback after the shared presentation formatter learned to preserve explicitly typed commands. Reuse that existing block formatter at the native card owner, retaining Feishu's Markdown escaping. This deletes duplicate rendering logic and corrects the stale select-fallback documentation.

Production LOC: +3/−4 (net −1). Tests: +40/−31 (net +9). Docs: +2/−2. No new configuration, protocol, SDK surface, dependency, persistence, or native select capability.

User Impact

Select fallback cards now retain the command beside its label so recipients can copy it. Callback data and legacy values remain hidden, including opaque values beginning with /. Heading and label escaping remains intact. This is a current-main behavior repair, not a claim of a stable-release regression.

Evidence

AI-assisted; fresh Codex P0–P2 review completed with no actionable findings. Independent source review confirmed the Gateway dispatch reaches the native Feishu action without generic fallback adaptation.

  • Before production edits, the native send/thread-reply regression cases both failed solely because /status was missing from the card.
  • Focused owner/sibling proof: 389 tests passed (344 Feishu, 45 shared payload).
  • Full changed-file gate passed: formatting, lint, extension and extension-test typechecks, dead-export scans, plugin boundaries, applicable guards, five doctor-contract tests, and import-cycle checks.
  • Actual built Gateway, authenticated WebSocket message.action, real Feishu plugin and Lark SDK 1.73.0, with provider HTTP redirected to a local loopback service. Initial send and thread-reply both emitted the expected interactive card.
  • Independent source-blind validation: five clauses passed, seven fresh cards and seven distinct successful receipts across four sends and three thread replies. Cases varied the command, labels, heading, opaque values, and opaque-only options.
{"verdict":"pass","transport":"authenticated built Gateway + real Feishu SDK + mock provider HTTP","sourceBlind":true,"passedClauses":5,"failedClauses":0,"freshCards":7,"uniqueReceipts":7,"sends":4,"threadReplies":3}

Commands:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/feishu/src/channel.test.ts -t 'preserves select commands'
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/feishu/src/channel.test.ts extensions/feishu/src/presentation-card.test.ts extensions/feishu/src/outbound.test.ts src/interactive/payload.test.ts
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/check-changed.mjs -- extensions/feishu/src/presentation-card.ts extensions/feishu/src/channel.test.ts docs/plugins/message-presentation.md
git diff --check

Proof limits: no live Feishu UI/SaaS delivery, command execution, or callback execution is claimed. An initial harness activation failure was corrected only in the fixture: channel-skipping flags intentionally remove channel configuration, so the proof instead started the real Feishu webhook listener on an isolated port with synthetic credentials. No product workaround was added.

Separate source-only follow-up hypotheses were recorded for disabled native buttons and mixed callback-only button rows; neither is established or fixed by this select repair. Existing table, card envelope, outbound, and document-comment behavior remains covered by the passing sibling suites.

@clawsweeper

clawsweeper Bot commented Aug 27, 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 docs Improvements or additions to documentation channel: feishu Channel integration: feishu size: S maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete marked this pull request as ready for review August 27, 2026 00:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 8:14 PM ET / August 27, 2026, 00:14 UTC.

ClawSweeper review

What this changes

The PR routes Feishu select-card fallback text through the shared presentation formatter so typed commands remain copyable while callback and legacy values stay hidden.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: this maintainer-controlled PR correctly repairs the current-main Feishu card fallback and has no actionable review finding; exact-head checks are still running.

Priority: P2
Reviewed head: 4d42938671dac2209cecf89c8ca4af1d30ee8030

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-boundary repair with strong stated after-fix evidence, net-negative production code, and no supported correctness or security concern.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: Real-behavior proof is not a contributor gate for this repository-member PR; its body nevertheless records an authenticated built-Gateway, real-plugin, and real-SDK after-fix trace.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real-behavior proof is not a contributor gate for this repository-member PR; its body nevertheless records an authenticated built-Gateway, real-plugin, and real-SDK after-fix trace.
Evidence reviewed 7 items Current-main defect: The current Feishu select renderer constructs fallback lines from labels alone, so a typed command never reaches the card text.
Canonical fallback contract: The shared formatter renders command actions as copyable backticked text and returns labels for callback and legacy values; its select branch applies that rule to every option.
Both native action paths: Both send and thread-reply resolve a presentation and pass it to the same Feishu card builder, so the owner-boundary change covers both paths.
Findings None None.
Security None None.

Live Verification

Command: OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/feishu/src/channel.test.ts -t 'preserves select commands'

Result: PASS (completed)

[test] starting test/vitest/vitest.extension-feishu.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130515-iXbDSm/target

 ✓  extension-feishu  extensions/feishu/src/channel.test.ts (206 tests | 204 skipped) 15ms

 Test Files  1 passed (1)
      Tests  2 passed | 204 skipped (206)
   Start at  00:15:14
   Duration  28.69s (transform 23.72s, setup 71ms, import 28.23s, tests 15ms, environment 0ms)

[test] passed 1 Vitest shard in 34.99s
[test] starting test/vitest/vitest.extension-feishu.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130515-iXbDSm/target

 ✓  extension-feishu  extensions/feishu/src/channel.test.ts (206 tests | 204 skipped) 15ms

 Test Files  1 passed (1)
      Tests  2 passed | 204 skipped (206)
   Start at  00:15:50
   Duration  11.71s (transform 7.35s, setup 33ms, import 11.42s, tests 15ms, environment 0ms)

[test] passed 1 Vitest shard in 17.81s

Assertions:

  • NOT OBSERVED expect_output: preserves select commands in the send card fallback without exposing callback values — command exited successfully; expected output was not observed in the captured pane

How this fits together

Gateway message actions enter the Feishu plugin as portable presentation blocks, which the plugin turns into interactive cards for send and thread-reply. Select blocks cannot become native controls here, so their safe text fallback is delivered inside the card.

flowchart LR
A[Gateway message action] --> B[Feishu plugin action]
B --> C[Presentation card renderer]
C --> D[Select fallback]
D --> E[Shared safe formatter]
E --> F[Escaped Feishu card]
F --> G[Recipient]
Loading

Before merge

  • Complete next step (P2) - No repair is needed; retain maintainer-controlled review until the in-progress exact-head checks finish.
Agent review details

Security

None.

PR surface

Source -1, Tests +9, Docs 0. Total +8 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 4 -1
Tests 1 40 31 +9
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 45 37 +8

Review metrics

Metric Value Why it matters
Production versus test delta production −1 net (3 added, 4 removed); tests +9 net (40 added, 31 removed); docs 0 net The bug fix removes duplicated renderer policy while adding coverage for both native action paths and opaque-value redaction.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #130514
Summary: This PR is the candidate repair for the linked Feishu select-fallback bug and directly covers its two reported action paths.

Members:

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

Technical review

Best possible solution:

Land the net-negative Feishu renderer repair after exact-head checks complete, keeping the shared formatter as the sole policy for command visibility and opaque-value redaction.

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

Yes—current source exposes the label-only branch, and the focused test reaches it through both native send and thread-reply actions; this read-only review did not execute the test.

Is this the best way to solve the issue?

Yes—the shared formatter already owns the typed-command versus opaque-value policy, so reusing it at the Feishu card owner removes the divergent local implementation without widening any API.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a bounded Feishu fallback-card usability defect without message loss, security impact, or runtime unavailability.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real-behavior proof is not a contributor gate for this repository-member PR; its body nevertheless records an authenticated built-Gateway, real-plugin, and real-SDK after-fix trace.

Label justifications:

  • P2: This repairs a bounded Feishu fallback-card usability defect without message loss, security impact, or runtime unavailability.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real-behavior proof is not a contributor gate for this repository-member PR; its body nevertheless records an authenticated built-Gateway, real-plugin, and real-SDK after-fix trace.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Blame attributes both the pre-fix label-only select branch and the shared fallback contract to the introduction commit. (role: presentation and Feishu-card feature introducer; confidence: high; commits: 3fa31a7b2d46; files: extensions/feishu/src/presentation-card.ts, src/interactive/payload.ts)
  • Peter Steinberger: Recent current-main work refined the shared presentation fallback path that this PR correctly reuses. (role: recent shared-fallback contributor; confidence: high; commits: c385cdc8f15f; files: src/interactive/payload.ts)

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification for head 4d42938671dac2209cecf89c8ca4af1d30ee8030:

The native select renderer now reuses the canonical command-visible/opaque-hidden fallback formatter and keeps Feishu escaping. Production delta is −1 line; tests are +9; the documentation contradiction is corrected. Current main still contains the old label-only select branch; recent sticker and text-continuation changes do not alter this repair.

Exact-head CI run 33025767842 completed successfully. The latest ClawSweeper review reports no actionable finding; its sole before-merge step was waiting for these checks, now complete. Fresh independent Codex review is clean. Native review artifacts and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 130515 passed without changing the head.

Observed proof: two native send/thread-reply regressions failed before source edits, then 389 owner/sibling tests and the full changed-file gate passed. The actual authenticated built Gateway and real Lark SDK emitted correct cards to loopback HTTP; independent source-blind verification passed five clauses with seven fresh cards and seven unique receipts. No live Feishu SaaS/UI or command/callback execution is claimed.

Local commands:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/feishu/src/channel.test.ts -t 'preserves select commands'
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/feishu/src/channel.test.ts extensions/feishu/src/presentation-card.test.ts extensions/feishu/src/outbound.test.ts src/interactive/payload.test.ts
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/check-changed.mjs -- extensions/feishu/src/presentation-card.ts extensions/feishu/src/channel.test.ts docs/plugins/message-presentation.md
git diff --check

Disabled native buttons and mixed callback-only button rows remain separate source-only follow-up hypotheses, not fixes claimed by this PR.

@steipete
steipete merged commit 42112dd into main Aug 27, 2026
207 checks passed
@steipete
steipete deleted the codex/qa-feishu-select-fallback-20260826 branch August 27, 2026 00:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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]: Feishu select fallback cards omit typed commands

1 participant