Skip to content

Commit 41cf69d

Browse files
committed
fix: don't save consent when using --userWarning=false
1 parent bb56819 commit 41cf69d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ mycoder config set model claude-3-7-sonnet-20250219 # or any other Anthropic mo
114114

115115
These options are available only as command-line parameters and are not stored in the configuration:
116116

117-
- `userWarning`: Disable user consent check for automated/remote usage (default: `true`)
117+
- `userWarning`: Skip user consent check for current session without saving consent (default: `true`)
118118
- `upgradeCheck`: Disable version upgrade check for automated/remote usage (default: `true`)
119119
- `userPrompt`/`enableUserPrompt`: Enable or disable the userPrompt tool (default: `true`)
120120

packages/cli/src/commands/$default.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
8686
throw new Error('User did not consent');
8787
}
8888
} else if (!hasUserConsented() && argv.userWarning === false) {
89-
// Auto-save consent when userWarning is false
89+
// Just skip the consent check without saving consent when userWarning is false
9090
logger.debug('Skipping user consent check due to --userWarning=false');
91-
saveUserConsent();
91+
// Note: We don't save consent here, just bypassing the check for this session
9292
}
9393

9494
const tokenTracker = new TokenTracker(

packages/cli/src/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export const sharedOptions = {
111111
} as const,
112112
userWarning: {
113113
type: 'boolean',
114-
description: 'Disable user consent check (for automated/remote usage)',
114+
description:
115+
'Skip user consent check for current session (does not save consent)',
115116
default: false,
116117
} as const,
117118
upgradeCheck: {

0 commit comments

Comments
 (0)