Stopped offering a Cursor API key on Cursor sandboxes and added Open Logs to snapshot daemon and in-sandbox logs (FR-032, FR-061). - #35
Merged
Conversation
…Logs to snapshot daemon and in-sandbox logs (FR-032, FR-061). Co-authored-by: Cursor <cursoragent@cursor.com>
…e-checked running immediately before Open Logs exec (FR-032, FR-061). Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds Cursor credential safeguards (FR-032) and Open Logs snapshots (FR-061), including guest/host log collection, command registration, and documentation updates.
Changes:
- Hides conflicting Cursor API-key credentials and warns about existing global secrets.
- Adds protected host and guest log snapshots through Explorer and palette commands.
- Updates specifications, features, and architecture documentation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Summary | Review findings |
|---|---|---|
src/tree.ts |
Adds Explorer Open Logs action. | No final review findings. |
src/services.ts |
Defines credential conflicts. | No final review findings. |
src/secrets.ts |
Filters and warns about conflicting secrets. | Nit (2 votes): Global-secret remediation should include -g and identify the secret. |
src/sbx.ts |
Collects daemon and guest logs. | Critical (2 votes): Guest state is not held through exec, allowing concurrent lifecycle actions to auto-start a stopped sandbox. Critical (1 vote): Failed guest-log commands can append guest contents to the operation log, potentially exposing secrets. |
src/ops.ts |
Writes and opens log snapshots. | Critical (3 votes): Predictable temp paths can follow symlinks; use an exclusive no-follow handle. Critical (1 vote): A lifecycle race remains between the running-state probe and exec; serialize with lifecycle operations or enforce no-start behavior atomically. |
src/form.ts |
Updates credential selection UI and persistence. | No final review findings. |
src/extension.ts |
Registers the palette Open Logs command. | No final review findings. |
package.json |
Adds command and menu contributions. | No final review findings. |
docs/specs/completed/019 - Cursor Auth And Sandbox Logs.md |
Records the shipped iteration. | No final review findings. |
docs/Features.md |
Documents FR-032 and FR-061. | No final review findings. |
docs/Architecture.md |
Updates architecture and lifecycle details. | No final review findings. |
Suppressed comments (1)
src/ops.ts:780
- This pre-check propagates any
sbx ls --jsonfailure, socollectLogsis never reached when the CLI/daemon is unhealthy. That prevents the promised host-only snapshot exactly when the survivingdaemon.logis most useful; distinguish a successfulabsentresult from an unknown state, skip guest logs on the latter, and still write/open the host section.
const state = await sandbox.state(ref);
if (state === "absent") {
throw new Error(`${ref.name} has no instance yet.`);
}
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…f the operation log, and named the secret rm command in the Cursor warning (FR-032, FR-061). Co-authored-by: Cursor <cursoragent@cursor.com>
…R-032). Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Risk & Size
Risk: High
Size: Large
What & Why
A stored Cursor API key takes precedence over OAuth and is rejected inside the sandbox (upstream docker/sbx-releases#112), which left Cursor sandboxes in a
Press any key to log in…loop; the form no longer offers that pair (FR-032). When the agent then exits, sbx auto-stops and the trail disappears — Open Logs snapshots hostdaemon.logplus in-sandbox files only if the sandbox is still running (FR-061). Spec 019;docs/Features.mdanddocs/Architecture.mdupdated in this PR.Changes
cursorsecret is already set (not unset).sandbox-console-<name>-logs.txtin the OS temp directory at0600, always include this sandbox's host daemon lines, andsbx execknown guest logs only after a freshsbx lsstill reports running.How to Verify
npm run verifyexits 0..sandbox/.cursorcredential chip is hidden; GitHub stays available. Tick GitHub, switch agent away and back — GitHub stays ticked. Save a Cursor sandbox —.sandbox/config.yamlhas nocursorinsecrets.sbx secret lsshowing a globalcursorkey, Connect (and Rebuild) a Cursor sandbox: a warning names the sandbox and the secret; the agent still attaches.sbx secret rm -g cursoris left to the user.daemon.loglines and in-sandbox files; the sandbox stays running.sbx lsstill shows stopped — Open Logs must not auto-start it.Made with Cursor