File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,6 +163,24 @@ const parseInlineValueToken = (
163163 return applyCommandValueFlag ( raw , flag , inlineValue )
164164}
165165
166+ const legacyAgentFlagError = ( token : string ) : ParseError | null => {
167+ if ( token === "--claude" ) {
168+ return {
169+ _tag : "InvalidOption" ,
170+ option : token ,
171+ reason : "use --auto=claude"
172+ }
173+ }
174+ if ( token === "--codex" ) {
175+ return {
176+ _tag : "InvalidOption" ,
177+ option : token ,
178+ reason : "use --auto=codex"
179+ }
180+ }
181+ return null
182+ }
183+
166184const parseRawOptionsStep = (
167185 args : ReadonlyArray < string > ,
168186 index : number ,
@@ -181,15 +199,9 @@ const parseRawOptionsStep = (
181199 return { _tag : "ok" , raw : booleanApplied , nextIndex : index + 1 }
182200 }
183201
184- if ( token === "--claude" || token === "--codex" ) {
185- return {
186- _tag : "error" ,
187- error : {
188- _tag : "InvalidOption" ,
189- option : token ,
190- reason : "use --auto=claude or --auto=codex"
191- }
192- }
202+ const deprecatedAgentFlag = legacyAgentFlagError ( token )
203+ if ( deprecatedAgentFlag !== null ) {
204+ return { _tag : "error" , error : deprecatedAgentFlag }
193205 }
194206
195207 if ( ! token . startsWith ( "-" ) ) {
Original file line number Diff line number Diff line change 1- import { randomInt } from "node:crypto"
2-
31import type { PlatformError } from "@effect/platform/Error"
42import * as FileSystem from "@effect/platform/FileSystem"
53import type * as Path from "@effect/platform/Path"
@@ -131,5 +129,5 @@ export const resolveAutoAgentMode = (
131129 return "codex"
132130 }
133131
134- return randomInt ( 0 , 2 ) === 0 ? "claude" : "codex"
132+ return process . hrtime . bigint ( ) % 2n === 0n ? "claude" : "codex"
135133 } )
You can’t perform that action at this time.
0 commit comments