Skip to content

fix(templates): prevent planner from querying unfiltered issues#547

Open
lgwacker wants to merge 1 commit into
mattpocock:mainfrom
lgwacker:planner-constraint-fix
Open

fix(templates): prevent planner from querying unfiltered issues#547
lgwacker wants to merge 1 commit into
mattpocock:mainfrom
lgwacker:planner-constraint-fix

Conversation

@lgwacker
Copy link
Copy Markdown

@lgwacker lgwacker commented May 5, 2026

Problem

The planner agent has shell access inside the sandbox and can run its own shell commands. To build an accurate dependency graph, it may query all open issues instead of respecting the filter in {{LIST_TASKS_COMMAND}}.

This causes the agent to implement issues that are NOT labeled ready-for-agent, such as issues tagged needs-info or ready-for-human.

Solution

Add a CONSTRAINT section to both parallel planner templates telling the agent it MUST ONLY return issues from the provided JSON list.

Changes

  • src/templates/parallel-planner/plan-prompt.md
  • src/templates/parallel-planner-with-review/plan-prompt.md

Testing

This is a prompt-level fix. The agent's behavior should be verified by:

  1. Running sandcastle init with the parallel-planner template
  2. Checking that the generated plan-prompt.md includes the CONSTRAINT section
  3. Running the planner against a repo with mixed-label issues and verifying only ready-for-agent issues are selected

Related

Closes #546

…tered issues

The planner agent has shell access inside the sandbox and can run its own
shell commands. Without an explicit constraint, it may query all open issues
instead of respecting the filter in LIST_TASKS_COMMAND.

This adds a CONSTRAINT section to both parallel planner templates telling
the agent it MUST ONLY return issues from the provided JSON list.

Fixes: agents implementing issues without ready-for-agent label
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

@lgwacker is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Planner agent bypasses issue label filter by running unfiltered gh queries

1 participant