Repository navigation
fix(mcp): preview_session builds a custom exercise as the app does - #412
Merged
DuarteSantos8 merged 1 commit intoOct 9, 2026
Merged
Conversation
The session builder reads each exercise's equipment and body part from the global exercise index. The server never registers custom exercises there (tools.js customOf explains why), so preview_session built a custom leg lift on the small load step (2.5 kg instead of 5 kg for a barbell lift's warm-ups, 45/67.5 instead of the app's 45/65 at 90 kg), where the app, which registers its customs at store load, takes the larger one. preview_session now registers the profile's customs for the length of the one synchronous build and removes them again in the same call, so no other read sees them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kurktchiev
force-pushed
the
gh/mcp-preview-customs
branch
from
October 7, 2026 17:25
25325ea to
5859d5e
Compare
crstnmac
added a commit
to crstnmac/openGym
that referenced
this pull request
Oct 9, 2026
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.
preview_sessionis the tool to call before telling someone what they are about to lift, and it builds the session with the app's ownbuildSessionEntries. That builder reads each exercise's equipment and body part from the global exercise index. The app registers custom exercises there at store load (registerCustom); the MCP server deliberately never does (the comment abovecustomOfin tools.js explains why), so to the builder a custom exercise had no body part at all.What that changed in the preview: a custom leg lift ramped its warm-ups on the 2.5 kg step instead of the 5 kg one the app takes for legs. A custom hack squat at 90 kg with two warm-up sets previewed as 45 / 67.5; the app opens it at 45 / 65.
preview_sessionnow registers the profile's custom exercises for the length of that one synchronous build and removes them again before it returns (withCustomsIndexed, atry/finally). No other read can run in between, so the reason the server keeps customs out of the index still holds, and a test checks the index is left as it was.Tests: one new test in mcp/test/tools.test.js (the 90 kg case above). It fails without the change (45, 67.5) and passes with it. The whole mcp suite passes on 39bc71e, and
npm run check:node-loadablestill loads the full import graph under plain Node.No open PR gains a conflict from this branch.
🤖 Generated with Claude Code