Skip to content

⚙️ FEATURE-#30: Add in-chat toggle for the workspace jail - #31

Merged
FernandoCelmer merged 7 commits into
masterfrom
feature/30
Aug 16, 2026
Merged

⚙️ FEATURE-#30: Add in-chat toggle for the workspace jail#31
FernandoCelmer merged 7 commits into
masterfrom
feature/30

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Description

  • src/vscode/webview/html.ts — Adds a "Workspace jail" menu item, mirroring "Project memory".
  • media/dom.js — Adds menuWorkspace/menuWorkspaceCheck element refs and workspaceEnabled state.
  • media/menu.js — Wires the click to toggleWorkspace, applies message.workspace in applySettings(), toggles the checkbox.
  • eslint.config.mjs — Declares the new cross-file globals (same pattern as every other menu toggle).
  • src/vscode/webview/messages.ts — Adds { type: "toggleWorkspace"; next: boolean } to WebviewMessage.
  • src/vscode/sidebar/chatSidebarProvider.ts — Routes it to SettingsController.toggleWorkspace().
  • src/features/settings/settings.controller.ts — Adds toggleWorkspace() (mirrors toggleMemory()) and includes workspace in the postSettings() payload.

Motivation and Context

pycodeloop.workspace — the jail that keeps read_file/write_file/edit_file/delete_file/grep/glob inside the workspace root — was already wired end-to-end from settings through to --no-workspace, but unlike every other boolean setting (skills, delegation, memory, auto-approve) it had no in-chat toggle. The only way to flip it was editing settings.json directly and reloading.

Closes #30.

Types of changes

  • New feature (change which adds functionality)
  • Bug fix
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Code Review

Code issues found: 0

This PR follows all established patterns exactly. Each concern was traced back to the codebase:

  • !!message.next — consistent with toggleAutoApprove, toggleSkills, toggleDelegation, toggleMemory in chatSidebarProvider.ts
  • this.reload() after toggle — intentional; all toggle methods reload to restart the subprocess with updated settings
  • No try/catch in toggleWorkspace — matches the error-handling posture of every other toggle; errors surface via the global unhandledrejection handler in dom.js
  • menuWorkspace null risk — same pattern as all other DOM refs; the element is always rendered by the HTML template in the same request
  • workspaceEnabled = message.workspace !== false — correct sentinel for a setting whose default is true (same as skills and memory)

LGTM.

@FernandoCelmer FernandoCelmer added the enhancement New feature or request label Aug 16, 2026
@FernandoCelmer
FernandoCelmer merged commit 4dde203 into master Aug 16, 2026
2 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/30 branch August 16, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add in-chat toggle for the workspace jail

1 participant