Skip to content

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
dzykovic merged 4 commits into
mainfrom
feature/cursor-oauth-and-open-logs
Aug 28, 2026
Merged

dzykovic merged 4 commits into
mainfrom
feature/cursor-oauth-and-open-logs

Conversation

@dzykovic

Copy link
Copy Markdown
Contributor

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 host daemon.log plus in-sandbox files only if the sandbox is still running (FR-061). Spec 019; docs/Features.md and docs/Architecture.md updated in this PR.

Changes

  • Hide the Cursor API-key checkbox when the agent is Cursor; Save drops it; Connect/Shell/Rebuild never prompt for it and warn if a global cursor secret is already set (not unset).
  • Keep other secret ticks (GitHub, etc.) when the agent dropdown changes.
  • Add Open Logs (Explorer context menu and palette): write sandbox-console-<name>-logs.txt in the OS temp directory at 0600, always include this sandbox's host daemon lines, and sbx exec known guest logs only after a fresh sbx ls still reports running.
  • Ship spec 019 and sync FR-032/FR-061 in Features and Architecture.

How to Verify

  1. npm run verify exits 0.
  2. F5 (Extension Development Host). Opening this workspace must show no notification and write nothing into .sandbox/.
  3. New Sandbox, agent Cursor: the cursor credential chip is hidden; GitHub stays available. Tick GitHub, switch agent away and back — GitHub stays ticked. Save a Cursor sandbox — .sandbox/config.yaml has no cursor in secrets.
  4. With sbx secret ls showing a global cursor key, Connect (and Rebuild) a Cursor sandbox: a warning names the sandbox and the secret; the agent still attaches. sbx secret rm -g cursor is left to the user.
  5. On a running sandbox, Open Logs: editor opens a temp snapshot with host daemon.log lines and in-sandbox files; the sandbox stays running.
  6. Stop that sandbox, Open Logs again: snapshot is host daemon only (guest section says skipped); sbx ls still shows stopped — Open Logs must not auto-start it.

Made with Cursor

dzykovic and others added 2 commits August 21, 2026 15:51
…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>
Copilot AI lite review requested due to automatic review settings August 21, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --json failure, so collectLogs is never reached when the CLI/daemon is unhealthy. That prevents the promised host-only snapshot exactly when the surviving daemon.log is most useful; distinguish a successful absent result 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.

Comment thread src/ops.ts Outdated
Comment thread src/ops.ts Outdated
Comment thread src/sbx.ts Outdated
Comment thread src/sbx.ts Outdated
Comment thread src/secrets.ts Outdated
dzykovic and others added 2 commits August 21, 2026 16:42
…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>
@dzykovic
dzykovic merged commit aa49d96 into main Aug 28, 2026
1 check passed
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.

2 participants