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

推荐订阅源

博客园 - 三生石上(FineUI控件)
U
Unit 42
人人都是产品经理
人人都是产品经理
罗磊的独立博客
Recent Announcements
Recent Announcements
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
GbyAI
GbyAI
Blog — PlanetScale
Blog — PlanetScale
I
InfoQ
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
B
Blog RSS Feed
WordPress大学
WordPress大学
腾讯CDC
H
Help Net Security
博客园 - Franky
博客园 - 【当耐特】
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
B
Blog
Vercel News
Vercel News
博客园 - 司徒正美

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(codex): preserve inbound sender metadata · openclaw/o...
zknicker · 2026-05-16 · via Recent Commits to openclaw:main

@@ -7,13 +7,58 @@ import {

77

resolveSessionWriteLockAcquireTimeoutMs,

88

runAgentHarnessBeforeMessageWriteHook,

99

type AgentMessage,

10+

type EmbeddedRunAttemptParams,

1011

type SessionWriteLockAcquireTimeoutConfig,

1112

} from "openclaw/plugin-sdk/agent-harness-runtime";

12131314

type MirroredAgentMessage = Extract<AgentMessage, { role: "user" | "assistant" | "toolResult" }>;

14151516

const MIRROR_IDENTITY_META_KEY = "mirrorIdentity" as const;

161718+

function normalizeOptionalString(value: string | null | undefined): string | undefined {

19+

const normalized = value?.trim();

20+

return normalized ? normalized : undefined;

21+

}

22+23+

function buildSenderLabel(params: {

24+

senderId?: string;

25+

senderName?: string;

26+

senderUsername?: string;

27+

senderE164?: string;

28+

}): string | undefined {

29+

const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;

30+

if (!label) {

31+

return undefined;

32+

}

33+

if (!params.senderId || label.includes(params.senderId)) {

34+

return label;

35+

}

36+

return `${label} (${params.senderId})`;

37+

}

38+39+

export function buildCodexUserPromptMessage(params: EmbeddedRunAttemptParams): AgentMessage {

40+

const senderId = normalizeOptionalString(params.senderId);

41+

const senderName = normalizeOptionalString(params.senderName);

42+

const senderUsername = normalizeOptionalString(params.senderUsername);

43+

const senderE164 = normalizeOptionalString(params.senderE164);

44+

const senderLabel = buildSenderLabel({ senderId, senderName, senderUsername, senderE164 });

45+

const sourceChannel = normalizeOptionalString(

46+

params.inputProvenance?.sourceChannel ?? params.messageChannel ?? params.messageProvider,

47+

);

48+

return {

49+

role: "user",

50+

content: params.prompt,

51+

timestamp: Date.now(),

52+

...(params.inputProvenance ? { provenance: params.inputProvenance } : {}),

53+

...(sourceChannel ? { sourceChannel } : {}),

54+

...(senderId ? { senderId } : {}),

55+

...(senderName ? { senderName } : {}),

56+

...(senderUsername ? { senderUsername } : {}),

57+

...(senderE164 ? { senderE164 } : {}),

58+

...(senderLabel ? { senderLabel } : {}),

59+

} as AgentMessage;

60+

}

61+1762

/**

1863

* Tag a message with a stable logical identity for mirror dedupe. Callers

1964

* should use a value that is invariant for the same logical message across