← Back to PRs

#11110: fix(line): false 'not configured' warnings when tokenSource=file

by lailoo open 2026-02-07 12:14 View on GitHub →
channel: line stale
## Summary Fixes #11094. `collectStatusIssues` in the LINE channel plugin checked `account.channelAccessToken` and `account.channelSecret` on `ChannelAccountSnapshot`, but those properties do not exist on the snapshot type. When credentials are loaded from files (`tokenSource: "file"`), the resolved account has the token but the snapshot only carries a `configured` boolean — so the check always evaluated to `undefined`, producing false warnings. ## Root Cause `collectStatusIssues` receives `ChannelAccountSnapshot[]` (not `ResolvedLineAccount[]`). The snapshot type has `configured`, `tokenSource`, `running`, etc. but **not** `channelAccessToken` or `channelSecret`. The existing code accessed non-existent properties, which always returned `undefined`, causing warnings regardless of actual credential state. ## Fix Replace the `account.channelAccessToken?.trim()` / `account.channelSecret?.trim()` checks with `account.configured`, matching the pattern already used by feishu, tlon, and other channel plugins. ## Changes - `extensions/line/src/channel.ts`: use `account.configured` in `collectStatusIssues` - `extensions/line/src/channel.collectStatusIssues.test.ts`: regression tests covering config, file, none token sources - `CHANGELOG.md`: add entry ## Testing - `pnpm build` ✅ - `pnpm test` ✅ (all 5028 tests pass; 14 pre-existing feishu failures unrelated) - New test file covers: configured via config, configured via file, not configured, undefined configured, multiple accounts <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR fixes LINE `status`/`doctor` reporting by updating `linePlugin.status.collectStatusIssues` to use the snapshot’s `configured` flag rather than reading credential fields that aren’t present on `ChannelAccountSnapshot`. It also adds a vitest regression suite for `collectStatusIssues` covering configured vs not configured (including credentials loaded from files) and updates the changelog to document the behavior change. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - The change is narrowly scoped to status/doctor issue collection for LINE, replacing access to non-existent snapshot fields with the snapshot’s `configured` flag. The update matches the existing snapshot-building logic in the plugin, and the new tests cover the previously-broken file-based credential scenario plus a few edge cases. - No files require special attention <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs