mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 19:54:32 +00:00
feat(onboarding)!: default tools profile to messaging
This commit is contained in:
@@ -40,6 +40,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
### Breaking
|
### Breaking
|
||||||
|
|
||||||
- **BREAKING:** Zalo Personal plugin (`@openclaw/zalouser`) no longer depends on external `zca`-compatible CLI binaries (`openzca`, `zca-cli`) for runtime send/listen/login; operators should use `openclaw channels login --channel zalouser` after upgrade to refresh sessions in the new JS-native path.
|
- **BREAKING:** Zalo Personal plugin (`@openclaw/zalouser`) no longer depends on external `zca`-compatible CLI binaries (`openzca`, `zca-cli`) for runtime send/listen/login; operators should use `openclaw channels login --channel zalouser` after upgrade to refresh sessions in the new JS-native path.
|
||||||
|
- **BREAKING:** Onboarding now defaults `tools.profile` to `messaging` for new local installs (interactive + non-interactive). New setups no longer start with broad coding/system tools unless explicitly configured.
|
||||||
- **BREAKING:** Node exec approval payloads now require `systemRunPlan`. `host=node` approval requests without that plan are rejected.
|
- **BREAKING:** Node exec approval payloads now require `systemRunPlan`. `host=node` approval requests without that plan are rejected.
|
||||||
- **BREAKING:** Node `system.run` execution now pins path-token commands to the canonical executable path (`realpath`) in both allowlist and approval execution flows. Integrations/tests that asserted token-form argv (for example `tr`) must now accept canonical paths (for example `/usr/bin/tr`).
|
- **BREAKING:** Node `system.run` execution now pins path-token commands to the canonical executable path (`realpath`) in both allowlist and approval execution flows. Integrations/tests that asserted token-form argv (for example `tr`) must now accept canonical paths (for example `/usr/bin/tr`).
|
||||||
- **BREAKING:** Plugin SDK removed `api.registerHttpHandler(...)`. Plugins must register explicit HTTP routes via `api.registerHttpRoute({ path, auth, match, handler })`, and dynamic webhook lifecycles should use `registerPluginHttpRoute(...)`.
|
- **BREAKING:** Plugin SDK removed `api.registerHttpHandler(...)`. Plugins must register explicit HTTP routes via `api.registerHttpRoute({ path, auth, match, handler })`, and dynamic webhook lifecycles should use `registerPluginHttpRoute(...)`.
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { OpenClawConfig } from "../config/config.js";
|
|||||||
import {
|
import {
|
||||||
applyOnboardingLocalWorkspaceConfig,
|
applyOnboardingLocalWorkspaceConfig,
|
||||||
ONBOARDING_DEFAULT_DM_SCOPE,
|
ONBOARDING_DEFAULT_DM_SCOPE,
|
||||||
|
ONBOARDING_DEFAULT_TOOLS_PROFILE,
|
||||||
} from "./onboard-config.js";
|
} from "./onboard-config.js";
|
||||||
|
|
||||||
describe("applyOnboardingLocalWorkspaceConfig", () => {
|
describe("applyOnboardingLocalWorkspaceConfig", () => {
|
||||||
@@ -13,6 +14,7 @@ describe("applyOnboardingLocalWorkspaceConfig", () => {
|
|||||||
expect(result.session?.dmScope).toBe(ONBOARDING_DEFAULT_DM_SCOPE);
|
expect(result.session?.dmScope).toBe(ONBOARDING_DEFAULT_DM_SCOPE);
|
||||||
expect(result.gateway?.mode).toBe("local");
|
expect(result.gateway?.mode).toBe("local");
|
||||||
expect(result.agents?.defaults?.workspace).toBe("/tmp/workspace");
|
expect(result.agents?.defaults?.workspace).toBe("/tmp/workspace");
|
||||||
|
expect(result.tools?.profile).toBe(ONBOARDING_DEFAULT_TOOLS_PROFILE);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("preserves existing dmScope when already configured", () => {
|
it("preserves existing dmScope when already configured", () => {
|
||||||
@@ -36,4 +38,15 @@ describe("applyOnboardingLocalWorkspaceConfig", () => {
|
|||||||
|
|
||||||
expect(result.session?.dmScope).toBe("per-account-channel-peer");
|
expect(result.session?.dmScope).toBe("per-account-channel-peer");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("preserves an explicit tools.profile when already configured", () => {
|
||||||
|
const baseConfig: OpenClawConfig = {
|
||||||
|
tools: {
|
||||||
|
profile: "full",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const result = applyOnboardingLocalWorkspaceConfig(baseConfig, "/tmp/workspace");
|
||||||
|
|
||||||
|
expect(result.tools?.profile).toBe("full");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import type { OpenClawConfig } from "../config/config.js";
|
import type { OpenClawConfig } from "../config/config.js";
|
||||||
import type { DmScope } from "../config/types.base.js";
|
import type { DmScope } from "../config/types.base.js";
|
||||||
|
import type { ToolProfileId } from "../config/types.tools.js";
|
||||||
|
|
||||||
export const ONBOARDING_DEFAULT_DM_SCOPE: DmScope = "per-channel-peer";
|
export const ONBOARDING_DEFAULT_DM_SCOPE: DmScope = "per-channel-peer";
|
||||||
|
export const ONBOARDING_DEFAULT_TOOLS_PROFILE: ToolProfileId = "messaging";
|
||||||
|
|
||||||
export function applyOnboardingLocalWorkspaceConfig(
|
export function applyOnboardingLocalWorkspaceConfig(
|
||||||
baseConfig: OpenClawConfig,
|
baseConfig: OpenClawConfig,
|
||||||
@@ -24,5 +26,9 @@ export function applyOnboardingLocalWorkspaceConfig(
|
|||||||
...baseConfig.session,
|
...baseConfig.session,
|
||||||
dmScope: baseConfig.session?.dmScope ?? ONBOARDING_DEFAULT_DM_SCOPE,
|
dmScope: baseConfig.session?.dmScope ?? ONBOARDING_DEFAULT_DM_SCOPE,
|
||||||
},
|
},
|
||||||
|
tools: {
|
||||||
|
...baseConfig.tools,
|
||||||
|
profile: baseConfig.tools?.profile ?? ONBOARDING_DEFAULT_TOOLS_PROFILE,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,9 +141,11 @@ describe("onboard (non-interactive): gateway and remote auth", () => {
|
|||||||
const cfg = await readJsonFile<{
|
const cfg = await readJsonFile<{
|
||||||
gateway?: { auth?: { mode?: string; token?: string } };
|
gateway?: { auth?: { mode?: string; token?: string } };
|
||||||
agents?: { defaults?: { workspace?: string } };
|
agents?: { defaults?: { workspace?: string } };
|
||||||
|
tools?: { profile?: string };
|
||||||
}>(configPath);
|
}>(configPath);
|
||||||
|
|
||||||
expect(cfg?.agents?.defaults?.workspace).toBe(workspace);
|
expect(cfg?.agents?.defaults?.workspace).toBe(workspace);
|
||||||
|
expect(cfg?.tools?.profile).toBe("messaging");
|
||||||
expect(cfg?.gateway?.auth?.mode).toBe("token");
|
expect(cfg?.gateway?.auth?.mode).toBe("token");
|
||||||
expect(cfg?.gateway?.auth?.token).toBe(token);
|
expect(cfg?.gateway?.auth?.token).toBe(token);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user