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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
博客园 - Franky
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
量子位
雷峰网
雷峰网
宝玉的分享
宝玉的分享
V
Visual Studio Blog
博客园_首页
小众软件
小众软件
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
S
SegmentFault 最新的问题
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学

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): keep session tool mirrors under pressure · ...
steipete · 2026-05-25 · via Recent Commits to openclaw:main

@@ -79,7 +79,6 @@ describe("agent event handler", () => {

7979

resolveSessionKeyForRun?: (runId: string) => string | undefined;

8080

lifecycleErrorRetryGraceMs?: number;

8181

isChatSendRunActive?: (runId: string) => boolean;

82-

shouldBackoffLowPrioritySessionToolEvents?: () => boolean;

8382

}) {

8483

const nowSpy =

8584

params?.now === undefined ? undefined : vi.spyOn(Date, "now").mockReturnValue(params.now);

@@ -107,7 +106,6 @@ describe("agent event handler", () => {

107106

loadGatewaySessionRowForSnapshot: loadGatewaySessionRow,

108107

lifecycleErrorRetryGraceMs: params?.lifecycleErrorRetryGraceMs,

109108

isChatSendRunActive: params?.isChatSendRunActive,

110-

shouldBackoffLowPrioritySessionToolEvents: params?.shouldBackoffLowPrioritySessionToolEvents,

111109

});

112110113111

return {

@@ -1564,96 +1562,6 @@ describe("agent event handler", () => {

15641562

);

15651563

});

156615641567-

it("backs off session-scoped tool mirrors during queued gateway pressure", () => {

1568-

const { broadcastToConnIds, sessionEventSubscribers, toolEventRecipients, handler } =

1569-

createHarness({

1570-

resolveSessionKeyForRun: () => "session-pressure",

1571-

shouldBackoffLowPrioritySessionToolEvents: () => true,

1572-

});

1573-1574-

registerAgentRunContext("run-pressure-tool", {

1575-

sessionKey: "session-pressure",

1576-

verboseLevel: "off",

1577-

});

1578-

toolEventRecipients.add("run-pressure-tool", "conn-run");

1579-

sessionEventSubscribers.subscribe("conn-session");

1580-1581-

handler({

1582-

runId: "run-pressure-tool",

1583-

seq: 1,

1584-

stream: "tool",

1585-

ts: 1_234,

1586-

data: {

1587-

phase: "start",

1588-

name: "exec",

1589-

toolCallId: "tool-pressure-1",

1590-

args: { command: "echo hi" },

1591-

},

1592-

});

1593-1594-

expect(broadcastToConnIds).toHaveBeenCalledTimes(1);

1595-

expect(requireMockArg(broadcastToConnIds, 0, 0, "run tool event")).toBe("agent");

1596-

expect(requireMockArg(broadcastToConnIds, 0, 2, "run tool recipients")).toEqual(

1597-

new Set(["conn-run"]),

1598-

);

1599-

});

1600-1601-

it("keeps terminal session-scoped tool mirrors during queued gateway pressure", () => {

1602-

let backoffActive = false;

1603-

const { broadcastToConnIds, sessionEventSubscribers, handler } = createHarness({

1604-

resolveSessionKeyForRun: () => "session-pressure-terminal",

1605-

shouldBackoffLowPrioritySessionToolEvents: () => backoffActive,

1606-

});

1607-1608-

registerAgentRunContext("run-pressure-terminal-tool", {

1609-

sessionKey: "session-pressure-terminal",

1610-

verboseLevel: "off",

1611-

});

1612-

sessionEventSubscribers.subscribe("conn-session");

1613-1614-

handler({

1615-

runId: "run-pressure-terminal-tool",

1616-

seq: 1,

1617-

stream: "tool",

1618-

ts: 1_234,

1619-

data: {

1620-

phase: "start",

1621-

name: "exec",

1622-

toolCallId: "tool-pressure-terminal-1",

1623-

args: { command: "echo hi" },

1624-

},

1625-

});

1626-1627-

backoffActive = true;

1628-

handler({

1629-

runId: "run-pressure-terminal-tool",

1630-

seq: 2,

1631-

stream: "tool",

1632-

ts: 1_235,

1633-

data: {

1634-

phase: "result",

1635-

name: "exec",

1636-

toolCallId: "tool-pressure-terminal-1",

1637-

result: { content: [{ type: "text", text: "done" }] },

1638-

},

1639-

});

1640-1641-

expect(broadcastToConnIds).toHaveBeenCalledTimes(2);

1642-

expect(requireMockArg(broadcastToConnIds, 0, 0, "session tool start event")).toBe(

1643-

"session.tool",

1644-

);

1645-

expect(requireMockArg(broadcastToConnIds, 1, 0, "session tool result event")).toBe(

1646-

"session.tool",

1647-

);

1648-

const resultPayload = requireMockPayload(broadcastToConnIds, 1, 1, "session tool result");

1649-

expectRecordFields(requireRecord(resultPayload.data, "session tool result data"), {

1650-

phase: "result",

1651-

name: "exec",

1652-

toolCallId: "tool-pressure-terminal-1",

1653-

result: { content: [{ type: "text", text: "done" }] },

1654-

});

1655-

});

1656-16571565

it("suppresses heartbeat tool events for Control UI and verbose node subscribers", () => {

16581566

const {

16591567

broadcastToConnIds,