惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 聂微东
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
美团技术团队
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
小众软件
小众软件

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: report model run fallback metadata · openclaw/opencl...
steipete · 2026-05-02 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -49,6 +49,7 @@ Docs: https://docs.openclaw.ai

4949

- Web search: keep public provider requests on the strict SSRF guard and reserve private-network access for explicit self-hosted SearXNG/Firecrawl endpoints. Fixes #74357 and supersedes #74360. Thanks @fede-kamel.

5050

- Firecrawl: reject private, loopback, metadata, and non-HTTP(S) `firecrawl_scrape` target URLs before forwarding them to Firecrawl. Supersedes #48133. Thanks @kn1ghtc.

5151

- Web search/Firecrawl: allow self-hosted private/internal Firecrawl `baseUrl` endpoints, including HTTP for private targets, while keeping hosted Firecrawl on the strict official endpoint. Fixes #63877 and supersedes #59666, #63941, and #74013. Thanks @jhthompson12, @jzakirov, @Mlightsnow, and @shad0wca7.

52+

- CLI/models: report gateway model fallback attempts in `infer model run --json` and avoid double-prefixing provider-qualified defaults such as `openrouter/auto` in `models status`. Partially fixes #69527. Thanks @alexifra.

5253

- Providers/OpenRouter: strip trailing assistant prefill turns from verified OpenRouter Anthropic model requests when reasoning is enabled, so Claude 4.6 routes no longer fail with Anthropic's prefill rejection through the OpenAI-compatible adapter. Fixes #75395. Thanks @sbmilburn.

5354

- Feishu: preserve Feishu/Lark HTTP error bodies for message sends, media sends, and chat member lookups, so HTTP 400 failures include vendor code, message, log id, and troubleshooter details. Fixes #73860. Thanks @desksk.

5455

- Agents/transcripts: avoid reopening large Pi transcript files through the synchronous session manager for maintenance rewrites, persisted tool-result truncation, manual compaction boundary hardening, and queued compaction rotation. Thanks @mariozechner.

Original file line numberDiff line numberDiff line change

@@ -864,6 +864,7 @@ describe("agentCommand – LiveSessionModelSwitchError retry", () => {

864864

{

865865

provider: params.provider,

866866

model: params.model,

867+

error: "empty result",

867868

reason: "format",

868869

code: "empty_result",

869870

},

@@ -886,6 +887,21 @@ describe("agentCommand – LiveSessionModelSwitchError retry", () => {

886887

modelOverride: "gpt-5.4",

887888

isFallbackRetry: true,

888889

});

890+

expect(state.deliverAgentCommandResultMock.mock.calls[0]?.[0]).toMatchObject({

891+

result: {

892+

meta: {

893+

agentMeta: {

894+

fallbackAttempts: [

895+

expect.objectContaining({

896+

provider: "anthropic",

897+

model: "claude",

898+

reason: "format",

899+

}),

900+

],

901+

},

902+

},

903+

},

904+

});

889905

});

890906
891907

