fix: discover nested agent context plans#3061
Open
luohui1 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the bundled agent-context extension’s plan auto-discovery so it finds the most recently modified plan.md anywhere under specs/, including nested/scoped feature directories (e.g. specs/scope/feature/plan.md). This aligns the behavior with SPECIFY_FEATURE_DIRECTORY layouts and keeps Bash/PowerShell behavior in parity.
Changes:
- Update Bash plan discovery from
specs/*/plan.mdto recursivespecs/**/plan.md. - Update PowerShell plan discovery to recurse under
specs/and select the newestplan.md. - Add regression tests for nested plan discovery and update extension command docs to describe the recursive behavior.
Show a summary per file
| File | Description |
|---|---|
tests/extensions/test_extension_agent_context.py |
Adds regression tests to ensure both scripts resolve nested specs/.../plan.md paths. |
extensions/agent-context/scripts/powershell/update-agent-context.ps1 |
Switches plan discovery to recursive search under specs/ and picks most recently modified match. |
extensions/agent-context/scripts/bash/update-agent-context.sh |
Switches plan discovery to recursive **/plan.md glob and updates related comments. |
extensions/agent-context/commands/speckit.agent-context.update.md |
Updates documentation to describe recursive plan discovery behavior. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 1
Comment on lines
+125
to
127
| # Pick the most recently modified plan.md anywhere under specs/. | ||
| # Use find + sort by modification time to avoid ls/head fragility with | ||
| # spaces in paths or SIGPIPE from pipefail. |
mnriem
requested changes
Jun 19, 2026
mnriem
left a comment
Collaborator
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable, please explain why
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.
Description
Closes #3024 by making the agent-context update scripts discover the newest
plan.mdanywhere underspecs/, including nested/scoped feature directories such asspecs/scope/feature/plan.md.Bash and PowerShell script behavior stays in parity, and the extension command documentation now describes recursive plan discovery.
Split out from #3053 after maintainer feedback to keep each bug fix in its own PR.
Testing
uv run specify --helpuv sync && uv run pytestAdditional validation run locally:
uv run --extra test pytest tests/extensions/test_extension_agent_context.py -q- 35 passed, 1 skippeduvx ruff check tests/extensions/test_extension_agent_context.py- passedgit diff --check- passedManual test results
Agent: Codex (GPT-5) | OS/Shell: Windows 11 / PowerShell 7.5.4
.specify/extensions/agent-context/scripts/powershell/update-agent-context.ps1specs/scope/feature/plan.md.AI Disclosure
This PR was implemented by Codex (GPT-5) acting as an AI coding agent on behalf of @luohui1. The agent read the repository contribution/security/code-of-conduct docs and issue templates, inspected the relevant code paths, implemented the changes, ran the validation listed above, and prepared this PR description.