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

推荐订阅源

Martin Fowler
Martin Fowler
Blog — PlanetScale
Blog — PlanetScale
Vercel News
Vercel News
L
LangChain Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
博客园_首页
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
美团技术团队
V
V2EX

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): release raw assistant app-server completions ...
IWhatsskill · 2026-05-16 · via Recent Commits to openclaw:main

@@ -1901,6 +1901,184 @@ describe("runCodexAppServerAttempt", () => {

19011901

expect(request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);

19021902

});

190319031904+

it("does not release post-tool raw assistant progress after the assistant idle timeout", async () => {

1905+

let notify: (notification: CodexServerNotification) => Promise<void> = async () => undefined;

1906+

let handleRequest:

1907+

| ((request: { id: string; method: string; params?: unknown }) => Promise<unknown>)

1908+

| undefined;

1909+

const request = vi.fn(async (method: string) => {

1910+

if (method === "thread/start") {

1911+

return threadStartResult("thread-1");

1912+

}

1913+

if (method === "turn/start") {

1914+

return turnStartResult("turn-1", "inProgress");

1915+

}

1916+

return {};

1917+

});

1918+

setCodexAppServerClientFactoryForTest(

1919+

async () =>

1920+

({

1921+

request,

1922+

addNotificationHandler: (handler: typeof notify) => {

1923+

notify = handler;

1924+

return () => undefined;

1925+

},

1926+

addRequestHandler: (

1927+

handler: (request: {

1928+

id: string;

1929+

method: string;

1930+

params?: unknown;

1931+

}) => Promise<unknown>,

1932+

) => {

1933+

handleRequest = handler;

1934+

return () => undefined;

1935+

},

1936+

}) as never,

1937+

);

1938+

const params = createParams(

1939+

path.join(tempDir, "session.jsonl"),

1940+

path.join(tempDir, "workspace"),

1941+

);

1942+

params.timeoutMs = 60_000;

1943+1944+

const run = runCodexAppServerAttempt(params, {

1945+

turnCompletionIdleTimeoutMs: 50,

1946+

turnAssistantCompletionIdleTimeoutMs: 5,

1947+

turnTerminalIdleTimeoutMs: 500,

1948+

});

1949+

await vi.waitFor(() => expect(handleRequest).toBeTypeOf("function"), { interval: 1 });

1950+1951+

const toolResult = (await handleRequest?.({

1952+

id: "request-tool-1",

1953+

method: "item/tool/call",

1954+

params: {

1955+

threadId: "thread-1",

1956+

turnId: "turn-1",

1957+

callId: "call-1",

1958+

namespace: null,

1959+

tool: "message",

1960+

arguments: { action: "send", text: "already sent" },

1961+

},

1962+

})) as { success?: boolean };

1963+

expect(toolResult.success).toBe(false);

1964+

await notify({

1965+

method: "rawResponseItem/completed",

1966+

params: {

1967+

threadId: "thread-1",

1968+

turnId: "turn-1",

1969+

item: {

1970+

type: "message",

1971+

id: "raw-status-1",

1972+

role: "assistant",

1973+

content: [{ type: "output_text", text: "I'm writing the report now." }],

1974+

},

1975+

},

1976+

});

1977+

await new Promise((resolve) => setTimeout(resolve, 30));

1978+

expect(request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);

1979+1980+

await notify({

1981+

method: "turn/completed",

1982+

params: {

1983+

threadId: "thread-1",

1984+

turnId: "turn-1",

1985+

turn: { id: "turn-1", status: "completed" },

1986+

},

1987+

});

1988+1989+

const result = await run;

1990+

expect(result.aborted).toBe(false);

1991+

expect(result.timedOut).toBe(false);

1992+

expect(result.promptError).toBeNull();

1993+

expect(request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);

1994+

});

1995+1996+

it("does not release post-native-tool raw assistant progress after the assistant idle timeout", async () => {

1997+

let notify: (notification: CodexServerNotification) => Promise<void> = async () => undefined;

1998+

const request = vi.fn(async (method: string) => {

1999+

if (method === "thread/start") {

2000+

return threadStartResult("thread-1");

2001+

}

2002+

if (method === "turn/start") {

2003+

return turnStartResult("turn-1", "inProgress");

2004+

}

2005+

return {};

2006+

});

2007+

setCodexAppServerClientFactoryForTest(

2008+

async () =>

2009+

({

2010+

request,

2011+

addNotificationHandler: (handler: typeof notify) => {

2012+

notify = handler;

2013+

return () => undefined;

2014+

},

2015+

addRequestHandler: () => () => undefined,

2016+

}) as never,

2017+

);

2018+

const params = createParams(

2019+

path.join(tempDir, "session.jsonl"),

2020+

path.join(tempDir, "workspace"),

2021+

);

2022+

params.timeoutMs = 60_000;

2023+2024+

const run = runCodexAppServerAttempt(params, {

2025+

turnCompletionIdleTimeoutMs: 100,

2026+

turnAssistantCompletionIdleTimeoutMs: 5,

2027+

turnTerminalIdleTimeoutMs: 500,

2028+

});

2029+

await vi.waitFor(

2030+

() =>

2031+

expect(request).toHaveBeenCalledWith("turn/start", expect.anything(), expect.anything()),

2032+

{ interval: 1 },

2033+

);

2034+

await notify({

2035+

method: "item/started",

2036+

params: {

2037+

threadId: "thread-1",

2038+

turnId: "turn-1",

2039+

item: { type: "commandExecution", id: "cmd-1", status: "inProgress" },

2040+

},

2041+

});

2042+

await notify({

2043+

method: "item/completed",

2044+

params: {

2045+

threadId: "thread-1",

2046+

turnId: "turn-1",

2047+

item: { type: "commandExecution", id: "cmd-1", status: "completed" },

2048+

},

2049+

});

2050+

await notify({

2051+

method: "rawResponseItem/completed",

2052+

params: {

2053+

threadId: "thread-1",

2054+

turnId: "turn-1",

2055+

item: {

2056+

type: "message",

2057+

id: "raw-status-1",

2058+

role: "assistant",

2059+

content: [{ type: "output_text", text: "I'm summarizing command output." }],

2060+

},

2061+

},

2062+

});

2063+

await new Promise((resolve) => setTimeout(resolve, 30));

2064+

expect(request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);

2065+2066+

await notify({

2067+

method: "turn/completed",

2068+

params: {

2069+

threadId: "thread-1",

2070+

turnId: "turn-1",

2071+

turn: { id: "turn-1", status: "completed" },

2072+

},

2073+

});

2074+2075+

const result = await run;

2076+

expect(result.aborted).toBe(false);

2077+

expect(result.timedOut).toBe(false);

2078+

expect(result.promptError).toBeNull();

2079+

expect(request.mock.calls.some(([method]) => method === "turn/interrupt")).toBe(false);

2080+

});

