Skip to content

feat(convex): add Daytona Convex component (@daytona/convex) - #64

Merged
mislavivanda merged 8 commits into
mainfrom
feat/convex-component
Sep 25, 2026
Merged

mislavivanda merged 8 commits into
mainfrom
feat/convex-component

Conversation

@mislavivanda

@mislavivanda mislavivanda commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by cubic

Adds the @daytona/convex Convex component for running Daytona sandboxes from a Convex backend: create sandboxes, execute shell commands and code, read and write files, and get live preview URLs, with sandbox and execution state tracked in reactive Convex tables the UI can subscribe to.

  • Ship a host-facing Daytona client that resolves API credentials (from options or the deployment's DAYTONA_API_KEY / DAYTONA_API_URL env vars) and forwards them on each call.
  • Provide component actions for sandbox lifecycle, process/code execution, and filesystem operations, recording observed state into component-owned tables for reactive queries. Sandbox and execution queries are exposed under their own namespaces (sandboxes.get/list, executions.list/get) rather than a shared lib module.
  • Treat stopping an already-deleted sandbox as a successful "destroyed" outcome, record failures so records never go stale, and clamp list limits to 1–500.
  • Bound execution timeouts below Convex's 10-minute action ceiling and cap returned output at 4 MB; a blank DAYTONA_API_URL falls back to Daytona Cloud. Reject non-finite or non-positive timeoutSeconds before creating an execution record.
  • Publish a @daytona/convex/test helper that registers the component with convex-test, alongside an example app and a live end-to-end test script, and wire the package into CI, the integration workflow, and release-please npm publishing.

Written for commit ab119db. Summary will update on new commits.

Review in cubic

@mislavivanda
mislavivanda requested a review from a team as a code owner September 23, 2026 22:39
Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
@mislavivanda
mislavivanda deployed to integration-tests September 23, 2026 22:43 — with GitHub Actions Active

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 45 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Re-trigger cubic

Comment thread .github/workflows/integration.yml
Comment thread packages/convex/src/component/daytona.ts
Comment thread packages/convex/src/component/sandboxes.ts Outdated
Comment thread packages/convex/src/component/sandboxes.ts Outdated
Comment thread packages/convex/src/component/process.ts
Comment thread packages/convex/README.md
Comment thread packages/convex/src/client/index.test.ts
Comment thread packages/convex/src/component/setup.test.ts
Comment thread packages/convex/src/component/setup.test.ts
Comment thread packages/convex/src/component/component.test.ts
The convex job was written before #62 landed and missed the
allow-unsafe-pr-checkout opt-in (fork PRs would fail at checkout) and
persist-credentials: false (GITHUB_TOKEN hygiene) that every other
suite job carries.

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
- stop: treat 404 / destroyed as a successful terminal outcome (a sandbox
  created with autoDeleteInterval 0 is deleted the moment it stops) and
  persist state "destroyed"
- start/stop: record failures via setSandboxError so the reactive record
  never silently goes stale
- create: on wait failure, best-effort fetch the observed remote state
  (e.g. build_failed) so the record doesn't stay "creating" forever
- list/listExecutions: clamp caller-provided limits to a sane 1..500
  integer range

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
- treat a blank DAYTONA_API_URL as unset (fall back to Daytona Cloud
  instead of producing relative request URLs)
- bound command/code timeouts below Convex's 10-minute action ceiling
  (default 540s, cap 570s) so an execution row can't be orphaned in
  "running" by a hard action timeout
- cap output returned across the function boundary at 4 MB so oversized
  results can't fail the action after the execution was marked completed
- make truncate() a hard bound (marker length reserved)

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
…giene

- assert the Authorization: Bearer header and bounded default timeout on
  the toolbox execute call
- cover stop() on an already-deleted sandbox (404 -> destroyed)
- restore any pre-existing DAYTONA_API_KEY in the client options test
- spawn npx via its .cmd shim + shell on Windows in the live E2E script

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
… bounds

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
@mislavivanda
mislavivanda deployed to integration-tests September 24, 2026 05:37 — with GitHub Actions Active

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 10 files (changes from recent commits).

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.

Fix all with cubic | Re-trigger cubic

Comment thread packages/convex/scripts/live.mjs Outdated
Comment thread packages/convex/src/component/process.ts Outdated
…n live script

- reject non-finite/non-positive timeoutSeconds before any remote call or
  execution row is created
- live.mjs: invoke the local convex CLI via process.execPath instead of
  npx (the Windows .cmd+shell route re-parsed JSON args through cmd.exe)

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
aprojic
aprojic previously approved these changes Sep 24, 2026
@mislavivanda
mislavivanda deployed to integration-tests September 24, 2026 08:58 — with GitHub Actions Active
File names are the component's public API namespaces, so 'lib' leaked a
meaningless name into consumer-facing paths. Per Convex team review:

- sandboxes.ts now owns sandbox queries (get, list) and bookkeeping
  mutations alongside the lifecycle actions -> sandboxes.get/list
- new executions.ts owns execution queries and bookkeeping ->
  executions.list/get (was lib.listExecutions/getExecution)
- clampLimit moved to types.ts; lib.ts deleted; client paths updated

Pre-0.1.0, so no published API surface breaks. Verified offline (24
tests) and with the live E2E suite against a real Convex deployment.

Signed-off-by: Mislav Ivanda <mislavivanda454@gmail.com>
@mislavivanda
mislavivanda merged commit 76d8b28 into main Sep 25, 2026
35 checks passed
@mislavivanda
mislavivanda deleted the feat/convex-component branch September 25, 2026 11:00
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2026

This branch was successfully deployed

1 active deployment
integration-tests — ab119db2 Deployed Sep 25, 2026 by mislavivanda via convex #118
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants