Skip to content

Commit a8df6e4

Browse files
authored
fix(qa): tolerate loaded-runner bus delivery stalls (#116448)
1 parent 1e45f7e commit a8df6e4

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎extensions/qa-channel/src/bus-client.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ describe("qa-bus client", () => {
321321
}),
322322
).rejects.toMatchObject({ name: "AbortError", cause: { name: "TimeoutError" } });
323323
expect(timeoutSpy).toHaveBeenCalledTimes(1);
324-
expect(timeoutSpy).toHaveBeenCalledWith(10_000);
324+
expect(timeoutSpy).toHaveBeenCalledWith(30_000);
325325
});
326326

327327
it("bounds message responses that stall after headers", async () => {
@@ -360,7 +360,7 @@ describe("qa-bus client", () => {
360360
timeout.abort(new DOMException("qa-bus request timed out", "TimeoutError"));
361361
await rejection;
362362
expect(timeoutSpy).toHaveBeenCalledTimes(1);
363-
expect(timeoutSpy).toHaveBeenCalledWith(10_000);
363+
expect(timeoutSpy).toHaveBeenCalledWith(30_000);
364364
});
365365

366366
it("keeps long polls within the server wait window plus response grace", async () => {

‎extensions/qa-channel/src/bus-client.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ type JsonResult<T> = Promise<T>;
4848
const QA_BUS_JSON_RESPONSE_MAX_BYTES = 16 * 1024 * 1024;
4949
/** Total deadline for local qa-bus POST requests and long-poll response grace. */
5050
const QA_BUS_REQUEST_TIMEOUT_MS = 10_000;
51+
// Final replies can contend with CPU-heavy QA lanes on the shared release
52+
// runner. Keep delivery inside the outer turn budget without treating a brief
53+
// local scheduling stall as a channel failure.
54+
const QA_BUS_MESSAGE_REQUEST_TIMEOUT_MS = 30_000;
5155
/** Total deadline for local qa-bus state requests. */
5256
const QA_BUS_STATE_TIMEOUT_MS = 10_000;
5357

@@ -190,7 +194,9 @@ export async function sendQaBusMessage(params: {
190194
attachments?: import("./protocol.js").QaBusAttachment[];
191195
toolCalls?: QaBusToolCall[];
192196
}) {
193-
return await postJson<{ message: QaBusMessage }>(params.baseUrl, "/v1/outbound/message", params);
197+
return await postJson<{ message: QaBusMessage }>(params.baseUrl, "/v1/outbound/message", params, {
198+
timeoutMs: QA_BUS_MESSAGE_REQUEST_TIMEOUT_MS,
199+
});
194200
}
195201

196202
export async function createQaBusThread(params: {

0 commit comments

Comments
 (0)