Feat/repo map - #29
Merged
Merged
Conversation
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
This PR implements a dynamic Repository Map, giving the AI agent "omniscience" over the local file system. Similar to Aider and OpenCode, this prevents the agent from hallucinating file paths and saves massive amounts of time/tokens by eliminating the need for exploratory
list_dirtool calls.Key Changes
prompt/repomap.go: Implemented a fastfilepath.WalkDiralgorithm that formats the workspace into an ASCII tree..git,node_modules,vendor,__pycache__, etc. Caps the tree at 2,000 files to prevent context window overflow on massive monorepos.agent/loop.go: Moved system prompt generation inside therunLoop. The agent now recalculates the exact state of the filesystem on every single turn before querying the LLM, entirely solving the "stale state" caching problem.agent/agent.go: Removed staticsystemPromptfrom the Agent struct since it is now dynamically generated on-the-fly.Why this matters
The agent no longer operates blind. If you ask it to "fix the auth bug", it already knows
internal/auth.goexists and can immediately read it. If it creates a new file, the map instantly updates on the next turn so the agent knows the creation succeeded.How to Test
git checkout feat/repo-mapgo run ./cmd/windmist