Skip to content

Send prompts through the Cursor backend (fixes #165) - #166

Open
Philipp0205 wants to merge 1 commit into
ScriptedAlchemy:mainfrom
Philipp0205:send-via-backend
Open

Philipp0205 wants to merge 1 commit into
ScriptedAlchemy:mainfrom
Philipp0205:send-via-backend

Conversation

@Philipp0205

Copy link
Copy Markdown

Fixes #165.

The gateway now answers /api/sendPrompt with 502 "A Sand box session is not permitted on this endpoint" for box sessions. The desktop app sends through api2.cursor.sh GrokBotService/SendGrokBotUserMessage instead.

  • src/core/backend-send.js: minimal protobuf encoder for the request (agent id, nonce, text, time, source, machine id, language) and a refusal check on the response.
  • gateway.js: sendPrompt posts there when the session came from Cursor credentials (CURSOR_ACCESS_TOKEN or the app login), using the same credentials as EnsureSandBox. GROK_BOT_GATEWAY_URL overrides keep the gateway path. Reads, approvals, etc. are unchanged.
  • The backend reply has no message id, so the existing clientNonce transcript lookup provides the receipt.
  • Test fixture relay-gateway-lifecycle now serves the new endpoint; added backend-send.test.js; artifact rebuilt; changeset added.

Verified: npm run typecheck and npm test pass except detects installed macOS app version…, which also fails on main on Linux. Same request was confirmed working against the live backend earlier with a local patch of 0.12.5 (message reached the bot thread).

@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fa742f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
grok-bot-cli Patch

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sendPrompt failed: 502 A Sand box session is not permitted on this endpoint.

2 participants