fix(coding-agent): add settled agent lifecycle event

closes #6363
This commit is contained in:
Mario Zechner
2026-07-09 12:40:52 +02:00
parent 050b8176bf
commit e9fa5a68a1
14 changed files with 272 additions and 32 deletions
@@ -319,7 +319,7 @@ export async function runRpcMode(runtimeHost: AgentSessionRuntime): Promise<neve
uiContext: createExtensionUIContext(),
mode: "rpc",
commandContextActions: {
waitForIdle: () => session.agent.waitForIdle(),
waitForIdle: () => session.waitForIdle(),
newSession: async (options) => runtimeHost.newSession(options),
fork: async (entryId, forkOptions) => {
const result = await runtimeHost.fork(entryId, forkOptions);
@@ -353,6 +353,9 @@ export async function runRpcMode(runtimeHost: AgentSessionRuntime): Promise<neve
unsubscribeBackpressure?.();
unsubscribe = session.subscribe((event) => {
output(event);
if (event.type === "agent_settled") {
void checkShutdownRequested();
}
});
unsubscribeBackpressure = session.agent.subscribe(async () => {
await waitForRawStdoutBackpressure();