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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3d3ecf1
feat(cli): add safe mode
DennisYu07 f4e2b3d
fix(test): add isSafeMode to test mocks and config stubs
DennisYu07 f69a198
fix(ui): hide memory toggles in safe mode
DennisYu07 c8fa93e
merge main and resolve conflict
DennisYu07 4b9706d
fix(cli,core): harden safe mode guards for permissions and extensions
DennisYu07 c57db62
Merge remote-tracking branch 'origin/main' into feat/safe-mode
DennisYu07 81bc81a
fix(test): add isSafeMode to config stub in gemini.test.tsx
DennisYu07 07ddcba
Merge branch 'main' into feat/safe-mode
yiliang114 10c130e
fix(cli,core): close safe-mode bypass gaps in context loading and chi…
DennisYu07 d4f4914
Merge branch 'main' into feat/safe-mode
DennisYu07 4193772
fix(test): add isSafeMode to directoryCommand mock config
DennisYu07 d15eb4b
Merge remote-tracking branch 'origin/main' into feat/safe-mode
DennisYu07 fe8bb42
fix(safe-mode): address code review feedback and improve consistency
DennisYu07 f1eddf4
Merge branch 'main' into feat/safe-mode
DennisYu07 5777de5
fix: rename safeMode.ts to safe-mode.ts for kebab-case convention
DennisYu07 19d4f66
Merge branch 'main' into feat/safe-mode
DennisYu07 666c3d2
Merge branch 'main' into feat/safe-mode
DennisYu07 a95f1b2
fix(safe-mode): close extension leak and restore bare-mode sleep prev…
DennisYu07 119eb33
fix(safe-mode): address review feedback on bare-mode extensions, env …
DennisYu07 b605f5e
Merge branch 'main' into feat/safe-mode
DennisYu07 5a7ff3f
Merge branch 'main' into feat/safe-mode
DennisYu07 5089059
Merge branch 'main' into feat/safe-mode
DennisYu07 d2615c3
Merge branch 'main' into feat/safe-mode
wenshao d68167e
merge: resolve conflicts between feat/safe-mode and main
qwen-code-dev-bot 3e134b1
merge: resolve conflicts between feat/safe-mode and main
qwen-code-dev-bot d3af1e0
fix(core): add missing DEFAULT_SENSITIVE_SPAN_ATTRIBUTE_MAX_LENGTH to…
DennisYu07 06756d6
Merge branch 'main' into feat/safe-mode
DennisYu07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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