From 8b97f5c01641ddec3c6cbcfac12c703c6cc73f8a Mon Sep 17 00:00:00 2001 From: 777genius Date: Tue, 19 May 2026 20:55:13 +0300 Subject: [PATCH] test: cover bootstrap submitted diagnostics --- .../team/TeamLaunchFailureArtifactPack.ts | 4 +- .../TeamLaunchFailureArtifactPack.test.ts | 45 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/main/services/team/TeamLaunchFailureArtifactPack.ts b/src/main/services/team/TeamLaunchFailureArtifactPack.ts index 72ca4332..b623fa20 100644 --- a/src/main/services/team/TeamLaunchFailureArtifactPack.ts +++ b/src/main/services/team/TeamLaunchFailureArtifactPack.ts @@ -240,6 +240,8 @@ const MODEL_NO_BOOTSTRAP_PATTERN = new RegExp( 'bootstrap not confirmed', 'check-in not yet received', 'bootstrap_stalled', + 'did not submit bootstrap prompt', + 'bootstrap_submit_accepted_without_uuid', 'timed out waiting for bootstrap_submitted', 'last transport stage:\\s*(?:mailbox_bootstrap_written|bootstrap_prompt_observed|bootstrap_submit_attempted|bootstrap_submitted)', ].join('|'), @@ -346,7 +348,7 @@ export function extractLaunchBootstrapTransportBreadcrumb( retryable: retryableRaw === 'true' ? true : retryableRaw === 'false' ? false : null, noStdinWarning: /no stdin data received|proceeding without it/i.test(combined), bootstrapSubmitted: - /(?:event["']?\s*:\s*["']bootstrap_submitted["']|bootstrap_submit_accepted|bootstrap submitted)/i.test( + /(?:(?:event|type)["']?\s*[:=]\s*["']bootstrap_submitted["']|bootstrap_submit_accepted|bootstrap submitted)/i.test( combined ), evidence, diff --git a/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts b/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts index 967eb163..ab335a11 100644 --- a/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts +++ b/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts @@ -265,6 +265,51 @@ describe('TeamLaunchFailureArtifactPack', () => { }); }); + it('keeps submitted bootstrap prompts out of stdin_missing classification while waiting for confirmation', () => { + const input = { + teamName: 'artifact-team', + runId: 'run-submitted-no-confirm', + reason: + 'alice: Teammate was registered but did not bootstrap-confirm before timeout. Last transport stage: bootstrap_submitted: messageId=bootstrap-alice-1 Last stderr: Warning: no stdin data received in 3s, proceeding without it.', + progressTraceLines: [ + 'mailbox_bootstrap_written detail=messageId=bootstrap-alice-1', + 'bootstrap_submit_attempted detail=submitting bootstrap prompt', + 'event="bootstrap_submitted" detail=messageId=bootstrap-alice-1', + 'Warning: no stdin data received in 3s, proceeding without it.', + ], + }; + + expect(classifyLaunchFailureArtifact(input).code).toBe('model_no_bootstrap'); + expect(extractLaunchBootstrapTransportBreadcrumb(input)).toMatchObject({ + lastTransportStage: expect.stringContaining( + 'bootstrap_submitted: messageId=bootstrap-alice-1' + ), + noStdinWarning: true, + bootstrapSubmitted: true, + }); + }); + + it('classifies accepted-without-uuid bootstrap submit failures as transport evidence', () => { + const input = { + teamName: 'artifact-team', + runId: 'run-submit-accepted-without-uuid', + reason: + 'jack: Teammate process jack@signal-ops did not submit bootstrap prompt: teammate runtime failed before bootstrap_submitted (bootstrap_submit_accepted_without_uuid) Last stderr: Warning: no stdin data received in 3s, proceeding without it.', + progressTraceLines: [ + 'mailbox_bootstrap_written detail=messageId=bootstrap-jack-1', + 'bootstrap_submit_attempted detail=submitting bootstrap prompt', + 'bootstrap_submit_accepted_without_uuid detail=submit accepted without userMessageUuid', + 'Warning: no stdin data received in 3s, proceeding without it.', + ], + }; + + expect(classifyLaunchFailureArtifact(input).code).toBe('model_no_bootstrap'); + expect(extractLaunchBootstrapTransportBreadcrumb(input)).toMatchObject({ + noStdinWarning: true, + bootstrapSubmitted: true, + }); + }); + it('classifies provider quota separately from protocol errors', () => { expect( classifyLaunchFailureArtifact({