Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve Antigravity startup diagnostics #9839

Closedjuliusmarmingewants to merge 2 commits intomain fromfix/antigravity-validation-diagnosticsopened View on GitHub

Showing 7 changed files with 104 additions and 10 deletions (loading 4).

x
0 of 7 viewed, 7 left
26 additions and 7 deletionsapps/server/src/provider/acp/AcpSessionRuntime.tsModified
View file
@@ -104,6 +104,8 @@
) => EffectAcpSchema.SessionNotification;
/** Receives bounded stderr chunks. Redact secrets before logging. A failure closes the runtime. */
readonly onStderr?: (text: string) => Effect.Effect<void, EffectAcpErrors.AcpError>;
+ /** Flushes diagnostics when stderr ends. Failed initialization drains an exited child's stderr first. */
+ readonly onStderrEnd?: Effect.Effect<void>;
readonly requestLogger?: (event: AcpSessionRequestLogEvent) => Effect.Effect<void, never>;
readonly protocolLogging?: {
readonly logIncoming?: boolean;
@@ -449,13 +451,16 @@
​
- yield* child.stderr.pipe(
+ const stderrFiber = yield* child.stderr.pipe(
Stream.decodeText(),
- Stream.runForEach((chunk) =>
- (options.onStderr
- ? options.onStderr(chunk.slice(-maxStderrChunkLength))
- : Effect.void
- ).pipe(
+ Stream.runForEach(
+ Effect.fn("AcpSessionRuntime.handleStderr")(
+ function* (chunk: string) {
+ if (!options.onStderr) return;
+ for (let offset = 0; offset < chunk.length; offset += maxStderrChunkLength) {
+ yield* options.onStderr(chunk.slice(offset, offset + maxStderrChunkLength));
+ }
+ },