Skip to content

fix: enforce repomap token cap and fix install.ps1 file lock on Windows#47

Merged
batalabs merged 2 commits intomainfrom
fix/repomap-token-cap
Apr 9, 2026
Merged

fix: enforce repomap token cap and fix install.ps1 file lock on Windows#47
batalabs merged 2 commits intomainfrom
fix/repomap-token-cap

Conversation

@batalabs
Copy link
Copy Markdown
Owner

@batalabs batalabs commented Apr 8, 2026

Summary

  • Repomap overflow: repomap.Format() was ignoring MaxTokens=2000 config. After recent file additions the repo map grew to ~38k tokens, overflowing glm-5.1's practical API limit on every request and causing muxd to not respond on new sessions. Now enforces the cap by truncating at the nearest newline with a ... (truncated) notice.
  • install.ps1 file lock: Move-Item failed with "file already exists" when muxd.exe was running (Windows locks executables). Fixed with stop-process + rename-old + move-new + delete-old pattern.

Test plan

  • Build and run muxd — verify new sessions respond normally
  • Verify repo map in system prompt is ≤2000 tokens
  • Run install.ps1 while muxd is running — should stop the process and complete successfully

@batalabs batalabs self-assigned this Apr 8, 2026
@batalabs batalabs force-pushed the fix/repomap-token-cap branch from cbaa465 to 06a1b79 Compare April 9, 2026 20:11
@batalabs batalabs merged commit 1f0dfdc into main Apr 9, 2026
4 checks 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