mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 11:24:47 +00:00
fix(config): treat enabled channels as configured
This commit is contained in:
@@ -32,6 +32,7 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
### Fixes
|
||||
|
||||
- Channels/config: treat channel entries with only `enabled: true` as configured state so plugin-backed channels can auto-enable from an explicit on switch. Fixes #81323. (#81331) Thanks @EvanYao826 and @vincentkoc.
|
||||
- CLI/update: add an update finalization path for externally swapped core runtimes, running update-time doctor repair and plugin convergence from post-doctor config and install-record state before reporting completion. Thanks @shakkernerd.
|
||||
- Agents/WebChat: stop a successful assistant turn whose stale `errorMessage` matches a billing, auth, or rate-limit pattern from rotating profiles, falling back, or surfacing a hard `FailoverError` unless the current attempt has a real failover failure. (#70900) Thanks @truffle-dev.
|
||||
- Control UI/logs: make the Gateway Logs stream height responsive to the viewport with a minimum height floor, so larger screens can show substantially more log lines without collapsing on shorter viewports. (#53916) Thanks @extrasmall0.
|
||||
|
||||
@@ -15,7 +15,11 @@ export function hasMeaningfulChannelConfigShallow(value: unknown): boolean {
|
||||
if (!isRecord(value)) {
|
||||
return false;
|
||||
}
|
||||
return Object.keys(value).some((key) => key !== "enabled");
|
||||
const keys = Object.keys(value);
|
||||
if (keys.length === 1 && keys[0] === "enabled") {
|
||||
return value.enabled === true;
|
||||
}
|
||||
return keys.some((key) => key !== "enabled");
|
||||
}
|
||||
|
||||
export function isStaticallyChannelConfigured(
|
||||
|
||||
@@ -44,6 +44,38 @@ describe("isChannelConfigured", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("treats explicit enabled channel config as configured state", () => {
|
||||
expect(
|
||||
isChannelConfigured(
|
||||
{
|
||||
channels: {
|
||||
"openclaw-weixin": {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
"openclaw-weixin",
|
||||
{},
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("does not treat disabled channel config as configured state", () => {
|
||||
expect(
|
||||
isChannelConfigured(
|
||||
{
|
||||
channels: {
|
||||
"openclaw-weixin": {
|
||||
enabled: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
"openclaw-weixin",
|
||||
{},
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("does not treat persisted Matrix credentials as configured channel state", () => {
|
||||
expect(
|
||||
isChannelConfigured({}, "matrix", { OPENCLAW_STATE_DIR: "state-with-matrix-creds" }),
|
||||
|
||||
Reference in New Issue
Block a user