feat: Allowed Tools management (issue #24)#27
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/faesel/gridwatch/sessions/faac5005-ac9e-46c3-9b0a-d5ad4b09e0ae Co-authored-by: faesel <6319576+faesel@users.noreply.github.com>
Agent-Logs-Url: https://github.com/faesel/gridwatch/sessions/faac5005-ac9e-46c3-9b0a-d5ad4b09e0ae Co-authored-by: faesel <6319576+faesel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update sidebar by removing DIRS and adding trusted dirs section
feat: Allowed Tools management (issue #24)
May 3, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds read/write management of
~/.copilot/permissions-config.json— the file Copilot CLI uses to persist "don't ask again" tool decisions per project.IPC surface (
electron/main.ts)tools:get-permissions— reads permissions-config.json, returnsProjectToolPermissions[]grouped by project path (10s cache)tools:allow-tool(projectPath, toolSpec)— appends a tool to a project's allowed listtools:remove-tool(projectPath, toolSpec)— removes a tool; deletes the project key when its list emptiesInput validation via
isValidToolSpec()— restricts toidentifieroridentifier(arg)form, disallows parentheses inside args to prevent nesting. Project paths go through the existingisValidDirPath()+ prototype pollution guards.Settings page — Allowed Tools panel
New panel below Trusted Directories showing per-project tool chips with type-distinct colouring:
shell(…)→ orange (highest risk)write→ bluemcp-server(tool)→ cyanEach chip has an inline remove button. A form (project path + tool spec) allows adding new entries.
Sessions page — tool badge integration
Tool badges in the TOOLS USED section are now interactive:
disabled{tool}for this project? Copilot will use it without asking in future sessions."Allowed tools for the selected session are fetched from
tools:get-permissionson session selection, matched bysession.cwd.Original prompt
#24 implement this issue.
[Chronological Review] 1. User asked where `/list-dirs` command data is stored in Copilot CLI 2. Initial investigation: grepped codebase (no matches), checked Copilot CLI docs, explored ~/.copilot directory structure 3. Discovered config.json, settings.json, session-state files - initially couldn't find where dirs were stored 4. User pushed back on incorrect answers multiple times 5. Fetched official GitHub docs from docs.github.com - found `trustedFolders` in `config.json` 6. Confirmed user's config.json had no `trustedFolders` key initially 7. User added a directory via /add-dir but config.json didn't change - learned /add-dir is session-only 8. Added gridwatch and onyx directories to `trustedFolders` in config.json manually 9. Discovered `/list-dirs` shows session sandbox (cwd + temp), NOT trustedFolders - they're different concepts 10. User requested: remove DIRS from sidebar, add trusted dirs section to Settings page, read from config.json 11. Implemented full refactoring: changed electron/main.ts to read/write config.json trustedFolders, removed DirsPage from sidebar, added section to SettingsPage 12. Built, committed, merged to main, tagged v0.31.0, pushed 13. Closed stale draft PR #23, updated and closed issue #21 14. User asked to create new issues for other permission types from the configure-copilot-cli docs 15. Fetched and read full configure-copilot-cli docs and cli-config-dir-reference docs 16. Discovered `permissions-config.json` stores tool and directory permissions per project 17. Created issues #24 (Allowed Tools), #25 (URL Permissions), #26 (Path Permissions) 18. Clarified difference between Trusted Directories and Path Permissions for user 19. User chose to keep all 3 issues open[Intent Mapping]
[Technical Inventory]
[Code Archaeology]
[Progress Assessment]
[Recent Commands Analysis]
gh issue create1. Conversation Overview: - Primary Objectives: User wanted to understand where Copilot CLI's `/list-dirs` data is stored, then move the DIRS page functionality into the Settings page reading from `~/.copilot/config.json`'s `trustedFolders` array, then commit/merge/tag v0.31.0, then create issues for remaining permission types (tools, URLs, paths). - Session Context: Started as investigation into Copilot CLI internals, evolved into a feature refactor, release, and planning for future permission management features. User corrected several incorrect assumptions along the way. - User Intent Evolution: Investigation → manual config edit → UI refactor → release workflow → issue creation for future work- Technical Foundation:
- Copilot CLI Config Structure:
- Key Distinction Discovered:
~/.copilot/config.json— storestrustedFoldersarray (startup trust prompts, persistent across sessions)~/.copilot/permissions-config.json— stores tool and directory permissions per project (does NOT yet exist on user's machine)~/.copilot/settings.json— user preferences (model, theme, footer settings)/list-dirsshows session sandbox (cwd + temp dir) — in-memory only, NOT trustedFolderstrustedFolders= "skip startup trust prompt for this dir"; Path Permissions in...Created from Copilot CLI via the copilot delegate command.