test: cover launch bootstrap diagnostics regressions

This commit is contained in:
777genius 2026-05-19 20:32:41 +03:00
parent c695616ca8
commit 0f5b819aed
2 changed files with 98 additions and 1 deletions

View file

@ -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: {

View file

@ -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({