fix(channel): include accountId in describeAccount snapshot

ChannelAccountSnapshot from openclaw plugin-sdk requires accountId
(everything else is optional). Returning bare { configured: boolean }
satisfies neither tsc -p tsconfig.json strict checks nor the runtime
contract — the snapshot fed into channelManager.getRuntimeSnapshot() is
keyed by accountId, so an unkeyed entry is dropped before
applyDescribedAccountFields ever sees the configured flag the original
PR #10 was trying to surface.

Pre-existing bug (introduced together with describeAccount in #10) that
was masked because tsc invoked without -p falls back to Node10 module
resolution, which doesn't read openclaw's package.json exports map, so
plugin-sdk/core resolves to nothing, so ChannelAccountSnapshot ends up
unknown, so { configured: boolean } passes. Tripped now because
install.mjs's build step uses `tsc -p tsconfig.json` (NodeNext) and
properly resolves the SDK types — exposes the missing accountId.

Trivial fix: pull accountId off the same ResolvedFabricAccount that
already carries it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
h z
2026-05-28 21:03:47 +01:00
parent 7f96fffca9
commit 152b465e64

View File

@@ -164,6 +164,7 @@ export const fabricChannelPlugin = createChatChannelPlugin<ResolvedFabricAccount
// Mirror isConfigured here so the snapshot truthfully reports false for // Mirror isConfigured here so the snapshot truthfully reports false for
// any account without a fabricApiKey. // any account without a fabricApiKey.
describeAccount: (account: ResolvedFabricAccount) => ({ describeAccount: (account: ResolvedFabricAccount) => ({
accountId: account.accountId,
configured: Boolean(account.fabricApiKey), configured: Boolean(account.fabricApiKey),
}), }),
}, },