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

推荐订阅源

V
V2EX
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
博客园 - 【当耐特】
月光博客
月光博客
C
Check Point Blog
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
美团技术团队
N
Netflix TechBlog - Medium
Stack Overflow Blog
Stack Overflow Blog
Y
Y Combinator Blog
L
LangChain Blog
The Cloudflare Blog

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 native web search action metadata (#...
vincentkoc · 2026-05-23 · via Recent Commits to openclaw:main

@@ -1528,6 +1528,32 @@ function readString(record: JsonObject, key: string): string | undefined {

15281528

return typeof value === "string" ? value : undefined;

15291529

}

153015301531+

function normalizeNonEmptyString(value: unknown): string | undefined {

1532+

if (typeof value !== "string") {

1533+

return undefined;

1534+

}

1535+

return value.trim() || undefined;

1536+

}

1537+1538+

function readNonEmptyString(record: JsonObject, key: string): string | undefined {

1539+

return normalizeNonEmptyString(record[key]);

1540+

}

1541+1542+

function readNonEmptyStringArray(record: JsonObject, key: string): string[] {

1543+

const value = record[key];

1544+

if (!Array.isArray(value)) {

1545+

return [];

1546+

}

1547+

const entries: string[] = [];

1548+

for (const entry of value) {

1549+

const normalized = normalizeNonEmptyString(entry);

1550+

if (normalized) {

1551+

entries.push(normalized);

1552+

}

1553+

}

1554+

return entries;

1555+

}

1556+15311557

function readNullableString(record: JsonObject, key: string): string | null | undefined {

15321558

const value = record[key];

15331559

if (value === null) {

@@ -1818,15 +1844,48 @@ function itemToolArgs(item: CodexThreadItem): Record<string, unknown> | undefine

18181844

changes: itemFileChanges(item),

18191845

});

18201846

}

1821-

if (item.type === "webSearch" && typeof item.query === "string") {

1822-

return sanitizeCodexAgentEventRecord({ query: item.query });

1847+

if (item.type === "webSearch") {

1848+

return webSearchToolArgs(item);

18231849

}

18241850

if (item.type === "dynamicToolCall" || item.type === "mcpToolCall") {

18251851

return sanitizeCodexToolArguments(item.arguments);

18261852

}

18271853

return undefined;

18281854

}

182918551856+

function webSearchToolArgs(item: CodexThreadItem): Record<string, unknown> {

1857+

const action = isJsonObject(item.action) ? item.action : undefined;

1858+

const actionType = action ? readNonEmptyString(action, "type") : undefined;

1859+

const queries =

1860+

action && actionType === "search" ? readNonEmptyStringArray(action, "queries") : [];

1861+

const query =

1862+

normalizeNonEmptyString(item.query) ??

1863+

(action && actionType === "search" ? readNonEmptyString(action, "query") : undefined) ??

1864+

queries[0];

1865+

const url = action ? readNonEmptyString(action, "url") : undefined;

1866+

const pattern = action ? readNonEmptyString(action, "pattern") : undefined;

1867+

const args: Record<string, unknown> = {};

1868+

if (query) {

1869+

args.query = query;

1870+

}

1871+

if (queries.length > 0) {

1872+

args.queries = queries;

1873+

}

1874+

if (actionType && actionType !== "search") {

1875+

args.action = actionType;

1876+

}

1877+

if (url) {

1878+

args.url = url;

1879+

}

1880+

if (pattern) {

1881+

args.pattern = pattern;

1882+

}

1883+

if (!query && !url && !pattern) {

1884+

args.queryUnavailable = true;

1885+

}

1886+

return sanitizeCodexAgentEventRecord(args);

1887+

}

1888+18301889

function itemToolResult(item: CodexThreadItem): { result?: Record<string, unknown> } {

18311890

if (item.type === "commandExecution") {

18321891

return {

@@ -1856,11 +1915,19 @@ function itemToolResult(item: CodexThreadItem): { result?: Record<string, unknow

18561915

};

18571916

}

18581917

if (item.type === "webSearch") {

1859-

return { result: sanitizeCodexAgentEventRecord({ status: "completed" }) };

1918+

return { result: webSearchToolResult(item) };

18601919

}

18611920

return {};

18621921

}

186319221923+

function webSearchToolResult(item: CodexThreadItem): Record<string, unknown> {

1924+

return sanitizeCodexAgentEventRecord({

1925+

status: itemStatus(item),

1926+

...(typeof item.durationMs === "number" ? { durationMs: item.durationMs } : {}),

1927+

...webSearchToolArgs(item),

1928+

});

1929+

}

1930+18641931

function itemFileChanges(item: CodexThreadItem): Array<{ path: string; kind: string }> {

18651932

return Array.isArray(item.changes)

18661933

? item.changes.map((change) => ({ path: change.path, kind: change.kind }))

@@ -1895,8 +1962,8 @@ function itemMeta(

18951962

{ detailMode },

18961963

);

18971964

}

1898-

if (item.type === "webSearch" && typeof item.query === "string") {

1899-

return item.query;

1965+

if (item.type === "webSearch") {

1966+

return inferToolMetaFromArgs("web_search", webSearchToolArgs(item), { detailMode });

19001967

}

19011968

const toolName = itemName(item);

19021969

if ((item.type === "dynamicToolCall" || item.type === "mcpToolCall") && toolName) {