Merge pull request #4651 from yuting0624/fix/status-command-line-crash

fix(line): resolve TypeError in status command when LINE is enabled
This commit is contained in:
Shakker 2026-01-30 15:41:40 +00:00 committed by GitHub
commit 09be5d45d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import {
LineConfigSchema,
processLineMessage,
type ChannelPlugin,
type ChannelStatusIssue,
type OpenClawConfig,
type LineConfig,
type LineChannelData,
@ -560,20 +561,27 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
lastStopAt: null,
lastError: null,
},
collectStatusIssues: ({ account }) => {
const issues: Array<{ level: "error" | "warning"; message: string }> = [];
collectStatusIssues: (accounts) => {
const issues: ChannelStatusIssue[] = [];
for (const account of accounts) {
const accountId = account.accountId ?? DEFAULT_ACCOUNT_ID;
if (!account.channelAccessToken?.trim()) {
issues.push({
level: "error",
channel: "line",
accountId,
kind: "config",
message: "LINE channel access token not configured",
});
}
if (!account.channelSecret?.trim()) {
issues.push({
level: "error",
channel: "line",
accountId,
kind: "config",
message: "LINE channel secret not configured",
});
}
}
return issues;
},
buildChannelSummary: ({ snapshot }) => ({