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

推荐订阅源

量子位
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
G
Google Developers Blog
腾讯CDC
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
博客园_首页
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

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(media): clamp image description timeouts · openclaw/o...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -1,5 +1,6 @@

11

// Image runtime tests cover model-backed image routing, auth/profile handling,

22

// provider payload transforms, and MiniMax/Copilot special paths.

3+

import { MAX_TIMER_TIMEOUT_MS } from "@openclaw/normalization-core/number-coercion";

34

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

45
56

const hoisted = vi.hoisted(() => ({

@@ -831,6 +832,47 @@ describe("describeImageWithModel", () => {

831832

});

832833

});

833834
835+

it("clamps oversized image description timeouts before scheduling", async () => {

836+

const setTimeoutSpy = vi.spyOn(globalThis, "setTimeout");

837+

discoverModelsMock.mockReturnValue({

838+

find: vi.fn(() => ({

839+

provider: "openai",

840+

id: "gpt-5.4",

841+

input: ["text", "image"],

842+

baseUrl: "https://chatgpt.com/backend-api",

843+

})),

844+

});

845+

completeMock.mockResolvedValue({

846+

role: "assistant",

847+

api: "openai-chatgpt-responses",

848+

provider: "openai",

849+

model: "gpt-5.4",

850+

stopReason: "stop",

851+

timestamp: Date.now(),

852+

content: [{ type: "text", text: "codex ok" }],

853+

});

854+
855+

const result = await describeImageWithModel({

856+

cfg: {},

857+

agentDir: "/tmp/openclaw-agent",

858+

provider: "openai",

859+

model: "gpt-5.4",

860+

buffer: Buffer.from("png-bytes"),

861+

fileName: "image.png",

862+

mime: "image/png",

863+

prompt: "Describe the image.",

864+

timeoutMs: Number.MAX_SAFE_INTEGER,

865+

});

866+
867+

expect(result).toEqual({

868+

text: "codex ok",

869+

model: "gpt-5.4",

870+

});

871+

expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), MAX_TIMER_TIMEOUT_MS);

872+

const firstCall = requireFirstMockCall(completeMock, "image completion");

873+

expect(firstCall[2].timeoutMs).toBe(MAX_TIMER_TIMEOUT_MS);

874+

});

875+
834876

it("places OpenRouter image prompts in user content before images", async () => {

835877

discoverModelsMock.mockReturnValue({

836878

find: vi.fn(() => ({