Repository navigation
fix(line): offer the card command only on LINE - #132895
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:09 PM ET / 21:09 UTC. ClawSweeper reviewWhat this changesThis PR scopes the LINE rich-card Merge readinessThe 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 Review scores
Verification
How this fits togetherThe 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -36, Tests 0, Docs +1. Total -35 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
901e8ed to
6973849
Compare
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]>
|
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 |
|
Final runtime proof passed on
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 |
|
Merged via squash.
|
…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) ...
* 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]>
What Problem This Solves
The LINE plugin registered
/cardwithout 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
/cardis offered only on LINE, where it renders the same cards. Other channels no longer list it; an unsupported-channel/cardmessage 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
channelsfield. 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 buildThe 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
/cardfrom Telegram'scommands.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 requestscope: "text". This session does not claim a new authenticated LINE delivery.The unscoped command is present in stable
v2026.7.1-2and current main. The original cross-channel echo traces toc96ffa7186a; the duplicated eager registration was added incddb34ba6a3, 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
a1995467007d0232dd825c0016a96ecc6c7a04bcpassed in secretless Crabbox runrun_e1871334e4bc: full build, healthy real Gateway, andcommands.listwithscope: "text"returned/cardonce for LINE and zero times for Telegram and Discord. The built plugin entry's real lazy handler returned a Flex bubble with alt textWelcome: 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.