plan agent: grant editFiles + githubRepo, forbid invented file reads (#2003)#2143
Open
KomalSrinivasan wants to merge 1 commit into
Open
plan agent: grant editFiles + githubRepo, forbid invented file reads (#2003)#2143KomalSrinivasan wants to merge 1 commit into
KomalSrinivasan wants to merge 1 commit into
Conversation
…ithub#2003) The Plan Mode agent advertises information gathering as its primary mode but its tools array does not include any file-read capability, and the body says 'Use githubRepo' without granting that tool. @basilevs reported the agent flailing on a workspace file read by inventing a SQLite readfile() function call and then a fake inbox_entries query, both of which fail, and asking the user to paste the file contents instead. Fix in three small parts: 1. Add 'edit/editFiles' to the tools array. The Copilot edit/editFiles tool surface includes reading workspace files, so this restores normal file access. 2. Add 'githubRepo' to the tools array so the body's existing reference to it stops being dead text. 3. Add a 'File Reading' bullet under capabilities. It points the agent at editFiles for the read and explicitly forbids inventing alternative mechanisms like SQL readfile() or querying tables that aren't real. Closes github#2003.
Contributor
🔒 PR Risk Scan ResultsScanned 1 changed file(s).
✅ No matching risk patterns were detected in changed files.
|
Contributor
🔍 Skill Validator Results⛔ Findings need attention
Summary
Full validator output
|
Contributor
|
🟡 Contributor Reputation Check: MEDIUM risk
Maintainers: please review this contributor before merging. |
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.
Closes #2003.
@basilevs reported the
Plan Mode - Strategic Planning & Architectureagent failing to read a workspace file and instead inventing two non-existent mechanisms in sequence:SELECT readfile('feature-replay-history-1.md')against the SQLite tool, which legitimately errors withno such function: readfile.inbox_entriestable, which returns 0 rows because it doesn't exist.Then the agent gave up and asked the user to paste the file contents.
Root cause
agents/plan.agent.mddeclares its tool surface as:None of those read files. The body of the agent also says
Use `githubRepo` to understand project historyeven thoughgithubRepoisn't in the tools array, so that bullet is dead text the agent can't act on.For comparison, the sibling
agents/implementation-plan.agent.md(which can read files) lists"edit/editFiles"in its tools, plus a few execute/run tools.Fix
Three small edits, one file:
edit/editFilesto the tools array. The Copilotedit/editFilestool surface includes reading workspace files, so this restores normal file access. The agent doesn't have to write anything to read.githubRepoto the tools array so the body's existing reference to it isn't dead text.File Readingbullet under capabilities pointing the agent ateditFilesfor reads, and explicitly forbidding invented mechanisms likereadfile()or queries against tables that aren't real. This matches the transcript in "Plan Mode - Strategic Planning & Architecture" can't read files #2003 directly.Verification
npm run buildexits 0, regeneratesmarketplace.json.descriptionis unchanged.git diff mainshows only the additions: 2 new tool entries and 1 new bullet.Out of scope
implementation-plan.agent.mdcarries. Plan mode is read-only by design; it shouldn't be running shell commands.editFilescovers reading without crossing that line.