Skip to content

fix(line): offer the card command only on LINE - #132895

Merged
steipete merged 4 commits into
openclaw:mainfrom
edenfunf:fix/line-card-command-channel-scope
Aug 30, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
edenfunf:fix/line-card-command-channel-scope

Conversation

@edenfunf

@edenfunf edenfunf commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The LINE plugin registered /card without a channel scope, so Telegram, Discord, and Slack offered a LINE-only command. Invoking it outside LINE echoed the arguments rather than rendering a card. On Discord it also occupied a native-command slot.

Why This Change Was Made

Declare channels: ["line"] at the bundled entry, which owns the command registration. Core's existing catalog, matcher, and execution gates already enforce this field.

The maintainer refinement removes the duplicate registration owner. The entry now lazy-loads handleLineCardCommand(args) directly instead of constructing a fake API to capture a second registration. The runtime module only renders cards. The shared metadata file, capture loader, and unsupported-channel echo are deleted; authentication and argument handling stay the same. The private registration function had no published SDK/API contract, and all internal tests now use the current handler.

Production: +140/-176 (net -36); tests: +70/-70 (net 0); docs: +2/-1. Much of the production churn is deindentation. Thanks @edenfunf for the original fix, reproduction, and real LINE evidence; the fixup preserves the original PR ancestry and co-author credit.

User Impact

/card is offered only on LINE, where it renders the same cards. Other channels no longer list it; an unsupported-channel /card message follows normal agent handling instead of receiving the old text echo. The slash-command guide states the LINE-only scope. No new configuration or migration is needed.

Evidence

Independent maintainer validation on a fresh, secretless AWS Crabbox proved the registration test fails against pre-fix production for the missing channels field. With the complete rewritten candidate, 767 tests passed: 697 LINE tests and 70 core command tests. The new registration test also exercises the real lazy handler; existing blank-argument, escaping, message-card, and HTTP-client tests remain covered.

Commands:

node scripts/run-vitest.mjs extensions/line/card-command-registration.test.ts -t 'offers the command on LINE only'
node scripts/run-vitest.mjs extensions/line src/plugins/commands.test.ts src/plugins/plugin-command-runtime.test.ts
node scripts/check-changed.mjs --base 65beb1e9b1124d1a0f1302fa880bc028d74586cb -- extensions/line/index.ts extensions/line/src/card-command.ts extensions/line/card-command-registration.test.ts extensions/line/src/card-command.blank-arguments.test.ts extensions/line/src/card-command.escapes.test.ts extensions/line/src/message-cards.test.ts docs/tools/slash-commands.md
pnpm build

The first command is the expected-failing baseline run; the remaining commands validate the candidate. Fresh Codex autoreview completed with no accepted/actionable P0 findings; manual source review also covered the entry, renderer, core catalog/matcher/execution gates, lazy-runtime owner, and Reef's corresponding single-registration pattern.

Contributor-provided authenticated evidence, retained from the original PR: an isolated Gateway A/B removed /card from Telegram's commands.list, and a real LINE /card info "Live proof" "channel scope" webhook returned the expected Flex card. The original LINE listing used the default native-command scope and was empty; a positive text-command listing must request scope: "text". This session does not claim a new authenticated LINE delivery.

The unscoped command is present in stable v2026.7.1-2 and current main. The original cross-channel echo traces to c96ffa7186a; the duplicated eager registration was added in cddb34ba6a3, verified against raw parents. Keeping another shared descriptor was rejected in favor of one registration owner. Fresh ClawSweeper review on the final head found no blocking correctness or security issue and endorsed the single registration owner. Its upgrade concern is accepted as the documented correction to LINE-only scope.

Independent final built-runtime proof on published commit a1995467007d0232dd825c0016a96ecc6c7a04bc passed in secretless Crabbox run run_e1871334e4bc: full build, healthy real Gateway, and commands.list with scope: "text" returned /card once for LINE and zero times for Telegram and Discord. The built plugin entry's real lazy handler returned a Flex bubble with alt text Welcome: Scope smoke. The LINE import profile also passed (135.8 MiB peak RSS), and the checkout remained unchanged. Synthetic local configuration was used with transport startup disabled; this is Gateway RPC and built-plugin proof, not a new authenticated channel delivery.

Current-head CI passed, and native review-artifact validation plus hosted prepare gates passed on the exact published head.

@clawsweeper

clawsweeper Bot commented Aug 29, 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: line Channel integration: line size: S labels Aug 29, 2026
@edenfunf
edenfunf marked this pull request as ready for review August 29, 2026 23:00
@clawsweeper clawsweeper Bot added 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: 🐚 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 Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:09 PM ET / 21:09 UTC.

ClawSweeper review

What this changes

This PR scopes the LINE rich-card /card command to LINE, simplifies its lazy card renderer, adds regression coverage, and documents the channel-only command.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The final head is a clean owner-boundary fix: LINE declares the command scope at registration, and existing core catalog, matcher, and execution gates enforce it. The intentionally removed cross-channel text echo remains a compatibility-visible behavior change, but the maintainer discussion explicitly accepts it; await the remaining exact-head CI gate before landing.

