diff --git a/test/features/anthropic-runtime-profile/resolveAnthropicRuntimeProfile.test.ts b/test/features/anthropic-runtime-profile/resolveAnthropicRuntimeProfile.test.ts index 2191c5dd..6203c9e0 100644 --- a/test/features/anthropic-runtime-profile/resolveAnthropicRuntimeProfile.test.ts +++ b/test/features/anthropic-runtime-profile/resolveAnthropicRuntimeProfile.test.ts @@ -227,6 +227,58 @@ describe('resolveAnthropicRuntimeProfile', () => { }); }); + it('keeps Default effort empty for Anthropic 1M models that do not support effort', () => { + const selection = resolveAnthropicRuntimeSelection({ + source: createAnthropicSource({ + defaultLaunchModel: 'opus[1m]', + models: [ + { + id: 'opus[1m]', + launchModel: 'opus[1m]', + displayName: 'Opus 4.7 (1M)', + hidden: false, + supportedReasoningEfforts: [], + defaultReasoningEffort: null, + inputModalities: ['text', 'image'], + supportsFastMode: false, + supportsPersonality: false, + isDefault: true, + upgrade: false, + source: 'anthropic-models-api', + }, + ], + }), + selectedModel: 'opus[1m]', + limitContext: false, + }); + + expect(selection.supportedEfforts).toEqual([]); + expect(selection.defaultEffort).toBeNull(); + expect( + reconcileAnthropicRuntimeSelections({ + selection, + selectedEffort: '', + selectedFastMode: 'inherit', + providerFastModeDefault: false, + }) + ).toEqual({ + nextEffort: '', + effortResetReason: null, + nextFastMode: 'inherit', + fastModeResetReason: null, + }); + expect( + resolveAnthropicEffortSupport({ + selection, + effort: 'medium', + runtimeCapabilities: createAnthropicSource({ + defaultLaunchModel: 'opus[1m]', + models: [], + }).runtimeCapabilities, + }) + ).toEqual({ kind: 'unsupported-by-catalog', supportedEfforts: [] }); + }); + it('does not reset explicit max or fast while runtime catalog truth is still unavailable', () => { const selection = resolveAnthropicRuntimeSelection({ source: { diff --git a/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts b/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts index ae8265b1..445cef1d 100644 --- a/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts +++ b/test/main/services/team/TeamLaunchFailureArtifactPack.test.ts @@ -1,7 +1,6 @@ import * as fs from 'fs/promises'; import * as os from 'os'; import * as path from 'path'; - import { afterEach, beforeEach, describe, expect, it } from 'vitest'; import { @@ -196,6 +195,52 @@ describe('TeamLaunchFailureArtifactPack', () => { }); }); + it('keeps inbox poller bootstrap stalls out of stdin_missing classification', () => { + const input = { + teamName: 'artifact-team', + runId: 'run-inbox-ready-no-submit', + reason: + 'atlas: Teammate process atlas@signal-ops did not submit bootstrap prompt: timed out waiting for bootstrap_submitted; last transport stage: inbox_poller_ready: initial poll observed bootstrap prompt Last stderr: Warning: no stdin data received in 3s, proceeding without it.', + progressTraceLines: [ + 'mailbox_bootstrap_written detail=messageId=bootstrap-atlas-2', + 'inbox_poller_ready detail=initial poll observed bootstrap prompt', + '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( + 'inbox_poller_ready: initial poll observed bootstrap prompt' + ), + noStdinWarning: true, + bootstrapSubmitted: false, + }); + }); + + it('keeps submit-attempt stalls out of stdin_missing classification', () => { + const input = { + teamName: 'artifact-team', + runId: 'run-submit-attempt-no-submit', + reason: + 'bob: Teammate process bob@signal-ops did not submit bootstrap prompt: timed out waiting for bootstrap_submitted; last transport stage: bootstrap_submit_attempted: submitting bootstrap prompt Last stderr: Warning: no stdin data received in 3s, proceeding without it.', + progressTraceLines: [ + 'mailbox_bootstrap_written detail=messageId=bootstrap-bob-1', + 'bootstrap_submit_attempted detail=submitting bootstrap prompt', + '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_submit_attempted: submitting bootstrap prompt' + ), + noStdinWarning: true, + bootstrapSubmitted: false, + }); + }); + it('classifies provider quota separately from protocol errors', () => { expect( classifyLaunchFailureArtifact({