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

推荐订阅源

量子位
小众软件
小众软件
S
SegmentFault 最新的问题
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
C
Check Point Blog
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
罗磊的独立博客
有赞技术团队
有赞技术团队
V
V2EX
Y
Y Combinator Blog
博客园 - 叶小钗
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Fortinet All Blogs
W
WeLiveSecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
S
Security @ Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
MyScale Blog
MyScale Blog
Hugging Face - Blog
Hugging Face - Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
Schneier on Security
Schneier on Security
Security Latest
Security Latest
AWS News Blog
AWS News Blog
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
博客园 - Franky
Cisco Talos Blog
Cisco Talos Blog
T
Threat Research - Cisco Blogs
M
MIT News - Artificial intelligence
T
Troy Hunt's Blog
N
News and Events Feed by Topic
Cloudbric
Cloudbric
Scott Helme
Scott Helme
云风的 BLOG
云风的 BLOG
Attack and Defense Labs
Attack and Defense Labs

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(gateway): route text-only chat images to media understanding · openclaw/openclaw@0113248
steipete · 2026-04-28 · via Recent Commits to openclaw:main

@@ -794,28 +794,45 @@ function buildChatSendTranscriptMessage(params: {

794794

};

795795

}

796796797-

// Stages non-image offloads into the agent sandbox synchronously so chat.send

797+

function stripTrailingOffloadedMediaMarkers(message: string, refs: OffloadedRef[]): string {

798+

if (refs.length === 0) {

799+

return message;

800+

}

801+

const removableRefs = new Set(refs.map((ref) => ref.mediaRef));

802+

const lines = message.split(/\r?\n/);

803+

while (lines.length > 0) {

804+

const last = lines[lines.length - 1]?.trim() ?? "";

805+

const match = /^\[media attached:\s*(media:\/\/inbound\/[^\]\s]+)\]$/.exec(last);

806+

if (!match?.[1] || !removableRefs.delete(match[1])) {

807+

break;

808+

}

809+

lines.pop();

810+

}

811+

return lines.join("\n").trimEnd();

812+

}

813+814+

// Stages media-path offloads into the agent sandbox synchronously so chat.send

798815

// can surface 5xx before respond(). Throws MediaOffloadError on any staging

799816

// failure (ENOSPC / EPERM / partial-stage) so the outer chat.send handler can

800817

// map it to UNAVAILABLE (5xx); plain Error would be misclassified as 4xx. All

801818

// offloaded refs are cleaned up from the media store before rethrow.

802819

// Callers MUST set ctx.MediaStaged=true when this runs so the dispatch

803820

// pipeline skips its own stageSandboxMedia pass.

804821

//

805-

// Returned paths are ABSOLUTE (pointing into the sandbox workspace when sandbox

806-

// is enabled, or the media-store origin when it is not). applyMediaUnderstanding

807-

// runs before any further staging in get-reply.ts and uses

808-

// `path.isAbsolute(raw) ? raw : path.resolve(raw)` against the gateway CWD, so

809-

// any relative path here would make media-understanding target the wrong host

810-

// path and silently skip file analysis.

811-

