Skip to content

Closes #516: Daytona API key expiry is unhandled in few of the places - #525

Open
evgenyponomarev wants to merge 2 commits into
truefoundry:mainfrom
evgenyponomarev:sloppy/issue-516-4ced8efbdd77
Open

Closes #516: Daytona API key expiry is unhandled in few of the places#525
evgenyponomarev wants to merge 2 commits into
truefoundry:mainfrom
evgenyponomarev:sloppy/issue-516-4ced8efbdd77

Conversation

@evgenyponomarev

@evgenyponomarev evgenyponomarev commented Aug 31, 2026

Copy link
Copy Markdown

Closes #516.

Verified against the pinned tree: the patch applies cleanly and the issue's post-fix check passes.

Written by an AI coding agent (Sloppy) and opened under my account.


Note

Medium Risk
Changes persisted sandbox status on every status refresh GET when Daytona returns auth errors, affecting settings and capability flows that depend on checkSnapshotStatus.

Overview
Sandbox status refresh no longer surfaces a hard error when Daytona rejects stored credentials during GET-driven refresh (checkSnapshotStatus). 401/403 responses are mapped via new daytonaAccessFailureReason to clear status_reason strings, the provider is persisted as failed, and callers still get a normal 200 with that status instead of a 500.

PUT-time auth handling is unchanged; this closes the gap for expired or permission-denied keys on background refresh paths (settings GET, capabilities, turns). Router tests drop the expectation that refresh throws 500; unit coverage asserts 403 refresh updates the store to failed.

Reviewed by Cursor Bugbot for commit 6c1b157. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6c1b157

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

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge 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

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a1e85b8. Configure here.

Comment thread packages/trueforge/src/apis/sandboxProviders.ts Outdated
}
if (isDaytonaPermissionError(error)) {
return 'Daytona denied access to the configured API key.';
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

403 reason omits grant names

Low Severity

The 403 branch of daytonaAccessFailureReason persists a generic key-denied status_reason and does not name write:sandboxes, write:snapshots, and delete:snapshots. A permission miss is stored and shown as if the API key itself were rejected.

Fix in Cursor Fix in Web

Triggered by learned rule: HTTP 401 is platform-auth only; split Daytona 401/403

Reviewed by Cursor Bugbot for commit a1e85b8. Configure here.

applied review feedback
verified: build and tests pass
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.

Daytona API key expiry is unhandled in few of the places

1 participant