fix(debug): sync memory in before rendering the agent system prompt#767
Merged
Conversation
edenreich
commented
Jul 6, 2026
edenreich
commented
Jul 6, 2026
edenreich
commented
Jul 6, 2026
Co-authored-by: Eden Reich <eden.reich@gmail.com>
edenreich
commented
Jul 6, 2026
Co-authored-by: Eden Reich <eden.reich@gmail.com>
inference-gateway-releaser Bot
added a commit
that referenced
this pull request
Jul 6, 2026
## [0.133.1](v0.133.0...v0.133.1) (2026-07-06) ### 🐛 Bug Fixes * **debug:** sync memory in before rendering the agent system prompt ([#767](#767)) ([31af295](31af295)) ### 🧹 Maintenance * **deps:** bump claude-code 2.1.197 -> 2.1.201 ([#763](#763)) ([bdf5cdf](bdf5cdf)) * **deps:** bump infer CLI v0.132.1 -> v0.133.0, infer-action v0.23.7 -> v0.26.0 ([#764](#764)) ([43c3851](43c3851))
Contributor
|
🎉 This PR is included in version 0.133.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
infer debug agent system_promptrenders the prompt straight from disk without syncing memory in, so on a fresh machine with the git memory backend configured (e.g. a CI runner probing the prompt before the agent starts) thePERSISTENT MEMORY INDEXsection is silently omitted — while the real agent, which runsSyncInin its pre-session hook before building the prompt, does receive it. The debug render under-reports the agent's reality.Observed via infer-action, which probes the merged prompt before spawning
infer agent: docs run 28809013238 shows the full context block but no memory index despite the git backend being fully configured.Change
The debug command now calls
SyncInon the container's memory backend beforeBuildSystemPrompt(), mirroring the headless agent's pre-session hook. Fail-soft like the agent (the backend warns and continues); the local backend is a no-op, and the git backend self-gates onsync.on_startand issync.Once-idempotent — so behavior is unchanged except when a configured git memory repo hasn't been pulled yet.Test
cmd/debug_test.goreproduces the fresh-runner case: a seeded local bare repo as the memory remote, a non-existent memory dir, and asserts the rendered prompt containsPERSISTENT MEMORY INDEXand the seeded fact.