mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 15:30:39 +00:00
fix: add object capabilities coverage (#1071) (thanks @danielz1z)
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
|
||||
### Fixes
|
||||
- Sub-agents: normalize announce delivery origin + queue bucketing by accountId to keep multi-account routing stable. (#1061, #1058) — thanks @adam91holt.
|
||||
- Config: handle object-format Telegram capabilities in channel capability resolution. (#1071) — thanks @danielz1z.
|
||||
- Sessions: include deliveryContext in sessions.list and reuse normalized delivery routing for announce/restart fallbacks. (#1058)
|
||||
- Sessions: propagate deliveryContext into last-route updates to keep account/channel routing stable. (#1058)
|
||||
- Gateway: honor explicit delivery targets without implicit accountId fallback; preserve lastAccountId for implicit routing.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const DSR_PATTERN = /\x1b\[\??6n/g;
|
||||
const ESC = String.fromCharCode(0x1b);
|
||||
const DSR_PATTERN = new RegExp(`${ESC}\\[\\??6n`, "g");
|
||||
|
||||
export function stripDsrRequests(input: string): { cleaned: string; requests: number } {
|
||||
let requests = 0;
|
||||
|
||||
@@ -679,15 +679,15 @@ export function registerHooksCli(program: Command): void {
|
||||
for (const hookId of targets) {
|
||||
const record = installs[hookId];
|
||||
if (!record) {
|
||||
defaultRuntime.log(chalk.yellow(`No install record for \"${hookId}\".`));
|
||||
defaultRuntime.log(chalk.yellow(`No install record for "${hookId}".`));
|
||||
continue;
|
||||
}
|
||||
if (record.source !== "npm") {
|
||||
defaultRuntime.log(chalk.yellow(`Skipping \"${hookId}\" (source: ${record.source}).`));
|
||||
defaultRuntime.log(chalk.yellow(`Skipping "${hookId}" (source: ${record.source}).`));
|
||||
continue;
|
||||
}
|
||||
if (!record.spec) {
|
||||
defaultRuntime.log(chalk.yellow(`Skipping \"${hookId}\" (missing npm spec).`));
|
||||
defaultRuntime.log(chalk.yellow(`Skipping "${hookId}" (missing npm spec).`));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,29 @@ describe("resolveChannelCapabilities", () => {
|
||||
}),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("falls back to channel capabilities when account capabilities use object format", () => {
|
||||
const cfg = {
|
||||
channels: {
|
||||
telegram: {
|
||||
capabilities: ["inlineButtons"],
|
||||
accounts: {
|
||||
default: {
|
||||
capabilities: { inlineButtons: "dm" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} satisfies Partial<ClawdbotConfig>;
|
||||
|
||||
expect(
|
||||
resolveChannelCapabilities({
|
||||
cfg: cfg as ClawdbotConfig,
|
||||
channel: "telegram",
|
||||
accountId: "default",
|
||||
}),
|
||||
).toEqual(["inlineButtons"]);
|
||||
});
|
||||
});
|
||||
|
||||
const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({
|
||||
|
||||
Reference in New Issue
Block a user