2081+19042082

it("logs raw assistant item context when the terminal watchdog fires", async () => {

19052083

let notify: (notification: CodexServerNotification) => Promise<void> = async () => undefined;

19062084

let handleRequest:

@@ -2435,7 +2613,83 @@ describe("runCodexAppServerAttempt", () => {

24352613

});

24362614

});

243726152438-

it("does not release the session after only a raw assistant response item", async () => {

2616+

it("does not release or return commentary raw assistant response items", async () => {

2617+

let notify: (notification: CodexServerNotification) => Promise<void> = async () => undefined;

2618+

const request = vi.fn(async (method: string) => {

2619+

if (method === "thread/start") {

2620+

return threadStartResult("thread-1");

2621+

}

2622+

if (method === "turn/start") {

2623+

return turnStartResult("turn-1", "inProgress");

2624+

}

2625+

return {};

2626+

});

2627+

setCodexAppServerClientFactoryForTest(

2628+

async () =>

2629+

({

2630+

request,

2631+

addNotificationHandler: (handler: typeof notify) => {

2632+

notify = handler;

2633+

return () => undefined;

2634+

},

2635+

addRequestHandler: () => () => undefined,

2636+

}) as never,

2637+

);

2638+

const params = createParams(

2639+

path.join(tempDir, "session.jsonl"),

2640+

path.join(tempDir, "workspace"),

2641+

);

2642+

params.timeoutMs = 200;

2643+2644+

const run = runCodexAppServerAttempt(params, {

2645+

turnAssistantCompletionIdleTimeoutMs: 5,

2646+

});

2647+

await vi.waitFor(

2648+

() =>

2649+

expect(request).toHaveBeenCalledWith("turn/start", expect.anything(), expect.anything()),

2650+

{ interval: 1 },

2651+

);

2652+

await notify({

2653+

method: "rawResponseItem/completed",

2654+

params: {

2655+

threadId: "thread-1",

2656+

turnId: "turn-1",

2657+

item: {

2658+

type: "message",

2659+

id: "raw-commentary-1",

2660+

role: "assistant",

2661+

phase: "commentary",

2662+

content: [{ type: "output_text", text: "I am checking the workspace." }],

2663+

},

2664+

},

2665+

});

2666+

await new Promise((resolve) => setTimeout(resolve, 20));

2667+2668+

expect(request).not.toHaveBeenCalledWith("turn/interrupt", expect.anything());

2669+

await notify({

2670+

method: "turn/completed",

2671+

params: {

2672+

threadId: "thread-1",

2673+

turnId: "turn-1",

2674+

turn: { id: "turn-1", status: "completed" },

2675+

},

2676+

});

2677+2678+

const result = await run;

2679+

expect({

2680+

aborted: result.aborted,

2681+

timedOut: result.timedOut,

2682+

promptError: result.promptError,

2683+

assistantTexts: result.assistantTexts,

2684+

}).toEqual({

2685+

aborted: false,

2686+

timedOut: false,

2687+

promptError: null,

2688+

assistantTexts: [],

2689+

});

2690+

});

2691+2692+

it("releases the session after a raw assistant response item without turn completion", async () => {

24392693

let notify: (notification: CodexServerNotification) => Promise<void> = async () => undefined;

24402694

const request = vi.fn(async (method: string) => {

24412695

if (method === "thread/start") {

@@ -2485,18 +2739,31 @@ describe("runCodexAppServerAttempt", () => {

24852739

},

24862740

},

24872741

});

2488-

await new Promise((resolve) => setTimeout(resolve, 20));

2489274224902743

const result = await run;

24912744

expect({

24922745

aborted: result.aborted,

24932746

timedOut: result.timedOut,

24942747

promptError: result.promptError,

2748+

assistantTexts: result.assistantTexts,

24952749

}).toEqual({

2496-

aborted: true,

2497-

timedOut: true,

2498-

promptError: "codex app-server turn idle timed out waiting for turn/completed",

2750+

aborted: false,

2751+

timedOut: false,

2752+

promptError: null,

2753+

assistantTexts: ["Done."],

24992754

});

2755+

await vi.waitFor(

2756+

() =>

2757+

expect(request).toHaveBeenCalledWith(

2758+

"turn/interrupt",

2759+

{

2760+

threadId: "thread-1",

2761+

turnId: "turn-1",

2762+

},

2763+

{ timeoutMs: 5_000 },

2764+

),

2765+

{ interval: 1 },

2766+

);

25002767

});

2501276825022769

it("keeps waiting when a current-turn item is still active", async () => {