Merge branch 'openclaw:main' into main
This commit is contained in:
commit
9e63027e47
4
.github/workflows/install-smoke.yml
vendored
4
.github/workflows/install-smoke.yml
vendored
@ -32,8 +32,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Run installer docker tests
|
- name: Run installer docker tests
|
||||||
env:
|
env:
|
||||||
CLAWDBOT_INSTALL_URL: https://clawd.bot/install.sh
|
CLAWDBOT_INSTALL_URL: https://openclaw.ai/install.sh
|
||||||
CLAWDBOT_INSTALL_CLI_URL: https://clawd.bot/install-cli.sh
|
CLAWDBOT_INSTALL_CLI_URL: https://openclaw.ai/install-cli.sh
|
||||||
CLAWDBOT_NO_ONBOARD: "1"
|
CLAWDBOT_NO_ONBOARD: "1"
|
||||||
CLAWDBOT_INSTALL_SMOKE_SKIP_CLI: "1"
|
CLAWDBOT_INSTALL_SMOKE_SKIP_CLI: "1"
|
||||||
CLAWDBOT_INSTALL_SMOKE_SKIP_NONROOT: ${{ github.event_name == 'pull_request' && '1' || '0' }}
|
CLAWDBOT_INSTALL_SMOKE_SKIP_NONROOT: ${{ github.event_name == 'pull_request' && '1' || '0' }}
|
||||||
|
|||||||
@ -42,6 +42,7 @@ Status: stable.
|
|||||||
- Routing: precompile session key regexes. (#1697) Thanks @Ray0907.
|
- Routing: precompile session key regexes. (#1697) Thanks @Ray0907.
|
||||||
- CLI: use Node's module compile cache for faster startup. (#2808) Thanks @pi0.
|
- CLI: use Node's module compile cache for faster startup. (#2808) Thanks @pi0.
|
||||||
- Auth: show copyable Google auth URL after ASCII prompt. (#1787) Thanks @robbyczgw-cla.
|
- Auth: show copyable Google auth URL after ASCII prompt. (#1787) Thanks @robbyczgw-cla.
|
||||||
|
- Agents: add Kimi K2.5 to the synthetic model catalog. (#4407) Thanks @manikv12.
|
||||||
- TUI: avoid width overflow when rendering selection lists. (#1686) Thanks @mossein.
|
- TUI: avoid width overflow when rendering selection lists. (#1686) Thanks @mossein.
|
||||||
- macOS: finish OpenClaw app rename for macOS sources, bundle identifiers, and shared kit paths. (#2844) Thanks @fal3.
|
- macOS: finish OpenClaw app rename for macOS sources, bundle identifiers, and shared kit paths. (#2844) Thanks @fal3.
|
||||||
- Branding: update launchd labels, mobile bundle IDs, and logging subsystems to bot.molt (legacy com.clawdbot migrations). Thanks @thewilloftheshadow.
|
- Branding: update launchd labels, mobile bundle IDs, and logging subsystems to bot.molt (legacy com.clawdbot migrations). Thanks @thewilloftheshadow.
|
||||||
@ -72,6 +73,7 @@ Status: stable.
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Telegram: avoid silent empty replies by tracking normalization skips before fallback. (#3796)
|
- Telegram: avoid silent empty replies by tracking normalization skips before fallback. (#3796)
|
||||||
|
- Telegram: scope native skill commands to bound agent per bot. (#4360) Thanks @robhparker.
|
||||||
- Mentions: honor mentionPatterns even when explicit mentions are present. (#3303) Thanks @HirokiKobayashi-R.
|
- Mentions: honor mentionPatterns even when explicit mentions are present. (#3303) Thanks @HirokiKobayashi-R.
|
||||||
- Discord: restore username directory lookup in target resolution. (#3131) Thanks @bonald.
|
- Discord: restore username directory lookup in target resolution. (#3131) Thanks @bonald.
|
||||||
- Agents: align MiniMax base URL test expectation with default provider config. (#3131) Thanks @bonald.
|
- Agents: align MiniMax base URL test expectation with default provider config. (#3131) Thanks @bonald.
|
||||||
|
|||||||
@ -99,6 +99,14 @@ export const SYNTHETIC_MODEL_CATALOG = [
|
|||||||
contextWindow: 256000,
|
contextWindow: 256000,
|
||||||
maxTokens: 8192,
|
maxTokens: 8192,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "hf:moonshotai/Kimi-K2.5",
|
||||||
|
name: "Kimi K2.5",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text"],
|
||||||
|
contextWindow: 256000,
|
||||||
|
maxTokens: 8192,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "hf:openai/gpt-oss-120b",
|
id: "hf:openai/gpt-oss-120b",
|
||||||
name: "GPT OSS 120B",
|
name: "GPT OSS 120B",
|
||||||
|
|||||||
@ -64,12 +64,12 @@ export function randomToken(): string {
|
|||||||
|
|
||||||
export function printWizardHeader(runtime: RuntimeEnv) {
|
export function printWizardHeader(runtime: RuntimeEnv) {
|
||||||
const header = [
|
const header = [
|
||||||
"▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄",
|
"▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄",
|
||||||
"██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██",
|
"██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██",
|
||||||
"██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██",
|
"██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██",
|
||||||
"██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██",
|
"██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██",
|
||||||
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀",
|
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀",
|
||||||
" 🦞 OPENCLAW 🦞 ",
|
" 🦞 OPENCLAW 🦞 ",
|
||||||
" ",
|
" ",
|
||||||
].join("\n");
|
].join("\n");
|
||||||
runtime.log(header);
|
runtime.log(header);
|
||||||
|
|||||||
@ -48,8 +48,12 @@ describe("state + config path candidates", () => {
|
|||||||
it("orders default config candidates in a stable order", () => {
|
it("orders default config candidates in a stable order", () => {
|
||||||
const home = "/home/test";
|
const home = "/home/test";
|
||||||
const candidates = resolveDefaultConfigCandidates({} as NodeJS.ProcessEnv, () => home);
|
const candidates = resolveDefaultConfigCandidates({} as NodeJS.ProcessEnv, () => home);
|
||||||
expect(candidates[0]).toBe(path.join(home, ".openclaw", "openclaw.json"));
|
const expectedDirs = [".openclaw", ".clawdbot", ".moltbot", ".moldbot"];
|
||||||
expect(candidates).toHaveLength(1);
|
const expectedFiles = ["openclaw.json", "clawdbot.json", "moltbot.json", "moldbot.json"];
|
||||||
|
const expected = expectedDirs.flatMap((dir) =>
|
||||||
|
expectedFiles.map((file) => path.join(home, dir, file)),
|
||||||
|
);
|
||||||
|
expect(candidates).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("prefers ~/.openclaw when it exists and legacy dir is missing", async () => {
|
it("prefers ~/.openclaw when it exists and legacy dir is missing", async () => {
|
||||||
|
|||||||
82
src/telegram/bot-native-commands.test.ts
Normal file
82
src/telegram/bot-native-commands.test.ts
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
|
import type { OpenClawConfig } from "../config/config.js";
|
||||||
|
import type { TelegramAccountConfig } from "../config/types.js";
|
||||||
|
import type { RuntimeEnv } from "../runtime.js";
|
||||||
|
import { registerTelegramNativeCommands } from "./bot-native-commands.js";
|
||||||
|
|
||||||
|
const { listSkillCommandsForAgents } = vi.hoisted(() => ({
|
||||||
|
listSkillCommandsForAgents: vi.fn(() => []),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("../auto-reply/skill-commands.js", () => ({
|
||||||
|
listSkillCommandsForAgents,
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe("registerTelegramNativeCommands", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
listSkillCommandsForAgents.mockReset();
|
||||||
|
});
|
||||||
|
|
||||||
|
const buildParams = (cfg: OpenClawConfig, accountId = "default") => ({
|
||||||
|
bot: {
|
||||||
|
api: {
|
||||||
|
setMyCommands: vi.fn().mockResolvedValue(undefined),
|
||||||
|
sendMessage: vi.fn().mockResolvedValue(undefined),
|
||||||
|
},
|
||||||
|
command: vi.fn(),
|
||||||
|
} as unknown as Parameters<typeof registerTelegramNativeCommands>[0]["bot"],
|
||||||
|
cfg,
|
||||||
|
runtime: {} as RuntimeEnv,
|
||||||
|
accountId,
|
||||||
|
telegramCfg: {} as TelegramAccountConfig,
|
||||||
|
allowFrom: [],
|
||||||
|
groupAllowFrom: [],
|
||||||
|
replyToMode: "off" as const,
|
||||||
|
textLimit: 4096,
|
||||||
|
useAccessGroups: false,
|
||||||
|
nativeEnabled: true,
|
||||||
|
nativeSkillsEnabled: true,
|
||||||
|
nativeDisabledExplicit: false,
|
||||||
|
resolveGroupPolicy: () => ({ allowlistEnabled: false, allowed: true }),
|
||||||
|
resolveTelegramGroupConfig: () => ({
|
||||||
|
groupConfig: undefined,
|
||||||
|
topicConfig: undefined,
|
||||||
|
}),
|
||||||
|
shouldSkipUpdate: () => false,
|
||||||
|
opts: { token: "token" },
|
||||||
|
});
|
||||||
|
|
||||||
|
it("scopes skill commands when account binding exists", () => {
|
||||||
|
const cfg: OpenClawConfig = {
|
||||||
|
agents: {
|
||||||
|
list: [{ id: "main", default: true }, { id: "butler" }],
|
||||||
|
},
|
||||||
|
bindings: [
|
||||||
|
{
|
||||||
|
agentId: "butler",
|
||||||
|
match: { channel: "telegram", accountId: "bot-a" },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
registerTelegramNativeCommands(buildParams(cfg, "bot-a"));
|
||||||
|
|
||||||
|
expect(listSkillCommandsForAgents).toHaveBeenCalledWith({
|
||||||
|
cfg,
|
||||||
|
agentIds: ["butler"],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("keeps skill commands unscoped without a matching binding", () => {
|
||||||
|
const cfg: OpenClawConfig = {
|
||||||
|
agents: {
|
||||||
|
list: [{ id: "main", default: true }, { id: "butler" }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
registerTelegramNativeCommands(buildParams(cfg, "bot-a"));
|
||||||
|
|
||||||
|
expect(listSkillCommandsForAgents).toHaveBeenCalledWith({ cfg });
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -257,8 +257,16 @@ export const registerTelegramNativeCommands = ({
|
|||||||
shouldSkipUpdate,
|
shouldSkipUpdate,
|
||||||
opts,
|
opts,
|
||||||
}: RegisterTelegramNativeCommandsParams) => {
|
}: RegisterTelegramNativeCommandsParams) => {
|
||||||
|
const boundRoute =
|
||||||
|
nativeEnabled && nativeSkillsEnabled
|
||||||
|
? resolveAgentRoute({ cfg, channel: "telegram", accountId })
|
||||||
|
: null;
|
||||||
|
const boundAgentIds =
|
||||||
|
boundRoute && boundRoute.matchedBy.startsWith("binding.") ? [boundRoute.agentId] : null;
|
||||||
const skillCommands =
|
const skillCommands =
|
||||||
nativeEnabled && nativeSkillsEnabled ? listSkillCommandsForAgents({ cfg }) : [];
|
nativeEnabled && nativeSkillsEnabled
|
||||||
|
? listSkillCommandsForAgents(boundAgentIds ? { cfg, agentIds: boundAgentIds } : { cfg })
|
||||||
|
: [];
|
||||||
const nativeCommands = nativeEnabled
|
const nativeCommands = nativeEnabled
|
||||||
? listNativeCommandSpecsForConfig(cfg, { skillCommands, provider: "telegram" })
|
? listNativeCommandSpecsForConfig(cfg, { skillCommands, provider: "telegram" })
|
||||||
: [];
|
: [];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user