Merge pull request 'fix(channel): add describeAccount so health-monitor sees real configured state' (#10) from fix/describe-account-stops-default-restart-loop into main
This commit was merged in pull request #10.
This commit is contained in:
13
dist/fabric/src/channel.js
vendored
13
dist/fabric/src/channel.js
vendored
@@ -117,6 +117,19 @@ export const fabricChannelPlugin = createChatChannelPlugin({
|
|||||||
resolveAccount: (cfg, accountId) => resolveFabricAccount(cfg, accountId),
|
resolveAccount: (cfg, accountId) => resolveFabricAccount(cfg, accountId),
|
||||||
defaultAccountId: (cfg) => resolveDefaultFabricAccountId(cfg),
|
defaultAccountId: (cfg) => resolveDefaultFabricAccountId(cfg),
|
||||||
isConfigured: (account) => Boolean(account.fabricApiKey),
|
isConfigured: (account) => Boolean(account.fabricApiKey),
|
||||||
|
// openclaw's channelManager.getRuntimeSnapshot() — called every minute
|
||||||
|
// by the channel-health-monitor — defaults `configured: true` when the
|
||||||
|
// plugin doesn't expose describeAccount (see applyDescribedAccountFields
|
||||||
|
// in server-channels). Without this, fabric's synthetic 'default'
|
||||||
|
// account (returned by listFabricAccountIds when channels.fabric.accounts
|
||||||
|
// is empty — the prod shape) gets snapshot {enabled:true, configured:true,
|
||||||
|
// running:false} → isManagedAccount=true → not-running → restart loop
|
||||||
|
// every ~10 min, logging `[fabric:default] health-monitor: restarting`.
|
||||||
|
// Mirror isConfigured here so the snapshot truthfully reports false for
|
||||||
|
// any account without a fabricApiKey.
|
||||||
|
describeAccount: (account) => ({
|
||||||
|
configured: Boolean(account.fabricApiKey),
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
// Minimal setup adapter: Fabric is configured directly under
|
// Minimal setup adapter: Fabric is configured directly under
|
||||||
// channels.fabric.* (no interactive wizard). applyAccountConfig is the
|
// channels.fabric.* (no interactive wizard). applyAccountConfig is the
|
||||||
|
|||||||
@@ -153,6 +153,19 @@ export const fabricChannelPlugin = createChatChannelPlugin<ResolvedFabricAccount
|
|||||||
resolveAccount: (cfg, accountId) => resolveFabricAccount(cfg as never, accountId),
|
resolveAccount: (cfg, accountId) => resolveFabricAccount(cfg as never, accountId),
|
||||||
defaultAccountId: (cfg) => resolveDefaultFabricAccountId(cfg as never),
|
defaultAccountId: (cfg) => resolveDefaultFabricAccountId(cfg as never),
|
||||||
isConfigured: (account: ResolvedFabricAccount) => Boolean(account.fabricApiKey),
|
isConfigured: (account: ResolvedFabricAccount) => Boolean(account.fabricApiKey),
|
||||||
|
// openclaw's channelManager.getRuntimeSnapshot() — called every minute
|
||||||
|
// by the channel-health-monitor — defaults `configured: true` when the
|
||||||
|
// plugin doesn't expose describeAccount (see applyDescribedAccountFields
|
||||||
|
// in server-channels). Without this, fabric's synthetic 'default'
|
||||||
|
// account (returned by listFabricAccountIds when channels.fabric.accounts
|
||||||
|
// is empty — the prod shape) gets snapshot {enabled:true, configured:true,
|
||||||
|
// running:false} → isManagedAccount=true → not-running → restart loop
|
||||||
|
// every ~10 min, logging `[fabric:default] health-monitor: restarting`.
|
||||||
|
// Mirror isConfigured here so the snapshot truthfully reports false for
|
||||||
|
// any account without a fabricApiKey.
|
||||||
|
describeAccount: (account: ResolvedFabricAccount) => ({
|
||||||
|
configured: Boolean(account.fabricApiKey),
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
// Minimal setup adapter: Fabric is configured directly under
|
// Minimal setup adapter: Fabric is configured directly under
|
||||||
// channels.fabric.* (no interactive wizard). applyAccountConfig is the
|
// channels.fabric.* (no interactive wizard). applyAccountConfig is the
|
||||||
|
|||||||
Reference in New Issue
Block a user