revert: fix rpc stdout backpressure

This reverts commit d0d1d8edca.
This commit is contained in:
Armin Ronacher
2026-05-24 11:50:53 +02:00
parent d0d1d8edca
commit 9600ded922
6 changed files with 79 additions and 133 deletions

View File

@@ -100,9 +100,9 @@ export async function runPrintMode(runtimeHost: AgentSessionRuntime, options: Pr
});
unsubscribe?.();
unsubscribe = session.subscribe(async (event) => {
unsubscribe = session.subscribe((event) => {
if (mode === "json") {
await writeRawStdout(`${JSON.stringify(event)}\n`);
writeRawStdout(`${JSON.stringify(event)}\n`);
}
});
};
@@ -111,7 +111,7 @@ export async function runPrintMode(runtimeHost: AgentSessionRuntime, options: Pr
if (mode === "json") {
const header = session.sessionManager.getHeader();
if (header) {
await writeRawStdout(`${JSON.stringify(header)}\n`);
writeRawStdout(`${JSON.stringify(header)}\n`);
}
}
@@ -137,7 +137,7 @@ export async function runPrintMode(runtimeHost: AgentSessionRuntime, options: Pr
} else {
for (const content of assistantMsg.content) {
if (content.type === "text") {
await writeRawStdout(`${content.text}\n`);
writeRawStdout(`${content.text}\n`);
}
}
}