Skip to content

fix(agent): hold daytona below 2.0 and lock 0.232.0 - #103

Merged
contextablemark merged 2 commits into
mainfrom
contextablemark/albert-daytona-python-compat
Nov 19, 2026
Merged

contextablemark merged 2 commits into
mainfrom
contextablemark/albert-daytona-python-compat

Conversation

@contextablemark

@contextablemark contextablemark commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What this fixes

Daytona released 2.0.0 on 2026-11-13. In 2.0 the daytona package root exports only the clients. Every type moved into version namespaces (daytona.v0, daytona.v2).

On 2.0, two imports the coder needs fail:

  • from daytona import CreateSandboxFromSnapshotParams in agent/coding/sandbox.py raises ImportError.
  • import langchain_daytona raises ImportError in every release up to the latest, 0.0.9.

The agent declared daytona>=0.204.0 with no upper limit. Production builds from the frozen lock (0.204.0), so it works today. But any re-lock, a dependency bump, or a fresh install by someone who clones OpenTag picks up 2.0 and breaks the coder.

Moving our imports to daytona.v0 is not enough, because langchain-daytona would still fail. So this PR holds daytona on 0.x.

Changes

  • agent/pyproject.toml: daytona>=0.204.0 → daytona>=0.232.0,<1, with a comment that says why. 1.0.1 is an old, unrelated release, so the limit is <1.
  • agent/uv.lock: daytona and its six daytona-* client packages go from 0.204.0 to 0.232.0, the newest 0.x release. The re-lock also moves pydantic, pydantic-core, urllib3, aiohttp, yarl and typing-inspection forward, because 0.232.0 needs newer versions.
  • New agent/tests/test_daytona_sdk_contract.py: like the Composio and Arcade contract tests, it reads the real installed SDK classes offline. It checks the snapshot params, Daytona.create, Process.exec and its result fields, the five Git methods and their arguments, Sandbox.delete, and how DaytonaSandbox takes the sandbox.
  • agent/tests/test_packaging.py: a new test fails if daytona loses its upper limit.

Verification

  • uv run pytest (in agent/): 861 passed. Without root node_modules, one Composio test is skipped (860 passed, 1 skipped). uv lock --check passes.
  • The new packaging test failed before the pin change and passes after it.
  • I ran the contract test against daytona 2.0.0 in a separate environment. It fails at collection with the 2.0 ImportError.
  • pnpm check-types, pnpm test (499/499) and node node_modules/railway/dist/iac/bin.js pass. This PR does not change any JS.
  • Live Daytona check: agent/scripts/probe_daytona.py on 0.232.0 passed every step. That covers the raw SDK path (create, process.exec, session execute, the tool probe, delete) and the production PerJobDaytonaBackend path (create, three commands on one box, stop_current). Both sandboxes were deleted, and the account had no sandboxes left afterwards.

Not in this PR

  • A full re-lock would also move langchain-daytona to 0.0.9. That release requires deepagents>=0.7, but OpenTag locks 0.6.12. That is a separate upgrade.
  • Using the Daytona 2.0 API itself. It needs langchain-daytona to support 2.0 first.

Daytona 2.0.0 moved every type out of the package root into version
namespaces. On it, `from daytona import CreateSandboxFromSnapshotParams`
in coding/sandbox.py raises ImportError, and so does
`import langchain_daytona` in every release up to 0.0.9. The agent
declared `daytona>=0.204.0` with no ceiling, so any re-lock would pick
up 2.0 and break the coder.

Declare `daytona>=0.232.0,<1` and lock 0.232.0, the newest 0.x
release. Add an offline contract test that reads the installed SDK
classes for every call the coder makes, and a packaging test that
fails if the ceiling is removed.
The comment named 2.0 as the breaking release but did not say why the
bound stops at 1. A reader of pyproject.toml alone could widen it to
<2 and admit the untested 1.0.1 release.

@mme mme 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.

Looks good. Checked out the branch and ran it in agent/: uv lock --check passes and uv run pytest gives 860 passed, 1 skipped (the Composio test that needs root node_modules). The lock has daytona at 0.232.0 and langchain-daytona still at 0.0.7.

One non-blocking note: the contract test imports Git and Process from daytona._sync.*, which are private modules, so a 0.x release that reorganises internals could fail the test without breaking the agent. Fine as is, since the lock holds the version.

For context, daytona 2.0.0 is currently yanked on PyPI, so a re-lock would not pick it up today. The <1 ceiling is what keeps that true once it is un-yanked.

@contextablemark
contextablemark merged commit 07f25a7 into main Nov 19, 2026
3 checks passed
@contextablemark
contextablemark deleted the contextablemark/albert-daytona-python-compat branch November 19, 2026 17:23
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