Files
orca/src/cli/retry-request-flag.ts
T
Neil c10881fa8c refactor(shared): organize execution and automation defining owners (#39776)
* refactor: import journal queue state from defining owners

* refactor(shared): organize execution and automation owners

* fix: retain type imports used by surviving test cases

* refactor: finish work item owners and refresh validation metadata

* test: infer reconnect status fixture type

* test(claude): resolve source files beside same-named directories

* test(runtime): group repository creation mock registrations
2026-11-08 06:46:09 -08:00

20 lines
725 B
TypeScript

import { rejectValuelessFlag } from './flags'
import { RuntimeClientError } from './runtime/types'
import {
isOrchestrationRetryRequestId,
RETRY_REQUEST_ID_GUIDANCE
} from '../shared/orchestration/orchestration-retry-request-id'
/** Reject damaged identities: falling back to a fresh id could replay an already-applied mutation. */
export function readRetryRequestFlag(flags: Map<string, string | boolean>): string | undefined {
const value = flags.get('retry-request')
rejectValuelessFlag(value, 'retry-request')
if (value === undefined) {
return undefined
}
if (!isOrchestrationRetryRequestId(value)) {
throw new RuntimeClientError('invalid_argument', RETRY_REQUEST_ID_GUIDANCE)
}
return value
}