Skip to content

[codex] LINE: avoid runtime lookup during onboarding#49960

Merged
darkamenosa merged 1 commit intomainfrom
fix/line-quickstart-runtime
Mar 18, 2026
Merged

[codex] LINE: avoid runtime lookup during onboarding#49960
darkamenosa merged 1 commit intomainfrom
fix/line-quickstart-runtime

Conversation

@darkamenosa
Copy link
Copy Markdown
Member

Summary

  • Problem: QuickStart onboarding could crash after the channel primer with LINE runtime not initialized - plugin not registered when rendering the channel picker.
  • Why it matters: pnpm openclaw onboard --install-daemon could fail before the operator selected any channel, blocking a common first-run path.
  • What changed: the LINE config adapter now resolves account state through runtime-neutral LINE account helpers instead of the plugin runtime store, and a regression test covers rendering the QuickStart picker without a LINE runtime.
  • What did NOT change (scope boundary): this does not change LINE runtime behavior after startup, credential resolution semantics, network calls, daemon install behavior, or channel setup flows beyond removing the premature runtime dependency.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • None

User-visible / Behavior Changes

QuickStart onboarding no longer requires the LINE plugin runtime to be initialized just to render Select channel (QuickStart). Users hitting pnpm openclaw onboard --install-daemon should now reach the channel picker instead of failing immediately after the channel primer.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local Node/pnpm dev CLI run
  • Model/provider: N/A
  • Integration/channel (if any): LINE onboarding surface
  • Relevant config (redacted): empty/default local config

Steps

  1. Run pnpm openclaw onboard --install-daemon.
  2. Accept the security prompt and stay on QuickStart.
  3. Wait for onboarding to render the channel picker after the How channels work note.

Expected

  • QuickStart reaches Select channel (QuickStart) without crashing.

Actual

  • Before this change, onboarding could throw LINE runtime not initialized - plugin not registered while building the QuickStart picker.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What I personally verified (not just CI), and how:

  • Verified scenarios: ran pnpm test -- src/commands/onboard-channels.e2e.test.ts and confirmed the full file passes, including the new regression that renders QuickStart and skips from the picker.
  • Edge cases checked: empty config, QuickStart skip path, existing onboarding channel tests in the same file.
  • What you did not verify: I did not complete a full end-to-end manual onboarding after the fix.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No
  • If yes, exact upgrade steps:

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: revert commit 013ecde2b1401b6da19cf77047ac43e5dda7e483.
  • Files/config to restore: extensions/line/src/config-adapter.ts, src/commands/onboard-channels.e2e.test.ts.
  • Known bad symptoms reviewers should watch for: LINE setup/account resolution regressing in onboarding or the QuickStart picker failing to render.

Risks and Mitigations

  • Risk: LINE config adapter now depends on the runtime-neutral account helpers rather than the runtime store, so any mismatch between those code paths could surface in setup/config views.
  • Mitigation: the adapter now matches the same pure-account pattern used by the other channel plugins, and onboarding coverage now exercises the QuickStart path directly.

@openclaw-barnacle openclaw-barnacle bot added channel: line Channel integration: line commands Command implementations size: XS maintainer Maintainer-authored PR labels Mar 18, 2026
@darkamenosa darkamenosa marked this pull request as ready for review March 18, 2026 18:21
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR fixes a crash during pnpm openclaw onboard --install-daemon where the QuickStart channel picker would throw LINE runtime not initialized - plugin not registered before the user had a chance to select any channel. The fix replaces the runtime-store-dependent calls in extensions/line/src/config-adapter.ts with direct imports of the runtime-neutral helper functions (listLineAccountIds, resolveDefaultLineAccountId, resolveLineAccount) from ../runtime-api.js, which re-exports from openclaw/plugin-sdk/line-core. A regression test is added to onboard-channels.e2e.test.ts that asserts the QuickStart picker renders and returns cleanly when __skip__ is chosen, without requiring the LINE plugin runtime to be registered.

Key changes:

  • extensions/line/src/config-adapter.ts: Drops the getLineRuntime() wrapper in favour of direct imports of the three pure-ish account helpers; the resolveAccount bridge correctly preserves the accountId ?? undefined null-coalescing behaviour from the old resolveLineRuntimeAccount helper.
  • src/commands/onboard-channels.e2e.test.ts: New "renders the QuickStart channel picker without requiring the LINE runtime" test that exercises the __skip__ path on an empty config and asserts no unexpected prompts fire.

Confidence Score: 4/5

  • Safe to merge — targeted, well-scoped bug fix with a regression test covering the reported crash path.
  • The change is small and focused: two files touched, no API/contract changes, and the new code follows the exact same pattern already used by other channel plugins. The direct account helpers (listLineAccountIds, resolveDefaultLineAccountId, resolveLineAccount) are the same underlying functions the old runtime-delegated calls resolved to, so behaviour parity for an already-initialised runtime is maintained. A regression test covers the specific crash scenario. The one point held back is that the PR author explicitly noted they did not complete a full end-to-end manual onboarding run post-fix, so live credential-resolution paths (file I/O in resolveLineAccount) remain untested by the new coverage.
  • No files require special attention.

Last reviewed commit: "LINE: avoid runtime ..."

@darkamenosa darkamenosa merged commit 4b5487e into main Mar 18, 2026
37 of 47 checks passed
@darkamenosa darkamenosa deleted the fix/line-quickstart-runtime branch March 18, 2026 18:27
livingghost pushed a commit to livingghost/openclaw that referenced this pull request Mar 18, 2026
livingghost pushed a commit to livingghost/openclaw that referenced this pull request Mar 18, 2026
livingghost pushed a commit to livingghost/openclaw that referenced this pull request Mar 18, 2026
brandontyler pushed a commit to brandontyler/clawdbot that referenced this pull request Mar 19, 2026
udftd pushed a commit to udftd/openclaw that referenced this pull request Mar 20, 2026
fuller-stack-dev pushed a commit to fuller-stack-dev/openclaw that referenced this pull request Mar 20, 2026
fuller-stack-dev pushed a commit to fuller-stack-dev/openclaw that referenced this pull request Mar 20, 2026
pholpaphankorn pushed a commit to pholpaphankorn/openclaw that referenced this pull request Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: line Channel integration: line commands Command implementations maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant