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

推荐订阅源

P
Proofpoint News Feed
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
量子位
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园_首页
IT之家
IT之家
V
Visual Studio Blog
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
D
Docker
V
V2EX

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: enforce focus subagent scope (#73613) · openclaw/ope...
drobison00 · 2026-04-29 · via Recent Commits to openclaw:main

@@ -15,6 +15,7 @@ const hoisted = vi.hoisted(() => ({

1515

readAcpSessionEntryMock: vi.fn(),

1616

resolveConversationBindingContextMock: vi.fn(),

1717

resolveFocusTargetSessionMock: vi.fn(),

18+

resolveStoredSubagentCapabilitiesMock: vi.fn(),

1819

sessionBindingCapabilitiesMock: vi.fn(),

1920

sessionBindingBindMock: vi.fn(),

2021

sessionBindingResolveByConversationMock: vi.fn(),

@@ -102,6 +103,11 @@ vi.mock("../../infra/outbound/session-binding-service.js", () => ({

102103

getSessionBindingService: () => buildFocusSessionBindingService(),

103104

}));

104105106+

vi.mock("../../agents/subagent-capabilities.js", () => ({

107+

resolveStoredSubagentCapabilities: (sessionKey: string, options: unknown) =>

108+

hoisted.resolveStoredSubagentCapabilitiesMock(sessionKey, options),

109+

}));

110+105111

vi.mock("./conversation-binding-input.js", () => ({

106112

resolveConversationBindingContextFromAcpCommand: (params: unknown) =>

107113

hoisted.resolveConversationBindingContextMock(params),

@@ -195,6 +201,7 @@ function buildFocusContext(params?: {

195201

chatType?: string;

196202

senderId?: string;

197203

token?: string;

204+

requesterKey?: string;

198205

}) {

199206

return {

200207

params: buildCommandParams({

@@ -203,7 +210,7 @@ function buildFocusContext(params?: {

203210

senderId: params?.senderId,

204211

}),

205212

handledPrefix: "/focus",

206-

requesterKey: "agent:main:main",

213+

requesterKey: params?.requesterKey ?? "agent:main:main",

207214

runs: [],

208215

restTokens: [params?.token ?? "codex-acp"],

209216

} satisfies Parameters<typeof handleSubagentsFocusAction>[0];

@@ -224,6 +231,9 @@ function buildUnfocusContext(params?: { senderId?: string }) {

224231

describe("focus actions", () => {

225232

beforeEach(() => {

226233

vi.clearAllMocks();

234+

hoisted.resolveStoredSubagentCapabilitiesMock.mockReturnValue({

235+

controlScope: "children",

236+

});

227237

hoisted.sessionBindingCapabilitiesMock.mockReturnValue(createSessionBindingCapabilities());

228238

hoisted.sessionBindingResolveByConversationMock.mockReturnValue(null);

229239

hoisted.resolveFocusTargetSessionMock.mockResolvedValue({

@@ -278,6 +288,11 @@ describe("focus actions", () => {

278288279289

expect(result.reply?.text).toContain("bound this conversation");

280290

expect(result.reply?.text).toContain("(acp)");

291+

expect(hoisted.resolveFocusTargetSessionMock).toHaveBeenCalledWith(

292+

expect.objectContaining({

293+

requesterKey: "agent:main:main",

294+

}),

295+

);

281296

expect(hoisted.sessionBindingBindMock).toHaveBeenCalledWith(

282297

expect.objectContaining({

283298

placement: "current",

@@ -291,6 +306,29 @@ describe("focus actions", () => {

291306

);

292307

});

293308309+

it("rejects /focus from a leaf subagent", async () => {

310+

hoisted.resolveStoredSubagentCapabilitiesMock.mockReturnValue({

311+

controlScope: "none",

312+

});

313+

hoisted.resolveConversationBindingContextMock.mockReturnValue({

314+

channel: THREAD_CHANNEL,

315+

accountId: "default",

316+

conversationId: "thread-1",

317+

parentConversationId: "parent-1",

318+

threadId: "thread-1",

319+

});

320+321+

const result = await handleSubagentsFocusAction(

322+

buildFocusContext({

323+

requesterKey: "agent:main:subagent:leaf-a",

324+

}),

325+

);

326+327+

expect(result.reply?.text).toContain("Leaf subagents cannot control other sessions.");

328+

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

329+

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

330+

});

331+294332

it("binds topic-chat topics as current conversations", async () => {

295333

hoisted.resolveConversationBindingContextMock.mockReturnValue({

296334

channel: TOPIC_CHANNEL,