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

推荐订阅源

J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
C
Check Point Blog
G
Google Developers Blog
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
D
Docker
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow 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(cli): keep provider-owned sessions through implicit e...
obviyus · 2026-04-22 · via Recent Commits to openclaw:main

@@ -2319,6 +2319,112 @@ describe("initSessionState preserves behavior overrides across /new and /reset",

23192319

}

23202320

});

232123212322+

it("keeps provider-owned CLI sessions on implicit daily reset boundaries", async () => {

2323+

vi.useFakeTimers();

2324+

try {

2325+

vi.setSystemTime(new Date(2026, 0, 18, 5, 0, 0));

2326+

const storePath = await createStorePath("openclaw-cli-implicit-reset-");

2327+

const sessionKey = "agent:main:telegram:dm:claude-cli-user";

2328+

const existingSessionId = "provider-owned-session";

2329+

const transcriptPath = path.join(path.dirname(storePath), `${existingSessionId}.jsonl`);

2330+

const cliBinding = {

2331+

sessionId: "claude-session-1",

2332+

authProfileId: "anthropic:claude-cli",

2333+

mcpResumeHash: "mcp-resume-hash",

2334+

};

2335+2336+

await writeSessionStoreFast(storePath, {

2337+

[sessionKey]: {

2338+

sessionId: existingSessionId,

2339+

updatedAt: new Date(2026, 0, 18, 3, 0, 0).getTime(),

2340+

modelProvider: "claude-cli",

2341+

model: "claude-opus-4-6",

2342+

cliSessionBindings: {

2343+

"claude-cli": cliBinding,

2344+

},

2345+

cliSessionIds: {

2346+

"claude-cli": cliBinding.sessionId,

2347+

},

2348+

claudeCliSessionId: cliBinding.sessionId,

2349+

},

2350+

});

2351+

await fs.writeFile(transcriptPath, '{"type":"message"}\n', "utf8");

2352+2353+

const cfg = { session: { store: storePath } } as OpenClawConfig;

2354+

const result = await initSessionState({

2355+

ctx: {

2356+

Body: "hello",

2357+

RawBody: "hello",

2358+

CommandBody: "hello",

2359+

From: "claude-cli-user",

2360+

To: "bot",

2361+

ChatType: "direct",

2362+

SessionKey: sessionKey,

2363+

Provider: "telegram",

2364+

Surface: "telegram",

2365+

},

2366+

cfg,

2367+

commandAuthorized: true,

2368+

});

2369+2370+

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

2371+

expect(result.sessionId).toBe(existingSessionId);

2372+

expect(result.sessionEntry.cliSessionBindings?.["claude-cli"]).toEqual(cliBinding);

2373+

expect(await fs.stat(transcriptPath).catch(() => null)).not.toBeNull();

2374+

const archived = (await fs.readdir(path.dirname(storePath))).filter((entry) =>

2375+

entry.startsWith(`${existingSessionId}.jsonl.reset.`),

2376+

);

2377+

expect(archived).toHaveLength(0);

2378+

} finally {

2379+

vi.useRealTimers();

2380+

}

2381+

});

2382+2383+

it("honors explicit reset policies for provider-owned CLI sessions", async () => {

2384+

const storePath = await createStorePath("openclaw-cli-explicit-reset-");

2385+

const sessionKey = "agent:main:telegram:dm:claude-cli-explicit-user";

2386+

const existingSessionId = "provider-owned-explicit-session";

2387+

const cfg = {

2388+

session: {

2389+

store: storePath,

2390+

reset: { mode: "idle", idleMinutes: 1 },

2391+

},

2392+

} as OpenClawConfig;

2393+2394+

await writeSessionStoreFast(storePath, {

2395+

[sessionKey]: {

2396+

sessionId: existingSessionId,

2397+

updatedAt: Date.now() - 5 * 60_000,

2398+

modelProvider: "claude-cli",

2399+

cliSessionBindings: {

2400+

"claude-cli": {

2401+

sessionId: "claude-session-explicit",

2402+

},

2403+

},

2404+

},

2405+

});

2406+2407+

const result = await initSessionState({

2408+

ctx: {

2409+

Body: "hello",

2410+

RawBody: "hello",

2411+

CommandBody: "hello",

2412+

From: "claude-cli-explicit-user",

2413+

To: "bot",

2414+

ChatType: "direct",

2415+

SessionKey: sessionKey,

2416+

Provider: "telegram",

2417+

Surface: "telegram",

2418+

},

2419+

cfg,

2420+

commandAuthorized: true,

2421+

});

2422+2423+

expect(result.isNewSession).toBe(true);

2424+

expect(result.sessionId).not.toBe(existingSessionId);

2425+

expect(result.sessionEntry.cliSessionBindings).toBeUndefined();

2426+

});

2427+23222428

it("disposes the previous bundle MCP runtime on session rollover", async () => {

23232429

const storePath = await createStorePath("openclaw-stale-runtime-dispose-");

23242430

const sessionKey = "agent:main:telegram:dm:runtime-stale-user";