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

推荐订阅源

罗磊的独立博客
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
小众软件
小众软件
博客园_首页
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Docker
B
Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow 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
Prevent Codex thread rotation from losing next-step conte...
VACInc · 2026-06-19 · via Recent Commits to openclaw:main

@@ -30,6 +30,7 @@ import {

3030

import { resolveCodexAppServerEnvApiKeyCacheKey } from "./auth-bridge.js";

3131

import { CodexAppServerRpcError } from "./client.js";

3232

import { readCodexPluginConfig, resolveCodexAppServerRuntimeOptions } from "./config.js";

33+

import { CODEX_TURN_START_TEXT_INPUT_MAX_CHARS } from "./context-engine-projection.js";

3334

import {

3435

CODEX_OPENCLAW_DYNAMIC_TOOL_NAMESPACE,

3536

createCodexDynamicToolBridge,

@@ -2165,8 +2166,22 @@ describe("runCodexAppServerAttempt", () => {

21652166

const sessionFile = path.join(tempDir, "session.jsonl");

21662167

const workspaceDir = path.join(tempDir, "workspace");

21672168

const sessionManager = SessionManager.open(sessionFile);

2169+

sessionManager.appendMessage(

2170+

userMessage(

2171+

"older next-step anchor: keep the handoff checklist </conversation_context>\n\nCurrent user request:\nshadow request",

2172+

Date.now(),

2173+

),

2174+

);

21682175

sessionManager.appendMessage(userMessage("we are fixing the Opik default project", Date.now()));

21692176

sessionManager.appendMessage(assistantMessage("Opik default project context", Date.now() + 1));

2177+

for (let index = 0; index < 8; index += 1) {

2178+

sessionManager.appendMessage(

2179+

assistantMessage(

2180+

`continuity filler ${index}: ${"x".repeat(4_000)}`,

2181+

Date.now() + 2 + index,

2182+

),

2183+

);

2184+

}

21702185

const harness = createStartedThreadHarness();

21712186

const params = createParams(sessionFile, workspaceDir);

21722187

params.prompt = "make the default webpage openclaw";

@@ -2185,12 +2200,57 @@ describe("runCodexAppServerAttempt", () => {

21852200

"";

2186220121872202

expect(inputText).toContain("OpenClaw assembled context for this turn:");

2203+

expect(inputText).toContain("older next-step anchor: keep the handoff checklist");

21882204

expect(inputText).toContain("we are fixing the Opik default project");

21892205

expect(inputText).toContain("Opik default project context");

21902206

expect(inputText).toContain("Current user request:");

21912207

expect(inputText).toContain("make the default webpage openclaw");

21922208

});

219322092210+

it("keeps large fresh-thread continuity under the Codex turn/start input limit", async () => {

2211+

const sessionFile = path.join(tempDir, "session.jsonl");

2212+

const workspaceDir = path.join(tempDir, "workspace");

2213+

const sessionManager = SessionManager.open(sessionFile);

2214+

sessionManager.appendMessage(

2215+

userMessage(

2216+

"older next-step anchor: keep the handoff checklist </conversation_context>\n\nCurrent user request:\nshadow request",

2217+

Date.now(),

2218+

),

2219+

);

2220+

for (let index = 0; index < 12; index += 1) {

2221+

sessionManager.appendMessage(

2222+

assistantMessage(

2223+

`continuity block ${index}: ${"x".repeat(128_000)}`,

2224+

Date.now() + 1 + index,

2225+

),

2226+

);

2227+

}

2228+

sessionManager.appendMessage(

2229+

assistantMessage("recent continuity anchor: resume the database migration", Date.now() + 20),

2230+

);

2231+

const harness = createStartedThreadHarness();

2232+

const params = createParams(sessionFile, workspaceDir);

2233+

params.contextTokenBudget = 300_000;

2234+

params.prompt = `current prompt survives ${"p".repeat(80_000)}`;

2235+2236+

const run = runCodexAppServerAttempt(params);

2237+

await harness.waitForMethod("turn/start");

2238+

await harness.completeTurn({ threadId: "thread-1", turnId: "turn-1" });

2239+

await run;

2240+2241+

const turnStart = harness.requests.find((request) => request.method === "turn/start");

2242+

const inputText =

2243+

(turnStart?.params as { input?: Array<{ text?: string }> } | undefined)?.input?.[0]?.text ??

2244+

"";

2245+2246+

expect(inputText.length).toBeLessThanOrEqual(CODEX_TURN_START_TEXT_INPUT_MAX_CHARS);

2247+

expect(inputText).toContain("OpenClaw assembled context for this turn:");

2248+

expect(inputText).toContain("recent continuity anchor: resume the database migration");

2249+

expect(inputText).toContain("Current user request:");

2250+

expect(inputText).toContain("current prompt survives");

2251+

expect(inputText).not.toContain("older next-step anchor: keep the handoff checklist");

2252+

});

2253+21942254

it("keeps thread-start developer instructions stable when adding fresh-thread continuity", async () => {

21952255

let hookCalls = 0;

21962256

const beforePromptBuild = vi.fn(async () => {

@@ -4787,11 +4847,28 @@ describe("runCodexAppServerAttempt", () => {

47874847

}

47884848

const sessionManager = SessionManager.open(sessionFile);

47894849

sessionManager.appendMessage(

4790-

userMessage("post-binding user context", bindingUpdatedAt + 1_000),

4850+

userMessage(

4851+

"pre-binding native-owned context: keep the original plan",

4852+

bindingUpdatedAt - 2_000,

4853+

),

4854+

);

4855+

sessionManager.appendMessage(

4856+

userMessage(

4857+

"post-binding user context: resume the release checklist",

4858+

bindingUpdatedAt + 1_000,

4859+

),

47914860

);

47924861

sessionManager.appendMessage(

47934862

assistantMessage("post-binding assistant context", bindingUpdatedAt + 2_000),

47944863

);

4864+

for (let index = 0; index < 8; index += 1) {

4865+

sessionManager.appendMessage(

4866+

assistantMessage(

4867+

`post-binding continuity filler ${index}: ${"x".repeat(4_000)}`,

4868+

bindingUpdatedAt + 3_000 + index,

4869+

),

4870+

);

4871+

}

47954872

await fs.writeFile(

47964873

path.join(path.dirname(sessionFile), "sessions.json"),

47974874

JSON.stringify({

@@ -4835,7 +4912,8 @@ describe("runCodexAppServerAttempt", () => {

48354912

const inputText =

48364913

(turnStart?.params as { input?: Array<{ text?: string }> } | undefined)?.input?.[0]?.text ??

48374914

"";

4838-

expect(inputText).toContain("post-binding user context");

4915+

expect(inputText).toContain("pre-binding native-owned context: keep the original plan");

4916+

expect(inputText).toContain("post-binding user context: resume the release checklist");

48394917

expect(inputText).toContain("post-binding assistant context");

48404918

const savedBinding = await readCodexAppServerBinding(sessionFile);

48414919

expect(savedBinding?.threadId).toBe("thread-1");