Skip to content

plan agent: grant editFiles + githubRepo, forbid invented file reads (#2003)#2143

Open
KomalSrinivasan wants to merge 1 commit into
github:mainfrom
KomalSrinivasan:fix/issue-2003-plan-agent-file-reads
Open

plan agent: grant editFiles + githubRepo, forbid invented file reads (#2003)#2143
KomalSrinivasan wants to merge 1 commit into
github:mainfrom
KomalSrinivasan:fix/issue-2003-plan-agent-file-reads

Conversation

@KomalSrinivasan

Copy link
Copy Markdown

Closes #2003.

@basilevs reported the Plan Mode - Strategic Planning & Architecture agent failing to read a workspace file and instead inventing two non-existent mechanisms in sequence:

  1. SELECT readfile('feature-replay-history-1.md') against the SQLite tool, which legitimately errors with no such function: readfile.
  2. Querying a fake inbox_entries table, 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.md declares its tool surface as:

tools:
  - search/codebase
  - vscode/extensions
  - web/fetch
  - read/problems
  - search/searchResults
  - search/usages
  - vscode/vscodeAPI

None of those read files. The body of the agent also says Use `githubRepo` to understand project history even though githubRepo isn'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:

  1. Add edit/editFiles to the tools array. The Copilot edit/editFiles tool surface includes reading workspace files, so this restores normal file access. The agent doesn't have to write anything to read.
  2. Add githubRepo to the tools array so the body's existing reference to it isn't dead text.
  3. Add a File Reading bullet under capabilities pointing the agent at editFiles for reads, and explicitly forbidding invented mechanisms like readfile() 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 build exits 0, regenerates marketplace.json.
  • 1 file touched, 3 insertions. No README diff because the agent description is unchanged.
  • git diff main shows only the additions: 2 new tool entries and 1 new bullet.

Out of scope

  • Adding the execute/run tool family that implementation-plan.agent.md carries. Plan mode is read-only by design; it shouldn't be running shell commands. editFiles covers reading without crossing that line.

…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.
@github-actions github-actions Bot added the agent PR touches agents label Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 1 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 0
ℹ️ Info 0

✅ No matching risk patterns were detected in changed files.

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

@github-actions github-actions Bot added the skill-check-error Skill validator reported errors label Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Skill Validator Results

⛔ Findings need attention

Scope Checked
Skills 0
Agents 1
Total 1
Severity Count
❌ Errors 2
⚠️ Warnings 0
ℹ️ Advisories 0

Summary

Level Finding
[agent:Plan Mode - Strategic Planning & Architecture] Agent name 'Plan Mode - Strategic Planning & Architecture' does not match filename 'plan.agent.md' (expected 'Plan Mode - Strategic Planning & Architecture.agent.md').
[agent:Plan Mode - Strategic Planning & Architecture] Agent name 'Plan Mode - Strategic Planning & Architecture' contains invalid characters — must be lowercase alphanumeric and hyphens only.
Full validator output
Found 1 agent(s)
❌ [agent:Plan Mode - Strategic Planning & Architecture] Agent name 'Plan Mode - Strategic Planning & Architecture' does not match filename 'plan.agent.md' (expected 'Plan Mode - Strategic Planning & Architecture.agent.md').
❌ [agent:Plan Mode - Strategic Planning & Architecture] Agent name 'Plan Mode - Strategic Planning & Architecture' contains invalid characters — must be lowercase alphanumeric and hyphens only.
Validated 1 agent(s)
Agent spec conformance failures — fix the errors above.

Note: The validator returned a non-zero exit code. Please review the findings above before merge.

@KomalSrinivasan KomalSrinivasan changed the title plan agent: grant editFiles + githubRepo, forbid invented file reads (#2003) 🤖🤖🤖 plan agent: grant editFiles + githubRepo, forbid invented file reads (#2003) Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Contributor Reputation Check: MEDIUM risk

Check Risk
Profile MEDIUM
Credential audit NONE

Maintainers: please review this contributor before merging.
See the workflow run for full details.
Automated check powered by AGT.

@github-actions github-actions Bot added the needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent PR touches agents needs-review:MEDIUM Contributor reputation check flagged MEDIUM risk skill-check-error Skill validator reported errors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Plan Mode - Strategic Planning & Architecture" can't read files

1 participant