Priority: P2
Reviewed head: a1995467007d0232dd825c0016a96ecc6c7a04bc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation is focused, reduces production code, and has strong exact-head runtime evidence; the accepted compatibility change remains the main merge consideration.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The changed production owner is the LINE entry registration. Supplied exact-head Crabbox evidence exercised the built Gateway command catalog and built lazy handler, observing one LINE listing, no Telegram or Discord listings, and a Flex reply; earlier authenticated LINE webhook evidence covers delivery.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The changed production owner is the LINE entry registration. Supplied exact-head Crabbox evidence exercised the built Gateway command catalog and built lazy handler, observing one LINE listing, no Telegram or Discord listings, and a Flex reply; earlier authenticated LINE webhook evidence covers delivery.
Evidence reviewed 7 items Registration owner: The final LINE entry registers /card with channels: ["line"] and invokes only the lazy card renderer.
Core enforcement: Current main filters channel-scoped commands for native listings, text matching, and direct execution, so an unsupported channel cannot reach the LINE handler.
Regression coverage: The added test exercises the bundled entry in its production registration mode and asserts both LINE-only metadata and its lazy renderer result.
Findings None None.
Security None None.

How this fits together

The LINE plugin registers chat commands with OpenClaw’s shared command catalog. The catalog uses channel metadata to list and route commands, while the LINE handler builds the channel-specific rich-card reply.

flowchart LR
  A[Chat command catalog] --> B[LINE plugin registration]
  B --> C{Channel is LINE}
  C -->|Yes| D[Lazy card renderer]
  C -->|No| E[Normal agent handling]
  D --> F[LINE rich-card reply]
Loading

Before merge

  • Resolve merge risk (P1) - Merging intentionally replaces the previously unscoped non-LINE /card text echo with normal agent handling; users relying on that undocumented behavior will observe a changed outcome.
  • Complete next step (P2) - No introduced defect needs an automated repair; this PR awaits normal exact-head CI and maintainer landing review.
Agent review details

Security

None.

PR surface

Source -36, Tests 0, Docs +1. Total -35 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 140 176 -36
Tests 4 70 70 0
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 212 247 -35

Review metrics

Metric Value Why it matters
Production versus test delta production -36; tests net 0; docs +1 The bug fix removes the captured registration adapter while adding one focused registration test, so production complexity decreases.

Merge-risk options

Maintainer options:

  1. Accept the scoped-command behavior (recommended)
    Land the LINE-only registration and accepted removal of the undocumented non-LINE echo after the exact-head checks finish green.

Technical review

Best possible solution:

Keep command ownership in the LINE entry, rely on the shared channel gates, and land the accepted compatibility change once exact-head CI is green.

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

Yes. Current main and the latest stable release register /card without a channel scope, while the shared command contract demonstrably filters a command once channels: ["line"] is supplied.

Is this the best way to solve the issue?

Yes. Registration is the owner of command visibility, and the existing core catalog, matcher, and executor already enforce channel scope; retaining a handler-level non-LINE fallback would leave the command incorrectly advertised.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The PR fixes an existing cross-channel command-routing defect with limited blast radius.
  • merge-risk: 🚨 compatibility: Existing non-LINE /card invocations stop receiving the prior fallback echo and instead continue through normal agent handling.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The changed production owner is the LINE entry registration. Supplied exact-head Crabbox evidence exercised the built Gateway command catalog and built lazy handler, observing one LINE listing, no Telegram or Discord listings, and a Flex reply; earlier authenticated LINE webhook evidence covers delivery.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the LINE entry registration. Supplied exact-head Crabbox evidence exercised the built Gateway command catalog and built lazy handler, observing one LINE listing, no Telegram or Discord listings, and a Flex reply; earlier authenticated LINE webhook evidence covers delivery.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The PR changes whether Telegram users can see and invoke /card, which is observable in a Telegram Test Server command flow.

Evidence