it("updates hasSessionModelOverride for fallback resolution after switch", async () => {

Original file line numberDiff line numberDiff line change

@@ -1028,6 +1028,18 @@ async function agentCommandInternal(

10281028

result = fallbackResult.result;

10291029

fallbackProvider = fallbackResult.provider;

10301030

fallbackModel = fallbackResult.model;

1031+

if (fallbackResult.attempts.length > 0 && result.meta.agentMeta) {

1032+

result = {

1033+

...result,

1034+

meta: {

1035+

...result.meta,

1036+

agentMeta: {

1037+

...result.meta.agentMeta,

1038+

fallbackAttempts: fallbackResult.attempts,

1039+

},

1040+

},

1041+

};

1042+

}

10311043

if (!lifecycleEnded) {

10321044

const stopReason = result.meta.stopReason;

10331045

if (stopReason && stopReason !== "end_turn") {

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

import type { HeartbeatToolResponse } from "../../auto-reply/heartbeat-tool-response.js";

22

import type { CliSessionBinding, SessionSystemPromptReport } from "../../config/sessions/types.js";

33

import type { DiagnosticTraceContext } from "../../infra/diagnostic-trace-context.js";

4+

import type { FallbackAttempt } from "../model-fallback.types.js";

45

import type { MessagingToolSend } from "../pi-embedded-messaging.types.js";

56
67

export type EmbeddedPiAgentMeta = {

@@ -10,6 +11,7 @@ export type EmbeddedPiAgentMeta = {

1011

model: string;

1112

contextTokens?: number;

1213

agentHarnessId?: string;

14+

fallbackAttempts?: FallbackAttempt[];

1315

cliSessionBinding?: CliSessionBinding;

1416

compactionCount?: number;

1517

/**

Original file line numberDiff line numberDiff line change

@@ -585,6 +585,47 @@ describe("capability cli", () => {

585585

);

586586

});

587587
588+

it("surfaces gateway model fallback attempts in model probe JSON", async () => {

589+

mocks.callGateway.mockResolvedValueOnce({

590+

result: {

591+

payloads: [{ text: "gateway fallback reply" }],

592+

meta: {

593+

agentMeta: {

594+

provider: "openai",

595+

model: "gpt-4.1-mini",

596+

fallbackAttempts: [

597+

{

598+

provider: "openrouter",

599+

model: "openrouter/auto",

600+

error: "model unavailable",

601+

reason: "model_not_found",

602+

},

603+

],

604+

},

605+

},

606+

},

607+

} as never);

608+
609+

await runRegisteredCli({

610+

register: registerCapabilityCli as (program: Command) => void,

611+

argv: ["capability", "model", "run", "--prompt", "hello", "--gateway", "--json"],

612+

});

613+
614+

expect(mocks.runtime.writeJson).toHaveBeenCalledWith(

615+

expect.objectContaining({

616+

provider: "openai",

617+

model: "gpt-4.1-mini",

618+

attempts: [

619+

expect.objectContaining({

620+

provider: "openrouter",

621+

model: "openrouter/auto",

622+

reason: "model_not_found",

623+

}),

624+

],

625+

}),

626+

);

627+

});

628+
588629

it("requests admin scope for gateway model probes with provider/model overrides", async () => {

589630

await runRegisteredCli({

590631

register: registerCapabilityCli as (program: Command) => void,

Original file line numberDiff line numberDiff line change

@@ -711,7 +711,13 @@ async function runModelRun(params: {

711711

const response: {

712712

result?: {

713713

payloads?: Array<{ text?: string; mediaUrl?: string | null; mediaUrls?: string[] }>;

714-

meta?: { agentMeta?: { provider?: string; model?: string } };

714+

meta?: {

715+

agentMeta?: {

716+

provider?: string;

717+

model?: string;

718+

fallbackAttempts?: Array<Record<string, unknown>>;

719+

};

720+

};

715721

};

716722

} = await callGateway({

717723

method: "agent",

@@ -746,7 +752,7 @@ async function runModelRun(params: {

746752

transport: "gateway" as const,

747753

provider: response?.result?.meta?.agentMeta?.provider,

748754

model: response?.result?.meta?.agentMeta?.model,

749-

attempts: [],

755+

attempts: response?.result?.meta?.agentMeta?.fallbackAttempts ?? [],

750756

outputs: (response?.result?.payloads ?? []).map((payload) => ({

751757

text: payload.text,

752758

mediaUrl: payload.mediaUrl,

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,7 @@ import { resolveEnvApiKey } from "../../agents/model-auth.js";

2525

import {

2626

buildModelAliasIndex,

2727

isCliProvider,

28+

modelKey,

2829

normalizeProviderId,

2930

parseModelRef,

3031

resolveConfiguredModelRef,

@@ -202,7 +203,7 @@ export async function modelsStatusCommand(

202203
203204

const rawDefaultsModel = resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model) ?? "";

204205

const rawModel = agentModelPrimary ?? rawDefaultsModel;

205-

const resolvedLabel = `${resolved.provider}/${resolved.model}`;

206+

const resolvedLabel = modelKey(resolved.provider, resolved.model);

206207

const defaultLabel = rawModel || resolvedLabel;

207208

const defaultsFallbacks = resolveAgentModelFallbackValues(cfg.agents?.defaults?.model);

208209

const fallbacks = agentFallbacksOverride ?? defaultsFallbacks;

Original file line numberDiff line numberDiff line change

@@ -396,6 +396,33 @@ describe("modelsStatusCommand auth overview", () => {

396396

);

397397

});

398398
399+

it("does not double-prefix provider-qualified resolved default models", async () => {

400+

const localRuntime = createRuntime();

401+

const originalLoadConfig = mocks.loadConfig.getMockImplementation();

402+

mocks.loadConfig.mockReturnValue({

403+

agents: {

404+

defaults: {

405+

model: { primary: "openrouter/auto", fallbacks: [] },

406+

models: { "openrouter/auto": {} },

407+

},

408+

},

409+

models: { providers: {} },

410+

env: { shellEnv: { enabled: true } },

411+

});

412+
413+

try {

414+

await modelsStatusCommand({ json: true }, localRuntime as never);

415+

const payload = JSON.parse(String((localRuntime.log as Mock).mock.calls[0]?.[0]));

416+
417+

expect(payload.defaultModel).toBe("openrouter/auto");

418+

expect(payload.resolvedDefault).toBe("openrouter/auto");

419+

} finally {

420+

if (originalLoadConfig) {

421+

mocks.loadConfig.mockImplementation(originalLoadConfig);

422+

}

423+

}

424+

});

425+
399426

it("handles cli backend and aliased provider auth summaries", async () => {

400427

const localRuntime = createRuntime();

401428

const originalLoadConfig = mocks.loadConfig.getMockImplementation();