Repository navigation
fix: keep Grok Bot CLI connected when the desktop gateway route disappears - #145
Open
tomer-ben-david wants to merge 2 commits into
Open
tomer-ben-david wants to merge 2 commits into
tomer-ben-david wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 9c36b08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Context
Authenticated CLI commands should keep working when the signed-in app removes its cached gateway route. Grok Bot can remove
gateway-descriptor.jsonwhen its cloud computer is kept asleep; the active encrypted account remains insand-secrets.json. The CLI currently treats the missing route as missing auth, selects local-files mode, and reports an agents-directory error despite the desktop being signed in.This PR retains the earlier version 3 descriptor fix and adds reconnection for the missing-file case.
Before and after
Unsupported Grok Bot gateway descriptor version 3bots listselects files mode and fails withCould not find a Grok Bot agents directoryEnsureSandBoxfor a fresh route, then lists the cloud rosterSAND_CLIENT_VERSIONunset0.20.0; observed backend response was HTTP 401,This version of Grok Bot is no longer supported0.68.1) and successfully reconnectsGoals
Restore commands for v3 descriptors and missing cached routes, preserve the active account's selected team, and keep explicit gateway/token/version overrides.
Non-goals
Select another saved account, refresh or persist OAuth credentials, change cloud sleep/privacy settings, or make an independent local copy of the roster. Automatic installed-app version detection is macOS-specific; other platforms retain the existing version override/default behavior.
Solution
sand-secrets.jsonaccount as a gateway auth source. Decrypt it with the shared native Safe Storage helpers, and use its access token plus selected team for the existing boundedEnsureSandBoxrequest. Do not modify the app's credential files.CURSOR_ACCESS_TOKEN, then active app credentials. Existing errors for present but invalid descriptors remain unchanged.SAND_CLIENT_VERSIONas the override. Doctor distinguishes a missing cached route from available active-account credentials.Verification
At
9c36b08:test/history.test.js:204assertion (0 !== 1) also fails in an archived checkout of the previous headff9bdc1, and was previously reproduced on unchanged upstream43499fa.git diff --checkpassed.bots listreturns seven bots. Both Homebrew and NVM command paths were verified locally without restarting the app or setting a token/version env variable.Next steps
Merge and release through the repository's Changesets/OIDC workflow. The locally installed build is prepared from this source; the registry release is still pending.