- 
                Notifications
    
You must be signed in to change notification settings  - Fork 34
 
feat(cctx): non-interactive flag #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -5,6 +5,7 @@ import { DEFAULT_DELAY, DEFAULT_TIMEOUT } from "../../constants/commands/cctx"; | |
| export const cctxOptionsSchema = z.object({ | ||
| delay: z.coerce.number().int().positive().default(DEFAULT_DELAY), | ||
| hash: z.string(), | ||
| interactive: z.coerce.boolean(), | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Property name mismatch and missing default will cause validation failure. The CLI flag is defined as  Additionally, the field has no default value, meaning validation will fail when the flag is not provided. Apply this diff to fix the issues: -  interactive: z.coerce.boolean(),
+  nonInteractive: z.coerce.boolean().default(false),Then update the logic in  const timeout = options.nonInteractive ? 5000 : options.timeout;Alternatively, if you prefer to keep the schema property as  .option("--interactive", "Run in interactive mode (default).", true)🤖 Prompt for AI Agents | 
||
| rpc: z.string(), | ||
| timeout: z.coerce.number().int().min(0).default(DEFAULT_TIMEOUT), | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Property name mismatch prevents this logic from working.
This code attempts to destructure
interactivefrom options, but the schema validation (line 8 in src/schemas/commands/cctx.ts) and CLI flag (line 337) create a property namednonInteractiveinstead. This will result ininteractivebeingundefined.After applying the fix suggested in src/schemas/commands/cctx.ts, update this code to:
📝 Committable suggestion
🤖 Prompt for AI Agents