mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:40:43 +00:00
fix(cli): avoid model warmup for message actions (#76312)
Summary: - The PR skips eager context-window warmup for `openclaw message`, forwards Discord/Telegram execution-mode de ... reuses caller-owned manifest metadata during config materialization, and adds tests plus a changelog entry. - Reproducibility: yes. Source inspection on current main shows `openclaw message` is still eligible for eager context-window warmup and the Discord/Telegram wrappers still drop the gateway execution-mode declarations. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: type message action routing fallbacks - PR branch already contained follow-up commit before automerge: docs: credit message latency fix contributor Validation: - ClawSweeper review passed for head9606bb27d5. - Required merge gates passed before the squash merge. Prepared head SHA:9606bb27d5Review: https://github.com/openclaw/openclaw/pull/76312#issuecomment-4364958708 Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
This commit is contained in:
@@ -119,6 +119,18 @@ describe("discordPlugin outbound", () => {
|
||||
expect(discordPlugin.outbound?.preferFinalAssistantVisibleText).toBe(true);
|
||||
});
|
||||
|
||||
it("routes read and search actions through the gateway", () => {
|
||||
expect(discordPlugin.actions?.resolveExecutionMode?.({ action: "read" as never })).toBe(
|
||||
"gateway",
|
||||
);
|
||||
expect(discordPlugin.actions?.resolveExecutionMode?.({ action: "search" as never })).toBe(
|
||||
"gateway",
|
||||
);
|
||||
expect(discordPlugin.actions?.resolveExecutionMode?.({ action: "send" as never })).toBe(
|
||||
"local",
|
||||
);
|
||||
});
|
||||
|
||||
it("adds Discord mention formatting to agent prompt hints", () => {
|
||||
const hints = discordPlugin.agentPrompt?.messageToolHints?.({} as never) ?? [];
|
||||
|
||||
|
||||
@@ -100,6 +100,12 @@ function resolveRuntimeDiscordMessageActions() {
|
||||
}
|
||||
|
||||
const discordMessageActions = {
|
||||
resolveExecutionMode: (
|
||||
ctx: Parameters<NonNullable<ChannelMessageActionAdapter["resolveExecutionMode"]>>[0],
|
||||
) =>
|
||||
resolveRuntimeDiscordMessageActions()?.resolveExecutionMode?.(ctx) ??
|
||||
discordMessageActionsImpl.resolveExecutionMode?.(ctx) ??
|
||||
"local",
|
||||
describeMessageTool: (
|
||||
ctx: Parameters<NonNullable<ChannelMessageActionAdapter["describeMessageTool"]>>[0],
|
||||
): ChannelMessageToolDiscovery | null =>
|
||||
|
||||
@@ -81,6 +81,15 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("telegramPlugin gateway startup", () => {
|
||||
it("routes message actions through the gateway", () => {
|
||||
expect(telegramPlugin.actions?.resolveExecutionMode?.({ action: "send" as never })).toBe(
|
||||
"gateway",
|
||||
);
|
||||
expect(telegramPlugin.actions?.resolveExecutionMode?.({ action: "read" as never })).toBe(
|
||||
"gateway",
|
||||
);
|
||||
});
|
||||
|
||||
it("stops before monitor startup when getMe rejects the token", async () => {
|
||||
installTelegramRuntime();
|
||||
probeTelegram.mockResolvedValue({
|
||||
|
||||
@@ -220,6 +220,10 @@ async function sendTelegramOutbound(params: {
|
||||
}
|
||||
|
||||
const telegramMessageActions: ChannelMessageActionAdapter = {
|
||||
resolveExecutionMode: (ctx) =>
|
||||
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.resolveExecutionMode?.(ctx) ??
|
||||
telegramMessageActionsImpl.resolveExecutionMode?.(ctx) ??
|
||||
"gateway",
|
||||
describeMessageTool: (ctx) =>
|
||||
getOptionalTelegramRuntime()?.channel?.telegram?.messageActions?.describeMessageTool?.(ctx) ??
|
||||
telegramMessageActionsImpl.describeMessageTool?.(ctx) ??
|
||||
|
||||
Reference in New Issue
Block a user