fix(team): recognize submitted bootstrap timeout
This commit is contained in:
parent
e041ac344c
commit
1ff302aa68
3 changed files with 38 additions and 7 deletions
|
|
@ -1,7 +1,4 @@
|
||||||
import {
|
import { stripProcessTableUnavailableDiagnosticSuffix } from '@shared/utils/teamLaunchFailureReason';
|
||||||
isProvisionedButNotAliveFailureReason,
|
|
||||||
stripProcessTableUnavailableDiagnosticSuffix,
|
|
||||||
} from '@shared/utils/teamLaunchFailureReason';
|
|
||||||
|
|
||||||
import { mentionsProcessTableUnavailable } from './TeamProvisioningLaunchDiagnostics';
|
import { mentionsProcessTableUnavailable } from './TeamProvisioningLaunchDiagnostics';
|
||||||
import { isBootstrapInstructionPrompt } from './TeamProvisioningPromptBuilders';
|
import { isBootstrapInstructionPrompt } from './TeamProvisioningPromptBuilders';
|
||||||
|
|
@ -72,7 +69,20 @@ export function isBootstrapMcpResourceReadFailureReason(reason?: string): boolea
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isBootstrapCheckInTimeoutFailureReason(reason?: string): boolean {
|
export function isBootstrapCheckInTimeoutFailureReason(reason?: string): boolean {
|
||||||
return reason?.trim() === 'Teammate was registered but did not bootstrap-confirm before timeout.';
|
const text = reason?.trim();
|
||||||
|
if (!text) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (text === 'Teammate was registered but did not bootstrap-confirm before timeout.') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const normalized = text.toLowerCase();
|
||||||
|
return (
|
||||||
|
normalized.includes('bootstrap prompt was submitted') &&
|
||||||
|
normalized.includes('did not bootstrap-confirm') &&
|
||||||
|
normalized.includes('submitted-confirmation timeout') &&
|
||||||
|
normalized.includes('last transport stage: bootstrap_submitted')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isBootstrapInstructionPromptFailureReason(reason?: string): boolean {
|
export function isBootstrapInstructionPromptFailureReason(reason?: string): boolean {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import {
|
||||||
isAutoClearableLaunchFailureReason,
|
isAutoClearableLaunchFailureReason,
|
||||||
isBootstrapCheckInTimeoutFailureReason,
|
isBootstrapCheckInTimeoutFailureReason,
|
||||||
isBootstrapInstructionPromptFailureReason,
|
isBootstrapInstructionPromptFailureReason,
|
||||||
isCliProvisionedButNotAliveFailureReason,
|
|
||||||
isBootstrapMcpResourceReadFailureReason,
|
isBootstrapMcpResourceReadFailureReason,
|
||||||
|
isCliProvisionedButNotAliveFailureReason,
|
||||||
isConfigRegistrationFailureReason,
|
isConfigRegistrationFailureReason,
|
||||||
isLaunchCleanupBootstrapIncompleteFailureReason,
|
isLaunchCleanupBootstrapIncompleteFailureReason,
|
||||||
isLaunchGraceWindowFailureReason,
|
isLaunchGraceWindowFailureReason,
|
||||||
|
|
@ -68,6 +68,16 @@ describe('TeamProvisioningLaunchFailurePolicy', () => {
|
||||||
'Teammate was registered but did not bootstrap-confirm before timeout.'
|
'Teammate was registered but did not bootstrap-confirm before timeout.'
|
||||||
)
|
)
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
isBootstrapCheckInTimeoutFailureReason(
|
||||||
|
'Bootstrap prompt was submitted, but teammate did not bootstrap-confirm before submitted-confirmation timeout (3m). Last transport stage: bootstrap_submitted'
|
||||||
|
)
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
isBootstrapCheckInTimeoutFailureReason(
|
||||||
|
'Bootstrap prompt was submitted, but teammate did not bootstrap-confirm before timeout.'
|
||||||
|
)
|
||||||
|
).toBe(false);
|
||||||
expect(
|
expect(
|
||||||
isBootstrapInstructionPromptFailureReason(
|
isBootstrapInstructionPromptFailureReason(
|
||||||
'You are bootstrapping into team atlas. Your first action is to call the MCP tool member_briefing.'
|
'You are bootstrapping into team atlas. Your first action is to call the MCP tool member_briefing.'
|
||||||
|
|
@ -107,6 +117,16 @@ describe('TeamProvisioningLaunchFailurePolicy', () => {
|
||||||
'Teammate did not join within the launch grace window.; process table unavailable'
|
'Teammate did not join within the launch grace window.; process table unavailable'
|
||||||
)
|
)
|
||||||
).toBe(true);
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
isAutoClearableLaunchFailureReason(
|
||||||
|
'Bootstrap prompt was submitted, but teammate did not bootstrap-confirm before submitted-confirmation timeout (3m). Last transport stage: bootstrap_submitted'
|
||||||
|
)
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
isAutoClearableLaunchFailureReason(
|
||||||
|
'Bootstrap prompt was submitted, but teammate did not bootstrap-confirm before timeout.'
|
||||||
|
)
|
||||||
|
).toBe(false);
|
||||||
expect(
|
expect(
|
||||||
isAutoClearableLaunchFailureReason(
|
isAutoClearableLaunchFailureReason(
|
||||||
'CLI process exited (code 1) \u2014 team provisioned but not alive'
|
'CLI process exited (code 1) \u2014 team provisioned but not alive'
|
||||||
|
|
|
||||||
|
|
@ -21421,7 +21421,8 @@ describe('TeamProvisioningService', () => {
|
||||||
status: 'failed',
|
status: 'failed',
|
||||||
lastAttemptAt: Date.parse(acceptedAt),
|
lastAttemptAt: Date.parse(acceptedAt),
|
||||||
lastObservedAt: Date.parse(failureAt),
|
lastObservedAt: Date.parse(failureAt),
|
||||||
failureReason: 'Teammate was registered but did not bootstrap-confirm before timeout.',
|
failureReason:
|
||||||
|
'Bootstrap prompt was submitted, but teammate did not bootstrap-confirm before submitted-confirmation timeout (3m). Last transport stage: bootstrap_submitted',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
failureAt
|
failureAt
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue