Repository navigation
fix: resolve scanAgents omitted path against active project cwd - #1631
Merged
Merged
Conversation
Add proposal, design, spec delta, and tasks for resolving the scanAgents omitted-path default against the active project cwd (getProjectCwd) instead of a frozen module-load cwd. Closes #1630.
Import getProjectCwd and resolve an omitted path as getProjectCwd() || config.cwd || process.cwd() at call time, mirroring the file and discovery tools. Remove the frozen module-load cwd capture and update the regression test to assert active-project-cwd resolution. Closes #1630
Sync the scan-agents spec delta to openspec/specs/scan-agents/spec.md and move the change to openspec/changes/archive/.
Owner
Author
Implementation Audit — scan-agents-active-project-cwdGoal fulfillment
Spec compliance
Task completion
Quality
ResultNo errors. Proceed to archive. |
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
The
scanAgentstool ignored the active project context: it captured the rootcwdonce at module load (const cwd = loadConfig().cwd) and, when nopathargument was supplied, always fell back to that frozen root — never consulting the
active project. When a user selected a project via the /projects panel,
scanAgentsstill scanned the madz root instead of the active project, returningthe wrong
AGENTS.md(or none at all).This change makes
scanAgentsresolve an omittedpathagainst the live activeproject cwd via
getProjectCwd() || config.cwd || process.cwd(), mirroring thesibling
fileanddiscoverytools. The frozen module-load capture is removedand the resolution is evaluated at call time. The
scan-agentsspec is updated toreflect the new default-path behavior, and a regression test asserts
active-project-cwd resolution.
Type of Change
Testing
Added a regression test in
tests/unit/tools_scanAgents.test.jsthat callssetProjectCwd(<projectDir>)and asserts an omittedpathresolves to theproject directory (reading that project's
AGENTS.md), replacing the prior"uses process.cwd()" test. The full suite passes via
npm run testandnpm run coverage.Coverage
src/tools/scanAgents/index.jsis at 100% line coverage; overall 91.52%.Checklist
npm run lintpassesCloses #1630