fix: allow agent to read plans from userspace config dir#748
Merged
Conversation
GLM 5.2 supports a 1M token context window, but the existing matcher grouped all glm-4/glm-5 variants under 200k. Add a dedicated glm-5.2 matcher placed before the general glm-4/glm-5 line so the more specific pattern wins under first-match strings.Contains evaluation. Fixes #745
When the config is loaded from the userspace location (~/.infer), GetConfigDir() returns an absolute home path and plans are written to ~/.infer/plans/. However, the sandbox carve-out in isWithinConfigSubdir only checked the project-relative ConfigDirName (./.infer/plans), so the agent's Read tool rejected the plan path with a sandbox violation. Convert isWithinConfigSubdir to a method on Config so it can access GetConfigDir() and check both the project-relative and resolved userspace config dir locations. This keeps the rest of .infer/ protected while allowing the operational tmp/plans subdirs to be read regardless of which config dir was resolved. Fixes #746
inference-gateway-releaser Bot
added a commit
that referenced
this pull request
Jul 4, 2026
## [0.132.1](v0.132.0...v0.132.1) (2026-07-04) ### 🐛 Bug Fixes * allow agent to read plans from userspace config dir ([#748](#748)) ([d1c1be7](d1c1be7)), closes [#746](#746) * **config:** correct GLM 5.2 context window to 1M tokens ([#747](#747)) ([164ffaf](164ffaf)), closes [#745](#745) * **claude-code:** make subscription mode a true pass-through ([#749](#749)) ([10117b4](10117b4)), closes [inference-gateway/inference-gateway#412](inference-gateway/inference-gateway#412) ### 👷 CI/CD * **deps:** update inference workflow to version 0.15.0 ([c8e1522](c8e1522))
Contributor
|
🎉 This PR is included in version 0.132.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
Fixes #746
When the config is loaded from the userspace location (
~/.infer),GetConfigDir()returns an absolute home path and plans are written to~/.infer/plans/. However, the sandbox carve-out inisWithinConfigSubdironly checked the project-relativeConfigDirName(./.infer/plans), so the agent's Read tool rejected the plan path with a sandbox violation — the agent could write the plan but couldn't read it back.Root Cause
isWithinConfigSubdirwas a free function that hardcodedConfigDirName(.infer) to build the carve-out paths. It did not account for the resolved config dir (GetConfigDir()), which can be the userspace~/.inferwhen the config is loaded from there.Fix
Convert
isWithinConfigSubdirfrom a free function to a method onConfigso it can accessGetConfigDir(). It now checks both:ConfigDirName(./.infer/<name>)GetConfigDir()/<name>)This keeps the rest of
.infer/protected while allowing the operationaltmp/planssubdirs to be read regardless of which config dir was resolved. File-level protections (e.g.*.env,.git/) still apply within the carve-out.Testing
TestValidatePathInSandbox_ConfigDirUserspacewhich verifies that~/.infer/plans/and~/.infer/tmp/paths are allowed whenconfigDiris set to the userspace location, while sensitive files (config.yaml,agents.yaml,*.env) remain denied.