Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/execution/assets/v8-bridge.source.js
Original file line number Diff line number Diff line change
Expand Up @@ -16477,6 +16477,8 @@ ${headerLines}\r
}
validateHttp2ConnectOptions(options);
const socketId = options.createConnection ? resolveHttp2SocketId(options.createConnection()) : void 0;
const rawPort = options.port ?? authority.port;
const port = rawPort === "" || rawPort === void 0 || rawPort === null ? void 0 : Number(rawPort);
const response = JSON.parse(
_networkHttp2SessionConnectRaw.applySyncPromise(
void 0,
Expand All @@ -16485,7 +16487,7 @@ ${headerLines}\r
authority: authority.toString(),
protocol: authority.protocol,
host: options.host ?? options.hostname ?? authority.hostname,
port: options.port ?? authority.port,
port,
localAddress: options.localAddress,
family: options.family,
socketId,
Expand Down
17 changes: 17 additions & 0 deletions packages/core/src/sidecar-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,23 @@ export class SidecarProcess {
return this.protocolClient.onEvent(handler);
}

/**
* Subscribe to the sidecar process's stderr (live). The sidecar re-emits the
* in-VM agent adapter's stderr on this channel (tagged "ACP adapter stderr"),
* so this is how embedders route adapter logs to their own logger. Coexists
* with the internal stderr buffering used for exit diagnostics. Returns an
* unsubscribe function.
*/
onStderr(handler: (chunk: Buffer) => void): () => void {
const onData = (chunk: Buffer | string) => {
handler(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
};
this.protocolClient.child.stderr.on("data", onData);
return () => {
this.protocolClient.child.stderr.off("data", onData);
};
}

async authenticateAndOpenSession(
sessionMetadata: Record<string, string> = {},
): Promise<AuthenticatedSession> {
Expand Down
Loading