Repository navigation
feat(cli): add --safe-mode flag to disable all customizations for troubleshooting #4943
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
Changes from 3 commits
3d3ecf1
f4e2b3d
f69a198
c8fa93e
4b9706d
c57db62
81bc81a
07ddcba
10c130e
d4f4914
4193772
d15eb4b
fe8bb42
f1eddf4
5777de5
19d4f66
666c3d2
a95f1b2
119eb33
b605f5e
5a7ff3f
5089059
d2615c3
d68167e
3e134b1
d3af1e0
06756d6
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 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -118,8 +118,9 @@ export function MemoryDialog({ onClose }: MemoryDialogProps) { | |||||||||
| // the Config snapshot: Config is frozen at startup and never reflects a | ||||||||||
| // setValue() write, so reopening the dialog would otherwise show stale state. | ||||||||||
| const bareMode = config.getBareMode(); | ||||||||||
| const safeMode = config.isSafeMode(); | ||||||||||
|
Collaborator
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. [Suggestion] Consider disabling the toggle handlers (or showing a warning) when
Suggested change
— qwen3.7-max via Qwen Code /review |
||||||||||
| const readToggle = (value: boolean | undefined): boolean => | ||||||||||
| !bareMode && (value ?? true); | ||||||||||
| !bareMode && !safeMode && (value ?? true); | ||||||||||
| const [autoMemoryOn, setAutoMemoryOn] = useState(() => | ||||||||||
| readToggle(loadedSettings.merged.memory?.enableManagedAutoMemory), | ||||||||||
| ); | ||||||||||
|
|
||||||||||
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.
[Critical]
safeModeis defined here and correctly applied to many settings (mcpServers, hooks, auto-memory, allowedHttpHookUrls), but several permission-related settings in this function still use onlybareModeguards — or no guard at all. A project's.qwen/settings.jsonpermission rules flow through toPermissionManagerunchanged in safe mode.Affected settings:
mergedAllow(line ~1549):bareMode ? [] : ...— no safeModemergedAsk(line ~1553):bareMode ? [] : ...— no safeModemergedDeny(line ~1556):bareMode ? [] : ...— no safeModedisabledSlashCommands(line ~1575-1589): no guard at alldisabledTools(line ~1595): no guard at allcoreTools(line ~1839):bareMode ? undefined : ...— no safeModeallowedTools(line ~1844):bareMode ? ... : ...— no safeModepermissions.autoMode(line ~1855): no guard at allapprovalMode(line ~1467):!bareModecheck — no safeModeThe most dangerous consequence: a malicious repo's
"permissions": {"allow": ["Bash(*)"], "autoMode": "yolo"}auto-approves all shell commands even when the user runs--safe-modeexpecting a stripped-down environment.— qwen3.7-max via Qwen Code /review