Files
orca/src/cli/retry-request-flag.ts
T
OrcaWinandOrcaWin 9aa208a4ab [comment audit] Shorten remaining CLI root comments (#32273)
* chore: shorten process-host comments

* chore: audit CLI parsing and host-routing comments

* chore: remove stale host-selector restriction comment

* chore: shorten remaining CLI root comments

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-23 08:07:03 -07:00

20 lines
711 B
TypeScript

import { rejectValuelessFlag } from './flags'
import { RuntimeClientError } from './runtime/types'
import {
isOrchestrationRetryRequestId,
RETRY_REQUEST_ID_GUIDANCE
} from '../shared/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
}