fix(mesh): refuse to open prod dashboard from non-prod gateway#88
Merged
George-iam merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
Adds resolveDashboardURL() with this precedence: 1. --dashboard-url flag override 2. AXME_MESH_DASHBOARD_URL env var 3. context-aware: refuse if gateway is not api.cloud.axme.ai 4. https://mesh.axme.ai (prod default) Before this fix, running `axme mesh dashboard` under a staging context would create a token via the staging gateway and then open https://mesh.axme.ai (prod). The prod dashboard would call its prod gateway which doesn't know the staging token, returning "Invalid exchange token" — confusing the user with no hint about the cross-environment mismatch. Now staging contexts fail fast with a clear message and a hint to set AXME_MESH_DASHBOARD_URL or pass --dashboard-url. Tested via 6 unit tests covering all precedence branches. Fixes the "Agent Mesh: Invalid exchange token" report.
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 B-005: "Agent Mesh: Invalid exchange token" when running `axme mesh dashboard` under a non-prod context.
Root cause: `mesh.go` had `defaultMeshDashboardURL = "https://mesh.axme.ai\"\` hardcoded. Under staging context, the CLI created an exchange token via the staging gateway then opened the prod dashboard. Prod dashboard's backend tried to validate the token against prod DB, found nothing, returned "Invalid exchange token".
Changes
Test plan