Skip to content

Commit ccdb817

Browse files
feat: add allowSymlinksOutsideWorkspace settings UI + i18n (Zoo-Code-Org#246)
Surfaces the opt-in setting in the Context settings panel (toggle, default off) and adds its label + description across all 18 locales. Pairs with the workspace-boundary symlink fix so both ship together (Zoo-Code-Org#169 / Zoo-Code-Org#241).
1 parent 9ac9ee0 commit ccdb817

21 files changed

Lines changed: 100 additions & 0 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"zoo-code": patch
3+
---
4+
5+
Resolve symlinks in the workspace-boundary check so a symlink inside the workspace that points outside is correctly treated as outside, closing a bypass of the out-of-workspace file protection (#169). Adds an opt-in `allowSymlinksOutsideWorkspace` setting (default off) for users who deliberately rely on symlinks that point outside the workspace.

webview-ui/src/components/settings/ContextManagementSettings.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type ContextManagementSettingsProps = HTMLAttributes<HTMLDivElement> & {
3333
maxWorkspaceFiles: number
3434
showRooIgnoredFiles?: boolean
3535
enableSubfolderRules?: boolean
36+
allowSymlinksOutsideWorkspace?: boolean
3637
maxImageFileSize?: number
3738
maxTotalImageSize?: number
3839
profileThresholds?: Record<string, number>
@@ -51,6 +52,7 @@ type ContextManagementSettingsProps = HTMLAttributes<HTMLDivElement> & {
5152
| "maxWorkspaceFiles"
5253
| "showRooIgnoredFiles"
5354
| "enableSubfolderRules"
55+
| "allowSymlinksOutsideWorkspace"
5456
| "maxImageFileSize"
5557
| "maxTotalImageSize"
5658
| "profileThresholds"
@@ -71,6 +73,7 @@ export const ContextManagementSettings = ({
7173
maxWorkspaceFiles,
7274
showRooIgnoredFiles,
7375
enableSubfolderRules,
76+
allowSymlinksOutsideWorkspace,
7477
setCachedStateField,
7578
maxImageFileSize,
7679
maxTotalImageSize,
@@ -246,6 +249,23 @@ export const ContextManagementSettings = ({
246249
</div>
247250
</SearchableSetting>
248251

252+
<SearchableSetting
253+
settingId="context-allow-symlinks-outside-workspace"
254+
section="contextManagement"
255+
label={t("settings:contextManagement.allowSymlinksOutsideWorkspace.label")}>
256+
<VSCodeCheckbox
257+
checked={allowSymlinksOutsideWorkspace}
258+
onChange={(e: any) => setCachedStateField("allowSymlinksOutsideWorkspace", e.target.checked)}
259+
data-testid="allow-symlinks-outside-workspace-checkbox">
260+
<label className="block font-medium mb-1">
261+
{t("settings:contextManagement.allowSymlinksOutsideWorkspace.label")}
262+
</label>
263+
</VSCodeCheckbox>
264+
<div className="text-vscode-descriptionForeground text-sm mt-1 mb-3">
265+
{t("settings:contextManagement.allowSymlinksOutsideWorkspace.description")}
266+
</div>
267+
</SearchableSetting>
268+
249269
<SearchableSetting
250270
settingId="context-max-image-file-size"
251271
section="contextManagement"

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
186186
writeDelayMs,
187187
showRooIgnoredFiles,
188188
enableSubfolderRules,
189+
allowSymlinksOutsideWorkspace,
189190
maxImageFileSize,
190191
maxTotalImageSize,
191192
customSupportPrompts,
@@ -402,6 +403,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
402403
maxWorkspaceFiles: Math.min(Math.max(0, maxWorkspaceFiles ?? 200), 500),
403404
showRooIgnoredFiles: showRooIgnoredFiles ?? true,
404405
enableSubfolderRules: enableSubfolderRules ?? false,
406+
allowSymlinksOutsideWorkspace: allowSymlinksOutsideWorkspace ?? false,
405407
maxImageFileSize: maxImageFileSize ?? 5,
406408
maxTotalImageSize: maxTotalImageSize ?? 20,
407409
includeDiagnosticMessages:
@@ -835,6 +837,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
835837
maxWorkspaceFiles={maxWorkspaceFiles ?? 200}
836838
showRooIgnoredFiles={showRooIgnoredFiles}
837839
enableSubfolderRules={enableSubfolderRules}
840+
allowSymlinksOutsideWorkspace={allowSymlinksOutsideWorkspace}
838841
maxImageFileSize={maxImageFileSize}
839842
maxTotalImageSize={maxTotalImageSize}
840843
profileThresholds={profileThresholds}

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,10 @@
645645
}
646646
},
647647
"contextManagement": {
648+
"allowSymlinksOutsideWorkspace": {
649+
"label": "Allow symlinks pointing outside the workspace",
650+
"description": "When enabled, a symlink that lives inside the workspace but points outside it is treated by its location inside the workspace instead of being flagged as outside. Off by default, so symlink targets are resolved and out-of-workspace access is flagged."
651+
},
648652
"description": "Control what information is included in the AI's context window, affecting token usage and response quality",
649653
"autoCondenseContextPercent": {
650654
"label": "Threshold to trigger intelligent context condensing",

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/id/settings.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)