Conversation
🦋 Changeset detectedLatest commit: e76785c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
290e8b8 to
a1379ae
Compare
|
Rebased onto the latest |
a1379ae to
f056581
Compare
|
Rebased onto current Post-rebase validation:
The SQLite sandbox-provider contract could not execute on this host because the |
|
Rebased onto current The upstream manifest model now includes a non-Daytona stored variant. I preserved that boundary by capturing the already-narrowed Daytona manifest before the async error callback, then using that snapshot for the conditional status update; the store-level expected-manifest comparison accepts the persisted union. This keeps the stale-write guard without treating a non-Daytona record as a Daytona configuration. Validated after the rebase:
The existing SQLite/Postgres contract is unchanged by the rebase; the latter remains an environment-dependent integration boundary noted earlier. |
f056581 to
abb256d
Compare
|
Follow-up on the latest store-input review: addressed in Revalidated on the current head:
This does not change the concurrency behavior; it makes omission of the conditional-write guard a type-level error. |
1ce678d to
e6ac0ed
Compare
|
Rebased onto current The stale-write findings are covered by the manifest compare-and-set path: runtime and snapshot callbacks pass the manifest used to create the client; Validated locally:
I also attempted |
29f28b5 to
7297779
Compare
|
Rebased onto current Validation after the rebase:
I also attempted the SQLite contract test that covers the stale-manifest guard. This runner cannot load its |
7297779 to
d24d771
Compare
|
Rebased the PR onto current Revalidated the changed failure-propagation paths: I did not run the Postgres/SQLite contract suite locally because it requires those backing services; the patch still includes its contract coverage and CI remains the integration check. |
|
Addressed in d24d771: |
d24d771 to
aedce08
Compare
|
The store-input concern is addressed in the current remote head aedce08: Verification: |
|
The three Cursor findings are addressed in the follow-up commits already on this branch:
I re-ran the failure-path unit test and the SQLite store contract (including the stale-manifest case), then package typecheck. All passed. |
|
Correction to my previous validation note: the focused |
aedce08 to
53d7503
Compare
87d8a39 to
8961521
Compare
1d3f864 to
4f67d02
Compare
5631bae to
3aead05
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3aead05. Configure here.
a2fcd0e to
6818942
Compare
5bf9a09 to
2399ba4
Compare
2399ba4 to
e76785c
Compare

Summary
Persist Daytona 401/403 failures as a failed sandbox-provider status instead of returning an internal settings error or losing the typed error when sandbox execution converts it to a failed result.
Closes #516
Changes
status_reasonvaluestrueforgeandtrueforge-coreHow was this tested?
pnpm --filter @truefoundry/trueforge-core test -- --runInBand tests/core/sandbox/daytonaSnapshotRegistration.test.tspnpm --filter @truefoundry/trueforge test -- --runInBand tests/unit/sandbox/providerUtils.test.tspnpm --filter @truefoundry/trueforge test:store:sqlite -- --runInBand tests/db/sqlite/sandbox-provider-store/contract.test.tspnpm --filter @truefoundry/trueforge-core typecheckpnpm --filter @truefoundry/trueforge typecheckpnpm exec eslint packages/trueforge-core/src/core/sandbox/provider/DaytonaProvider.ts packages/trueforge/src/runtime/sessionResources.ts packages/trueforge/src/sandbox/providerUtils.tsgit diff --checkValidation is intentionally scoped to the two changed packages and the Daytona failure paths; full workspace build/test and live Daytona credential revocation were not run locally. The callback is optional and database write failures are logged without replacing the original provider result. The SQLite store contract was run locally; the equivalent Postgres contract was not run because no local Postgres service was started.
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changed (not applicable: no configuration or documented API change)Note
Medium Risk
Changes sandbox credential handling, in-memory caching, and conditional DB status updates on auth failures; incorrect optimistic locking could leave status stale, but scope is limited to Daytona failure paths.
Overview
When Daytona returns 401/403 (including wrapped causes), the sandbox provider row is updated to
failedwith a stablestatus_reasoninstead of surfacing opaque settings errors or losing the signal when exec paths return{ success: false }.Runtime wiring:
DaytonaSandboxProvideraccepts an optionalonErrorhook invoked from create, exec, and file/preview operations. Session resolution passesrecordDaytonaAccessFailure, which writes the failure only for auth/permission errors.Cache safety: Process-wide sandbox caching keys now include a hash of tenant, API URL, and API key so rotated credentials do not reuse clients authenticated with the old key; failed operations evict the matching cache entry.
Concurrency:
updateSandboxStatuscan require matchingexpected_manifestandexpected_statusso stale snapshot refreshes do not overwrite a concurrent auth failure (Postgres and SQLite).Reviewed by Cursor Bugbot for commit 5aeb4e7. Bugbot is set up for automated code reviews on this repo. Configure here.