Serve OpenFrame gateway URL + JWT from meshcore getServerTargetUrl - #73
Merged
Conversation
Ports the one functional patch of the disk-distributed OpenFrame CoreModule into the true core source, so the standard server core-push mechanism delivers it. Guarded on mesh.authToken() returning a token (null outside OpenFrame mode), so the core stays stock for any other agent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthrough
ChangesJWT server routing
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@agents/meshcore.js`:
- Around line 1157-1159: Update the token-authenticated URL construction in the
gateway request branch to preserve an explicitly configured non-default port
from x.port when building the authority from x.protocol and x.host. Keep
default-port URLs unchanged, and retain the existing path and authorization
query handling.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Ports the CoreModule.js half of meshagent#78 into the server core: getOpenFrameMachineId/addOpenFrameHeaders helpers and their six call sites (tunnel, trusted download, server file fetch, console wget and websocket, self-update), plus encodeURIComponent on the token query param. Guarded by mesh.openFrameMode, which exists only on meshagent 0.0.26+ binaries; older agents get stock behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikhailm-coder
enabled auto-merge (squash)
August 19, 2026 12:25
danylo-babenko-flamingo
approved these changes
Aug 20, 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.
Why
OpenFrame agents run a core whose only functional difference from upstream is one function —
getServerTargetUrldialing tunnels through the gateway proxy path with the agent JWT. That patched core has been distributed as a frozen disk file (hand-exportedCoreModule.js, baked into an oss-lib JAR), so core changes never reached machines and the server's stock core-push mechanism was bypassed. This PR ports the patch into the true core source so the standard MeshCentral push mechanism delivers it — step 1 of retiring the disk-file distribution (agent-side counterpart: flamingo-stack/meshagent#81).What
agents/meshcore.js—getServerTargetUrl(path): whenmesh.authToken()yields a token (native method on flamingo agent binaries; returns null outside--openframe-mode; absent on vanilla agents — hence thetypeofguard and try/catch), emit the gateway form used in production today:protocol//host/ws/tools/agent/meshcentral-server/<path>?authorization=<bare-token>, no:port. Otherwise the stock upstream URL. Behavior verified byte-equivalent to the production core for the token case; stock for everyone else.Rollout notes
latestwith keel force-poll → auto-roll on merge.Known parity gaps (not regressions, follow-ups)
serverFetchFileoverwrites the path after URL construction, discarding prefix+token — identical in today's production core.agents/recoverycore.js,agents/agentrecoverycore.js) keep stockgetServerTargetUrl— recovery is unused and non-functional in the OpenFrame fleet today; explicitly out of scope.🤖 Generated with Claude Code
Summary by CodeRabbit