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

推荐订阅源

H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
L
LangChain Blog
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
Hugging Face - Blog
Hugging Face - Blog
G
Google Developers Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

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
docs: document channel turn guardrails · openclaw/opencla...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

@@ -315,6 +315,148 @@ Supplemental context covers quote, forwarded, and thread-bootstrap context. The

315315316316

Media is fact-shaped. Platform download, auth, SSRF policy, CDN rules, and decryption stay channel-local. The kernel maps facts into `MediaPath`, `MediaUrl`, `MediaType`, `MediaPaths`, `MediaUrls`, `MediaTypes`, and `MediaTranscribedIndexes`.

317317318+

Use `toInboundMediaFacts(...)` from `openclaw/plugin-sdk/channel-inbound` when

319+

your channel has a resolved media list and only needs to attach generic facts:

320+321+

```typescript

322+

media: toInboundMediaFacts(resolvedMedia, {

323+

kind: "image",

324+

messageId: input.id,

325+

});

326+

```

327+328+

If media mixes local files and URL-only entries, keep the list as media facts.

329+

Core preserves array indexes when it writes legacy context fields so downstream

330+

media understanding, transcription markers, and prompt notes continue to refer

331+

to the same attachment.

332+333+

For skipped group messages that should be available to a later mention, pass

334+

media facts through the turn `preflight.media` field. The kernel converts those

335+

facts into bounded history media entries before recording:

336+337+

```typescript

338+

preflight(input) {

339+

return {

340+

admission: { kind: "drop", reason: "missing_mention", recordHistory: true },

341+

media: () => toInboundMediaFacts(resolveLocalImages(input), {

342+

kind: "image",

343+

messageId: input.id,

344+

}),

345+

history: {

346+

key: historyKey,

347+

limit: historyLimit,

348+

mediaLimit: 4,

349+

shouldRecord: () => stillCurrent(input),

350+

},

351+

};

352+

}

353+

```

354+355+

History media is intentionally conservative: image-only today, local readable

356+

paths only, bounded by the configured media limit, and still tied to the

357+

channel history key. Authenticated provider URLs should be downloaded by the

358+

plugin before they become model-visible media.

359+360+

## History windows

361+362+

Message-turn code should use `createChannelHistoryWindow(...)` instead of

363+

calling low-level `reply-history` map helpers directly. The window facade keeps

364+

text context, structured `InboundHistory`, history-media normalization, and

365+

clearing behind one core-owned API while still letting the channel choose how a

366+

history line is rendered.

367+368+

```typescript

369+

const history = createChannelHistoryWindow({ historyMap: groupHistories });

370+371+

await history.recordWithMedia({

372+

historyKey,

373+

limit: historyLimit,

374+

entry,

375+

media: () =>

376+

toInboundMediaFacts(resolvedImages, {

377+

kind: "image",

378+

messageId: entry.messageId,

379+

}),

380+

});

381+382+

const combinedBody = history.buildPendingContext({

383+

historyKey,

384+

limit: historyLimit,

385+

currentMessage,

386+

formatEntry: (entry) => `${entry.sender}: ${entry.body}`,

387+

});

388+

```

389+390+

The older `buildPendingHistoryContextFromMap`,

391+

`buildInboundHistoryFromMap`, `recordPendingHistoryEntry*`, and

392+

`clearHistoryEntriesIfEnabled` exports remain for compatibility with plugins

393+

that have not migrated yet. New channel work should use the window or the turn

394+

kernel record/finalize options.

395+396+

## Common message patterns

397+398+

Text-only group with mention required:

399+400+

```typescript

401+

preflight(input) {

402+

const decision = resolveInboundMentionDecision({ facts, policy });

403+

if (decision.shouldSkip) {

404+

return {

405+

admission: { kind: "drop", reason: "missing_mention", recordHistory: true },

406+

history: { key: historyKey, limit: historyLimit },

407+

};

408+

}

409+

return { access: { mentions: decision } };

410+

}

411+

```

412+413+

Image-only message followed by a later mention:

414+415+

```typescript

416+

preflight(input) {

417+

if (!wasMentioned && resolvedImages.length > 0) {

418+

return {

419+

admission: { kind: "drop", reason: "missing_mention", recordHistory: true },

420+

media: () => toInboundMediaFacts(resolvedImages, {

421+

kind: "image",

422+

messageId: input.id,

423+

}),

424+

history: { key: historyKey, limit: historyLimit, mediaLimit: 4 },

425+

};

426+

}

427+

return {};

428+

}

429+

```

430+431+

Explicit reply-to-image:

432+433+

```typescript

434+

resolveTurn(input, _eventClass, preflight) {

435+

return {

436+

...assembled,

437+

media: toInboundMediaFacts([...currentMedia, ...referencedReplyMedia]),

438+

supplemental: {

439+

quote: preflight.supplemental?.quote,

440+

},

441+

};

442+

}

443+

```

444+445+

Direct message with history:

446+447+

```typescript

448+

resolveTurn(input) {

449+

return {

450+

...assembled,

451+

history: undefined,

452+

message: {

453+

rawBody: input.rawText,

454+

bodyForAgent: input.textForAgent,

455+

},

456+

};

457+

}

458+

```

459+318460

## Adapter contract

319461320462

For full `run`, the adapter shape is: