mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 11:07:41 +00:00
feat(acp): enable dispatch by default
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user