fix: scope nested agent lanes per target session (#67785) (thanks @stainlu)

* fix(agents): scope nested lane per target session to stop cross-agent blocking

* docs(agents): note per-session nested-lane lifecycle parity with session:* lanes

* refactor(agents): distill nested lane helpers

* fix: scope nested agent lanes per target session (#67785) (thanks @stainlu)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
This commit is contained in:
stain lu
2026-04-19 10:28:55 +08:00
committed by GitHub
parent 67bd9edd8b
commit 4da808da50
10 changed files with 119 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ import {
import type { OutboundSessionContext } from "../../infra/outbound/session-context.js";
import type { RuntimeEnv } from "../../runtime.js";
import { isInternalMessageChannel } from "../../utils/message-channel.js";
import { AGENT_LANE_NESTED } from "../lanes.js";
import { isNestedAgentLane } from "../lanes.js";
import type { AgentCommandOpts } from "./types.js";
type RunResult = Awaited<ReturnType<(typeof import("../pi-embedded.js"))["runEmbeddedPiAgent"]>>;
@@ -351,7 +351,7 @@ export async function deliverAgentCommandResult(params: {
if (!output) {
return;
}
if (opts.lane === AGENT_LANE_NESTED) {
if (isNestedAgentLane(opts.lane)) {
logNestedOutput(runtime, opts, output, effectiveSessionKey);
return;
}