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

推荐订阅源

The Cloudflare Blog
L
LangChain Blog
WordPress大学
WordPress大学
V
V2EX
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Docker
Recent Announcements
Recent Announcements
GbyAI
GbyAI
博客园 - 叶小钗
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
雷峰网
雷峰网
The GitHub Blog
The GitHub 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: import claude cli history for anthropic sessions · o...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -256,6 +256,73 @@ describe("cli session history", () => {

256256

});

257257

});

258258259+

it("augments anthropic-routed chat history when a Claude CLI binding has local messages", async () => {

260+

await withClaudeProjectsDir(async ({ homeDir, sessionId }) => {

261+

const messages = augmentChatHistoryWithCliSessionImports({

262+

entry: {

263+

sessionId: "openclaw-session",

264+

updatedAt: Date.now(),

265+

cliSessionBindings: {

266+

"claude-cli": {

267+

sessionId,

268+

},

269+

},

270+

},

271+

provider: "anthropic",

272+

localMessages: [

273+

{

274+

role: "assistant",

275+

content: "local assistant turn",

276+

timestamp: Date.parse("2026-03-26T16:29:57.000Z"),

277+

},

278+

],

279+

homeDir,

280+

});

281+282+

expect(messages).toHaveLength(4);

283+

expect(messages).toContainEqual(

284+

expect.objectContaining({

285+

role: "assistant",

286+

content: "local assistant turn",

287+

}),

288+

);

289+

expect(messages).toContainEqual(

290+

expect.objectContaining({

291+

role: "user",

292+

__openclaw: expect.objectContaining({ cliSessionId: sessionId }),

293+

}),

294+

);

295+

});

296+

});

297+298+

it("does not import stale Claude CLI history for unrelated providers with local messages", async () => {

299+

await withClaudeProjectsDir(async ({ homeDir, sessionId }) => {

300+

const localMessages = [

301+

{

302+

role: "assistant",

303+

content: "local OpenAI turn",

304+

timestamp: Date.parse("2026-03-26T16:29:57.000Z"),

305+

},

306+

];

307+

const messages = augmentChatHistoryWithCliSessionImports({

308+

entry: {

309+

sessionId: "openclaw-session",

310+

updatedAt: Date.now(),

311+

cliSessionBindings: {

312+

"claude-cli": {

313+

sessionId,

314+

},

315+

},

316+

},

317+

provider: "openai",

318+

localMessages,

319+

homeDir,

320+

});

321+322+

expect(messages).toBe(localMessages);

323+

});

324+

});

325+259326

it("falls back to legacy cliSessionIds when bindings are absent", async () => {

260327

await withClaudeProjectsDir(async ({ homeDir, sessionId }) => {

261328

const messages = augmentChatHistoryWithCliSessionImports({