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 head 9606bb27d5.
- Required merge gates passed before the squash merge.

Prepared head SHA: 9606bb27d5
Review: 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:
Jason
2026-05-02 19:26:00 -06:00
committed by GitHub
parent 13dc14d43e
commit 53bd718a1a
15 changed files with 170 additions and 22 deletions

View File

@@ -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) ?? [];

View File

@@ -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 =>

View File

@@ -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({

View File

@@ -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) ??