What I checked:

  • Registration owner: The final LINE entry registers /card with channels: ["line"] and invokes only the lazy card renderer. (extensions/line/index.ts:21, a1995467007d)
  • Core enforcement: Current main filters channel-scoped commands for native listings, text matching, and direct execution, so an unsupported channel cannot reach the LINE handler. (src/plugins/plugin-command-metadata.ts:17, 416057e4fdee)
  • Regression coverage: The added test exercises the bundled entry in its production registration mode and asserts both LINE-only metadata and its lazy renderer result. (extensions/line/card-command-registration.test.ts:25, a1995467007d)
  • Existing shared contract: Current core tests already prove scoped commands are absent from unsupported text and native-command surfaces. (src/plugins/commands.test.ts:669, 416057e4fdee)
  • Shipped behavior: The latest stable release still registers /card without channel metadata, confirming the reported cross-channel availability exists in shipped behavior. (extensions/line/index.ts:43, 0790d9f593ad)
  • Real behavior proof: The supplied exact-head Crabbox result reports a healthy built Gateway with /card once for LINE and zero times for Telegram and Discord, plus a successful built lazy-handler Flex reply. The contributor’s earlier authenticated LINE webhook proof covers delivery; the final refactor preserves the handler behavior. (a1995467007d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • plum-dawg: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Wait for the remaining exact-head CI check to complete successfully.

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 (3 earlier review cycles)
  • reviewed 2026-08-29T23:08:20.097Z sha 901e8edb2b8c4bc7c8d7c56b63f4c1f0b30c2e57 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T05:00:50.976Z sha 6973849 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T20:57:37.706Z sha a199546 :: needs maintainer review before merge. :: none

@edenfunf
edenfunf force-pushed the fix/line-card-command-channel-scope branch from 901e8ed to 6973849 Compare August 30, 2026 04:52
@clawsweeper clawsweeper Bot added the proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. label Aug 30, 2026
@steipete steipete self-assigned this Aug 30, 2026
Load only the card handler at runtime, removing duplicate metadata and the captured registration API. Retain LINE-only command scope and cover the real lazy handler.

Co-authored-by: xuyuanhao <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

I refined this into one eager command registration and one lazy renderer, preserving the contributor's ancestry and co-author credit. The metadata module, fake registration API, and unsupported-channel echo are gone; the complete change now removes 36 production lines. The registration regression fails on pre-fix production, 767 candidate tests pass, changed-file checks and the full build pass, and fresh Codex autoreview is clean at P0. The PR body now describes the final implementation and evidence limits.

The built-Gateway smoke and new-head CI are in progress. @clawsweeper re-review

@steipete

Copy link
Copy Markdown
Contributor

Final runtime proof passed on a1995467007d0232dd825c0016a96ecc6c7a04bc (Crabbox run_e1871334e4bc). The rebuilt real Gateway became healthy and returned these commands.list results with text scope:

Channel /card entries
LINE 1
Telegram 0
Discord 0

The built entry's real lazy handler returned the expected Flex bubble, the LINE import profile passed, and the source tree stayed unchanged. This used synthetic local configuration with transport startup disabled; the contributor's authenticated LINE delivery remains separately attributed in the body. Earlier independent proof passed the expected-failing baseline regression, 767 candidate tests, changed-file checks, and full build.

The old review's substantive upgrade concern is explicitly accepted: unsupported-channel /card now follows normal agent handling instead of echoing its arguments. No storage or embedding change exists in this diff; the malformed serialized review fragments are skipped as non-source findings. The requested fresh review is running. Exact-head CI has one check remaining before native landing.

@steipete
steipete merged commit 796f893 into openclaw:main Aug 30, 2026
201 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit to shojikumaru/openclaw that referenced this pull request Aug 30, 2026
…cked-delivery

* origin/main: (261 commits)
  fix(clawdock): keep credentials out of diagnostic output (openclaw#133547)
  refactor(ui): avoid redundant presence work in avatar lists (openclaw#133548)
  fix(agents): recognize internal requester completion replies (openclaw#133543)
  fix: prevent duplicate queued user messages in chat clients (openclaw#133542)
  chore(ui): refresh control ui locales (openclaw#133544)
  fix(beam): restart delivery when the receiver changes (openclaw#133533)
  fix(models): recover /models browse from a replaced prepared catalog (openclaw#133221)
  perf(terminal): reuse control scans and remove repeated sanitization work (openclaw#133527)
  perf(agents): prepare only consumed tool and skill diagnostics (openclaw#133512)
  fix(line): offer the card command only on LINE (openclaw#132895)
  fix: keep Android publication independent of core release (openclaw#133471)
  refactor(agents): simplify compaction accounting (openclaw#133521)
  refactor(plugins): simplify registration lifecycle policy (openclaw#133364)
  perf(plugins): avoid eager loader imports for active registry reads (openclaw#133518)
  refactor(ui): consolidate chat rendering ownership (openclaw#133508)
  test(auto-reply): prepare memory flush model capabilities (openclaw#133532)
  fix(ui): replace startup hourglasses with capacity-aware rings (openclaw#133470)
  fix(talk): preserve provider conversation order in browser transcripts (openclaw#133493)
  fix(ui): deduplicate participant and viewer avatars (openclaw#133519)
  feat(ui): add CRT terminal theme (openclaw#133495)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
* fix(line): offer the card command only on LINE

* docs: list the card command as LINE-only

* fix(line): keep the card metadata off the entry's static src imports

* refactor(line): keep card registration in the plugin entry

Load only the card handler at runtime, removing duplicate metadata and the captured registration API. Retain LINE-only command scope and cover the real lazy handler.

Co-authored-by: xuyuanhao <[email protected]>

---------

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

Labels

channel: line Channel integration: line docs Improvements or additions to documentation 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. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

2 participants