feat(acp): enable dispatch by default

This commit is contained in:
Peter Steinberger
2026-03-03 00:47:25 +00:00
parent 6649c22471
commit 36dfd462a8
5 changed files with 9 additions and 6 deletions

View File

@@ -11,11 +11,11 @@ import {
} from "./policy.js";
describe("acp policy", () => {
it("treats ACP as enabled by default", () => {
it("treats ACP + ACP dispatch as enabled by default", () => {
const cfg = {} satisfies OpenClawConfig;
expect(isAcpEnabledByPolicy(cfg)).toBe(true);
expect(isAcpDispatchEnabledByPolicy(cfg)).toBe(false);
expect(resolveAcpDispatchPolicyState(cfg)).toBe("dispatch_disabled");
expect(isAcpDispatchEnabledByPolicy(cfg)).toBe(true);
expect(resolveAcpDispatchPolicyState(cfg)).toBe("enabled");
});
it("reports ACP disabled state when acp.enabled is false", () => {

View File

@@ -16,7 +16,8 @@ export function resolveAcpDispatchPolicyState(cfg: OpenClawConfig): AcpDispatchP
if (!isAcpEnabledByPolicy(cfg)) {
return "acp_disabled";
}
if (cfg.acp?.dispatch?.enabled !== true) {
// ACP dispatch is enabled unless explicitly disabled.
if (cfg.acp?.dispatch?.enabled === false) {
return "dispatch_disabled";
}
return "enabled";