async function prestageNonImageOffloads(params: {

822+

// Returned paths are absolute media-store paths when no sandbox is active, or

823+

// sandbox-relative paths plus `workspaceDir` when sandboxing is active. Host-side

824+

// media-understanding uses MediaWorkspaceDir to resolve those relative paths.

825+

async function prestageMediaPathOffloads(params: {

812826

offloadedRefs: OffloadedRef[];

827+

includeImageRefs?: boolean;

813828

cfg: OpenClawConfig;

814829

sessionKey: string;

815830

agentId: string;

816831

}): Promise<{ paths: string[]; types: string[]; workspaceDir?: string }> {

817-

const nonImage = params.offloadedRefs.filter((ref) => !ref.mimeType.startsWith("image/"));

818-

if (nonImage.length === 0) {

832+

const mediaPathRefs = params.offloadedRefs.filter(

833+

(ref) => params.includeImageRefs || !ref.mimeType.startsWith("image/"),

834+

);

835+

if (mediaPathRefs.length === 0) {

819836

return { paths: [], types: [] };

820837

}

821838

@@ -828,33 +845,33 @@ async function prestageNonImageOffloads(params: {

828845

});

829846

if (!sandbox) {

830847

return {

831-

paths: nonImage.map((ref) => ref.path),

832-

types: nonImage.map((ref) => ref.mimeType),

848+

paths: mediaPathRefs.map((ref) => ref.path),

849+

types: mediaPathRefs.map((ref) => ref.mimeType),

833850

};

834851

}

835852836853

// stageSandboxMedia caps each file at STAGED_MEDIA_MAX_BYTES (=

837854

// MEDIA_MAX_BYTES, 5MB) and silently skips oversized files. The parse cap

838855

// (resolveChatAttachmentMaxBytes, default 20MB) is higher, so a sandboxed

839-

// session receiving a non-image file between the two caps would otherwise

856+

// session receiving a file between the two caps would otherwise

840857

// pass parse, fail staging, and surface as a retryable 5xx even though

841858

// retry cannot succeed. Reject here as a client-side 4xx instead.

842-

const oversizedForSandbox = nonImage.filter((ref) => ref.sizeBytes > MEDIA_MAX_BYTES);

859+

const oversizedForSandbox = mediaPathRefs.filter((ref) => ref.sizeBytes > MEDIA_MAX_BYTES);

843860

if (oversizedForSandbox.length > 0) {

844861

const details = oversizedForSandbox

845862

.map((ref) => `${ref.label} (${ref.sizeBytes} bytes)`)

846863

.join(", ");

847864

throw new UnsupportedAttachmentError(

848865

"non-image-too-large-for-sandbox",

849-

`non-image attachments exceed sandbox staging limit (${MEDIA_MAX_BYTES} bytes): ${details}`,

866+

`attachments exceed sandbox staging limit (${MEDIA_MAX_BYTES} bytes): ${details}`,

850867

);

851868

}

852869853870

const stagingCtx: MsgContext = {

854-

MediaPath: nonImage[0].path,

855-

MediaPaths: nonImage.map((ref) => ref.path),

856-

MediaType: nonImage[0].mimeType,

857-

MediaTypes: nonImage.map((ref) => ref.mimeType),

871+

MediaPath: mediaPathRefs[0].path,

872+

MediaPaths: mediaPathRefs.map((ref) => ref.path),

873+

MediaType: mediaPathRefs[0].mimeType,

874+

MediaTypes: mediaPathRefs.map((ref) => ref.mimeType),

858875

};

859876

const stageResult = await stageSandboxMedia({

860877

ctx: stagingCtx,

@@ -871,14 +888,14 @@ async function prestageNonImageOffloads(params: {

871888

// (STAGED_MEDIA_MAX_BYTES = 5MB); check the returned `staged` map so any

872889

// missing source becomes a 5xx MediaOffloadError the client can retry.

873890

const stagedSources = stageResult.staged;

874-

const missing = nonImage.filter((ref) => !stagedSources.has(ref.path));

891+

const missing = mediaPathRefs.filter((ref) => !stagedSources.has(ref.path));

875892

if (missing.length > 0) {

876893

throw new Error(

877-

`non-image attachment staging incomplete: ${stagedSources.size}/${nonImage.length} paths staged into sandbox workspace (missing: ${missing.map((ref) => ref.path).join(", ")})`,

894+

`attachment staging incomplete: ${stagedSources.size}/${mediaPathRefs.length} paths staged into sandbox workspace (missing: ${missing.map((ref) => ref.path).join(", ")})`,

878895

);

879896

}

880897

const stagedPaths = stagingCtx.MediaPaths ?? [];

881-

const stagedTypes = stagingCtx.MediaTypes ?? nonImage.map((ref) => ref.mimeType);

898+

const stagedTypes = stagingCtx.MediaTypes ?? mediaPathRefs.map((ref) => ref.mimeType);

882899883900

// Keep stagedPaths sandbox-relative (e.g. `media/inbound/foo.pdf`) so the

884901

// agent inside the container can read them. Host-side media-understanding

@@ -897,7 +914,7 @@ async function prestageNonImageOffloads(params: {

897914

throw err;

898915

}

899916

throw new MediaOffloadError(

900-

`[Gateway Error] Failed to stage non-image attachments into agent workspace: ${formatErrorMessage(err)}`,

917+

`[Gateway Error] Failed to stage attachments into agent workspace: ${formatErrorMessage(err)}`,

901918

{ cause: err },

902919

);

903920

}

@@ -1896,9 +1913,9 @@ export const chatHandlers: GatewayRequestHandlers = {

18961913

let parsedImages: ChatImageContent[] = [];

18971914

let imageOrder: PromptImageOrderEntry[] = [];

18981915

let offloadedRefs: OffloadedRef[] = [];

1899-

let nonImageMediaPaths: string[] = [];

1900-

let nonImageMediaTypes: string[] = [];

1901-

let nonImageMediaWorkspaceDir: string | undefined;

1916+

let mediaPathOffloadPaths: string[] = [];

1917+

let mediaPathOffloadTypes: string[] = [];

1918+

let mediaPathOffloadWorkspaceDir: string | undefined;

19021919

const timeoutMs = resolveAgentTimeoutMs({

19031920

cfg,

19041921

overrideMs: p.timeoutMs,

@@ -1971,25 +1988,35 @@ export const chatHandlers: GatewayRequestHandlers = {

19711988

supportsSessionModelImages ||

19721989

explicitOriginTargetsAcpSession(explicitOriginResult.value) ||

19731990

explicitOriginTargetsPlugin;

1991+

const routeImageOffloadsAsMediaPaths = !supportsImages;

19741992

try {

19751993

const parsed = await parseMessageWithAttachments(inboundMessage, normalizedAttachments, {

19761994

maxBytes: resolveChatAttachmentMaxBytes(cfg),

19771995

log: context.logGateway,

19781996

supportsImages,

1979-

// chat.send routes non-image offloadedRefs into ctx.MediaPaths below

1997+

// chat.send routes selected offloadedRefs into ctx.MediaPaths below

19801998

// so the auto-reply stage pipeline can surface them to the agent.

19811999

acceptNonImage: true,

19822000

});

1983-

parsedMessage = parsed.message;

2001+

parsedMessage = stripTrailingOffloadedMediaMarkers(

2002+

parsed.message,

2003+

routeImageOffloadsAsMediaPaths

2004+

? parsed.offloadedRefs.filter((ref) => ref.mimeType.startsWith("image/"))

2005+

: [],

2006+

);

19842007

parsedImages = parsed.images;

1985-

imageOrder = parsed.imageOrder;

2008+

imageOrder = routeImageOffloadsAsMediaPaths ? [] : parsed.imageOrder;

19862009

offloadedRefs = parsed.offloadedRefs;

19872010

({

1988-

paths: nonImageMediaPaths,

1989-

types: nonImageMediaTypes,

1990-

workspaceDir: nonImageMediaWorkspaceDir,

1991-

} = await prestageNonImageOffloads({

2011+

paths: mediaPathOffloadPaths,

2012+

types: mediaPathOffloadTypes,

2013+

workspaceDir: mediaPathOffloadWorkspaceDir,

2014+

} = await prestageMediaPathOffloads({

19922015

offloadedRefs,

2016+

// Text-only image offloads need ctx.MediaPaths so media-understanding

2017+

// can describe them via agents.defaults.imageModel. Vision-capable

2018+

// image offloads stay as prompt refs for native image loading.

2019+

includeImageRefs: routeImageOffloadsAsMediaPaths,

19932020

cfg,

19942021

sessionKey,

19952022

agentId,

@@ -2100,17 +2127,17 @@ export const chatHandlers: GatewayRequestHandlers = {

21002127

GatewayClientScopes: client?.connect?.scopes ?? [],

21012128

...pluginBoundMediaFields,

21022129

};

2103-

if (nonImageMediaPaths.length > 0) {

2104-

// Inject non-image offloads via the same MsgContext fields the channel

2130+

if (mediaPathOffloadPaths.length > 0) {

2131+

// Inject offloads via the same MsgContext fields the channel

21052132

// path uses so buildInboundMediaNote renders a real `[media attached:

21062133

// <workspace-relative-path>]` line into the agent prompt. Marker

21072134

// blocks the dispatch pipeline from re-running stageSandboxMedia; see

2108-

// prestageNonImageOffloads.

2109-

ctx.MediaPath = nonImageMediaPaths[0];

2110-

ctx.MediaPaths = nonImageMediaPaths;

2111-

ctx.MediaType = nonImageMediaTypes[0];

2112-

ctx.MediaTypes = nonImageMediaTypes;

2113-

ctx.MediaWorkspaceDir = nonImageMediaWorkspaceDir;

2135+

// prestageMediaPathOffloads.

2136+

ctx.MediaPath = mediaPathOffloadPaths[0];

2137+

ctx.MediaPaths = mediaPathOffloadPaths;

2138+

ctx.MediaType = mediaPathOffloadTypes[0];

2139+

ctx.MediaTypes = mediaPathOffloadTypes;

2140+

ctx.MediaWorkspaceDir = mediaPathOffloadWorkspaceDir;

21142141

ctx.MediaStaged = true;

21152142

}

21162143