Skip to content

Feat/repo map - #29

Merged
Nithwin merged 2 commits into
mainfrom
feat/repo-map
Jul 26, 2026
Merged

Feat/repo map#29
Nithwin merged 2 commits into
mainfrom
feat/repo-map

Conversation

@Nithwin

@Nithwin Nithwin commented Jul 26, 2026

Copy link
Copy Markdown
Owner

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_dir tool calls.

Key Changes

  • prompt/repomap.go: Implemented a fast filepath.WalkDir algorithm that formats the workspace into an ASCII tree.
  • Token Protection: Explicitly ignores .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 the runLoop. 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 static systemPrompt from 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.go exists 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

  1. Check out the branch: git checkout feat/repo-map
  2. Run WindMist: go run ./cmd/windmist
  3. Ask the agent: "What files do I have in my workspace?"
  4. The agent will immediately answer without needing to execute a single tool call!

@Nithwin
Nithwin merged commit 997f252 into main Jul 26, 2026
1 check passed
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.

1 participant