mirror of
https://github.com/stablyai/orca.git
synced 2026-11-04 02:57:36 +00:00
* 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>
20 lines
711 B
TypeScript
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
|
|
}
|