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