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

推荐订阅源

J
Java Code Geeks
量子位
腾讯CDC
A
About on SuperTechFans
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
T
Tailwind CSS Blog
V
V2EX
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
罗磊的独立博客
宝玉的分享
宝玉的分享
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
V
Visual Studio Blog
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队

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(gateway): abort stale agent runs on restart · opencla...
vincentkoc · 2026-05-26 · via Recent Commits to openclaw:main

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

2525

createDefaultEmbeddedSession,

2626

createContextEngineBootstrapAndAssemble,

2727

createContextEngineAttemptRunner,

28+

createSubscriptionMock,

2829

expectCalledWithSessionKey,

2930

getHoisted,

3031

resetEmbeddedAttemptHarness,

@@ -1514,6 +1515,102 @@ describe("runEmbeddedAttempt context engine sessionKey forwarding", () => {

15141515

expect(events.indexOf("bootstrap")).toBeLessThan(events.indexOf("lock"));

15151516

});

151615171518+

it("does not acquire the session write lock after aborting during prep", async () => {

1519+

const abortController = new AbortController();

1520+

hoisted.resolveBootstrapContextForRunMock.mockImplementation(async () => {

1521+

abortController.abort();

1522+

return { bootstrapFiles: [], contextFiles: [] };

1523+

});

1524+1525+

await expect(

1526+

createContextEngineAttemptRunner({

1527+

contextEngine: createContextEngineBootstrapAndAssemble(),

1528+

sessionKey,

1529+

tempPaths,

1530+

attemptOverrides: { abortSignal: abortController.signal },

1531+

}),

1532+

).rejects.toMatchObject({ name: "AbortError" });

1533+1534+

expect(hoisted.acquireSessionWriteLockMock).not.toHaveBeenCalled();

1535+

});

1536+1537+

it("disposes prep runtimes after aborting before the session write lock", async () => {

1538+

const abortController = new AbortController();

1539+

const lspDispose = vi.fn(async () => {});

1540+

hoisted.createBundleLspToolRuntimeMock.mockImplementationOnce(async () => {

1541+

abortController.abort();

1542+

return {

1543+

tools: [],

1544+

dispose: lspDispose,

1545+

};

1546+

});

1547+1548+

await expect(

1549+

createContextEngineAttemptRunner({

1550+

contextEngine: createContextEngineBootstrapAndAssemble(),

1551+

sessionKey,

1552+

tempPaths,

1553+

attemptOverrides: {

1554+

abortSignal: abortController.signal,

1555+

disableTools: false,

1556+

toolsAllow: ["*"],

1557+

},

1558+

}),

1559+

).rejects.toMatchObject({ name: "AbortError" });

1560+1561+

expect(hoisted.acquireSessionWriteLockMock).not.toHaveBeenCalled();

1562+

expect(hoisted.createBundleLspToolRuntimeMock).toHaveBeenCalledTimes(1);

1563+

expect(lspDispose).toHaveBeenCalledTimes(1);

1564+

});

1565+1566+

it("stops session setup when aborting after the session write lock", async () => {

1567+

const abortController = new AbortController();

1568+

const { bootstrap, assemble } = createContextEngineBootstrapAndAssemble();

1569+

hoisted.sessionManagerOpenMock.mockImplementationOnce(() => {

1570+

abortController.abort();

1571+

return hoisted.sessionManager;

1572+

});

1573+1574+

await expect(

1575+

createContextEngineAttemptRunner({

1576+

contextEngine: createTestContextEngine({ bootstrap, assemble }),

1577+

sessionKey,

1578+

tempPaths,

1579+

attemptOverrides: { abortSignal: abortController.signal },

1580+

}),

1581+

).rejects.toMatchObject({ name: "AbortError" });

1582+1583+

expect(hoisted.acquireSessionWriteLockMock).toHaveBeenCalledTimes(1);

1584+

expect(bootstrap).not.toHaveBeenCalled();

1585+

expect(assemble).not.toHaveBeenCalled();

1586+

expect(hoisted.createAgentSessionMock).not.toHaveBeenCalled();

1587+

});

1588+1589+

it("does not submit a prompt after aborting a created session", async () => {

1590+

const abortController = new AbortController();

1591+

const sessionPrompt = vi.fn(async () => {});

1592+

hoisted.subscribeEmbeddedPiSessionMock.mockImplementationOnce(() => {

1593+

abortController.abort();

1594+

return createSubscriptionMock();

1595+

});

1596+1597+

await expect(

1598+

createContextEngineAttemptRunner({

1599+

contextEngine: createContextEngineBootstrapAndAssemble(),

1600+

sessionKey,

1601+

tempPaths,

1602+

createSession: () =>

1603+

createDefaultEmbeddedSession({

1604+

initialMessages: [seedMessage],

1605+

prompt: sessionPrompt,

1606+

}),

1607+

attemptOverrides: { abortSignal: abortController.signal },

1608+

}),

1609+

).rejects.toMatchObject({ name: "AbortError" });

1610+1611+

expect(sessionPrompt).not.toHaveBeenCalled();

1612+

});

1613+15171614

it("forwards modelId to assemble", async () => {

15181615

const { bootstrap, assemble } = createContextEngineBootstrapAndAssemble();

15191616

const contextEngine = createTestContextEngine({ bootstrap, assemble });