fix: enable dynamic permission mode switching without restart#102
Conversation
Previously, switching from safe to yolo mode required restarting the persistent query because allowDangerouslySkipPermissions was only set when starting in yolo mode. This didn't match Claude Code CLI behavior. Now we always set allowDangerouslySkipPermissions: true at init, enabling setPermissionMode() to work bidirectionally without process restart. - Always enable bypass capability at init (QueryOptionsBuilder) - Use setPermissionMode() for both safe→yolo and yolo→safe transitions - Remove unused allowDangerouslySkip field from PersistentQueryConfig - Add integration test for normal→YOLO transition
PR Review: Enable Dynamic Permission Mode SwitchingSummaryThis PR successfully enables bidirectional permission mode switching (safe ↔ YOLO) without requiring process restart by always setting ✅ Strengths1. Clean Architecture
2. Excellent Documentation
3. Robust Testing
4. Code Simplification
🔍 Observations & Considerations1. Security Model Validation
|
Previously, switching from safe to yolo mode required restarting the persistent query because allowDangerouslySkipPermissions was only set when starting in yolo mode. This didn't match Claude Code CLI behavior. Now we always set allowDangerouslySkipPermissions: true at init, enabling setPermissionMode() to work bidirectionally without process restart. - Always enable bypass capability at init (QueryOptionsBuilder) - Use setPermissionMode() for both safe→yolo and yolo→safe transitions - Remove unused allowDangerouslySkip field from PersistentQueryConfig - Add integration test for normal→YOLO transition
Summary
allowDangerouslySkipPermissions: trueat init to enable dynamic switching viasetPermissionMode()allowDangerouslySkipfield fromPersistentQueryConfigTest plan