test: allow slow packaged agent acceptance

This commit is contained in:
Peter Steinberger
2026-04-29 10:11:57 +01:00
parent f5e7557c70
commit 04c650c2c4
2 changed files with 22 additions and 14 deletions

View File

@@ -205,17 +205,21 @@ async function runSubagentCleanupScenario(params: {
const { gateway, pidPath, pidsPath, exitPath } = params;
await resetProbeFiles({ pidPath, pidsPath, exitPath });
const run = await gateway.request<AgentRunResult>("agent", {
message: "Use available context and then stop.",
sessionKey: `agent:main:subagent:docker-${randomUUID()}`,
agentId: "main",
lane: "subagent",
cleanupBundleMcpOnRunEnd: true,
idempotencyKey: randomUUID(),
deliver: false,
timeout: 90,
bestEffortDeliver: true,
});
const run = await gateway.request<AgentRunResult>(
"agent",
{
message: "Use available context and then stop.",
sessionKey: `agent:main:subagent:docker-${randomUUID()}`,
agentId: "main",
lane: "subagent",
cleanupBundleMcpOnRunEnd: true,
idempotencyKey: randomUUID(),
deliver: false,
timeout: 90,
bestEffortDeliver: true,
},
{ timeoutMs: 240_000 },
);
assert(
run.status === "accepted" && run.runId,
`agent did not accept subagent cleanup run: ${JSON.stringify(run)}`,

View File

@@ -33,7 +33,7 @@ export const ClaudePermissionNotificationSchema = z.object({
export type ClaudeChannelNotification = z.infer<typeof ClaudeChannelNotificationSchema>["params"];
export type GatewayRpcClient = {
request<T>(method: string, params?: unknown): Promise<T>;
request<T>(method: string, params?: unknown, opts?: { timeoutMs?: number }): Promise<T>;
events: Array<{ event: string; payload: Record<string, unknown> }>;
close(): Promise<void>;
};
@@ -266,8 +266,12 @@ async function connectGatewayOnce(params: {
await sendGatewayRequest("sessions.subscribe", {}, GATEWAY_RPC_TIMEOUT_MS);
return {
request(method, requestParams) {
return sendGatewayRequest(method, requestParams, GATEWAY_REQUEST_TIMEOUT_MS);
request(method, requestParams, opts) {
return sendGatewayRequest(
method,
requestParams,
opts?.timeoutMs ?? GATEWAY_REQUEST_TIMEOUT_MS,
);
},
events,
async close() {