Skip to content

feat(sdk): v1 namespace with deprecated root client and config target - #349

Open
MDzaja wants to merge 37 commits into
mainfrom
feat/v1-namespace
Open

MDzaja wants to merge 37 commits into
mainfrom
feat/v1-namespace

Conversation

@MDzaja

@MDzaja MDzaja commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Prepares SDK 1.x for the move to SDK 2.x (rlp#3010). In 2.x the root client has no resource methods: Daytona() exposes only .v1 / .v2, close() and the context manager. 1.x now has the same shape, plus the old root members kept as deprecated forwarders so existing code keeps working. Code written against daytona.v1 and the daytona.v1 namespace on 1.x runs unchanged on 2.x.

Rebuilt on current main. The per-create target from the earlier version of this PR already shipped in #355, so it is no longer part of the diff. The old alias-based approach (v1 returning self) is replaced: v1 is now a separate implementation object, so the root form can be deprecated without deprecating .v1.

SDK v1 client (no deprecation) Root client
Python daytona.v1.Daytona / AsyncDaytona (the existing implementation); Daytona().v1 daytona.Daytona / AsyncDaytona wrappers in _root_sync.py / _root_async.py
TypeScript Daytona from @daytona/sdk/v1 (ESM, CJS, moduleResolution: node); daytona.v1 Daytona from @daytona/sdk (RootDaytona.ts)
Go *daytona.V1Client via client.V1() *daytona.Client
Ruby Daytona::V1::Daytona; daytona.v1 Daytona::Daytona
Java io.daytona.sdk.DaytonaV1 via daytona.v1() io.daytona.sdk.Daytona

Root client

  • Same constructors as before. Creates one v1 client and returns that same instance from v1 every time.
  • Every previous public method and service accessor stays, with the language's deprecation marker, and forwards to v1. Service accessors return the same objects as v1.<service>.
  • close and the context manager / await using are not deprecated (the 2.x root has them).
  • A parity test per SDK fails if a public member is added to the v1 client but not to the root.

Runtime warning, once per process

  • Root usage: one warning for the first deprecated root member used, pointing to the .v1 form. Construction and .v1 usage never warn.
  • target in the client config or DAYTONA_TARGET: deprecated in favour of per-call target / region_id, with a separate one-time warning (also on later assignment in Python). Static markers in TypeScript, Go, Ruby and Java; in Python the field is documented as deprecated (a pydantic field marker would warn on every read, and typed constructor overloads would change type checking for existing callers). Behaviour is unchanged.
  • Channels: Python DeprecationWarning (PEP 702 @deprecated for type checkers), attributed to the first frame outside the SDK so Python's default filters show it in user scripts; TypeScript process.emitWarning with codes DAYTONA_ROOT_NAMESPACE / DAYTONA_CONFIG_TARGET, falling back to console.warn; Go stderr via sync.Once (silence with daytona.SetDeprecationWarningWriter(io.Discard); root service fields carry Deprecated: comments but cannot warn at runtime); Ruby warn, attributed to the first frame outside the SDK; Java java.util.logging.

Shared with 2.x

  • V1_API_URL (Go V1APIURL), used as the default API URL.
  • Python and TypeScript export the 2.x shared error names (13 classes plus DaytonaValidationError / DaytonaAuthorizationError) from the root and from v1; a test pins the list.
  • The v1 namespace adds …V1 aliases for the names 2.x also exports from its v2 namespace (DaytonaV1, SandboxV1, ImageV1, …): in Python rlp's SHARED_WITH_V1 list; in TypeScript every 1.x root name that rlp's v2 entry also exports (what its bundler aliases). Go and Java have no namespaces: Go uses the prefixed V1Client (matching rlp's planned Go layout, D15) and Java the suffixed DaytonaV1, both in the root package.
  • Root resource-type imports (from daytona import Sandbox) keep working without a warning; READMEs point to the v1 imports.

Follow-up in rlp: the 2.x root warns on target itself and also forwards it to the bundled v1 client; once the pin moves to 1.x, v1 warns too, so rlp should stop one of the two (drop its own warning or stop forwarding target).

Follow-up in rlp: once the bundled v1 SDK is pinned to a 1.x tag, the bundler should use 1.x's daytona.v1 module as the namespace entry instead of the whole root package, and can drop most of its error-class rewriting.

Verification

Run locally in the Nix dev shells:

  • Python: yarn lint:py (pylint, basedpyright) 0 errors / 0 warnings, pytest 759 passed; a test type-checks daytona.v1 as an installed library, and mypy resolves daytona.v1.Daytona to the v1 client
  • TypeScript: ESLint, Prettier and tsc clean, jest 472 passed (22 suites), nx build + attw clean
  • Go: golangci-lint 0 issues, go test -race ./... passed, examples/go builds
  • Ruby: rspec 581 examples, 0 failures; RuboCop adds no offenses on changed files
  • Go README quick start compiled with go vet
  • Java: ./gradlew build green
  • Per SDK, a driver calling deprecated root members twice printed the warning exactly once and confirmed .v1 is the same instance.
  • CI e2e suites (real Daytona API) pass for all five SDKs.

Documentation

  • This change requires a documentation update
  • I have made corresponding changes to the documentation

READMEs and examples use the .v1 form, add a "Versioned namespace" section and drop the deprecated target from config examples. Reference docs under artifacts/sdk-docs/ are regenerated, keeping only hunks this change produces.

Notes

@MDzaja MDzaja self-assigned this Oct 9, 2026
@vidoc-agent

vidoc-agent Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Vidoc security review

Tip

Good to merge — no security issues found. Reviewed 209 changed files.

💬 Have questions? Tag @vidoc in a comment and I'll answer.

@MDzaja

MDzaja commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

@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 50 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread sdk-ruby/lib/daytona/config.rb
Comment thread sdk-go/pkg/daytona/client_test.go Outdated
Comment thread sdk-python/src/daytona/common/daytona.py Outdated
Comment thread artifacts/sdk-docs/typescript-sdk/daytona.mdx Outdated
Comment thread artifacts/sdk-docs/typescript-sdk/daytona.mdx Outdated
Comment thread sdk-typescript/src/__tests__/v1.test.ts Outdated
Comment thread sdk-python/tests/test_v1.py Outdated
Comment thread sdk-python/tests/test_async_daytona.py
Comment thread sdk-ruby/lib/daytona/sdk.rb Outdated
Comment thread artifacts/sdk-docs/typescript-sdk/daytona.mdx Outdated
@MDzaja

MDzaja commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

@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 50 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread artifacts/sdk-docs/typescript-sdk/daytona.mdx Outdated
Comment thread sdk-python/tests/test_v1.py Outdated
Comment thread sdk-ruby/lib/daytona/config.rb Outdated
Comment thread sdk-ruby/spec/daytona/daytona_spec.rb
Comment thread sdk-ruby/spec/daytona/config_spec.rb Outdated
@MDzaja

MDzaja commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

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

No issues found across 50 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@MDzaja
MDzaja marked this pull request as ready for review October 12, 2026 07:23

@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 50 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread sdk-typescript/README.md Outdated
Comment thread sdk-java/README.md Outdated
Comment thread artifacts/sdk-docs/ruby-sdk/daytona.mdx Outdated
Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx Outdated
Comment thread artifacts/sdk-docs/typescript-sdk/daytona.mdx Outdated
Comment thread sdk-python/src/daytona/_async/daytona.py Outdated
Comment thread sdk-ruby/lib/daytona/config.rb Outdated
Comment thread artifacts/sdk-docs/python-sdk/sync/daytona.mdx Outdated
Comment thread artifacts/sdk-docs/ruby-sdk/config.mdx Outdated
Comment thread sdk-ruby/lib/daytona/common/daytona.rb
@MDzaja
MDzaja marked this pull request as draft October 12, 2026 13:35
@MDzaja

MDzaja commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

On hold for now. The per-create target part of this PR has moved to #355 as a standalone change; this PR keeps the v1 alias for later.

@MDzaja MDzaja changed the title feat(sdk): add v1 client namespace and per-create target feat(sdk): v1 namespace with deprecated root client and config target Oct 14, 2026
@MDzaja
MDzaja marked this pull request as ready for review October 14, 2026 12:57

@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

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread sdk-java/src/main/java/io/daytona/sdk/DaytonaV1.java
Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx Outdated
Comment thread sdk-go/README.md Outdated
Comment thread sdk-python/src/daytona/_sync/daytona.py Outdated
Comment thread sdk-go/pkg/daytona/snapshot.go
Comment thread sdk-python/src/daytona/_sync/daytona.py Outdated
Comment thread sdk-python/src/daytona/common/daytona.py Outdated
Comment thread sdk-ruby/spec/daytona/config_spec.rb Outdated
Comment thread sdk-python/src/daytona/_async/daytona.py Outdated
Comment thread sdk-ruby/spec/daytona/root_namespace_spec.rb Outdated

@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 9 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread artifacts/sdk-docs/go-sdk/types.mdx
Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx

@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 22 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx
Comment thread sdk-go/README.md Outdated
Comment thread sdk-ruby/spec/daytona/config_spec.rb
Comment thread sdk-java/src/main/java/io/daytona/sdk/Daytona.java
@MDzaja
MDzaja force-pushed the feat/v1-namespace branch from 66abc38 to fac741a Compare October 15, 2026 09:20
@MDzaja

MDzaja commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

@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 191 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx Outdated
Comment thread artifacts/sdk-docs/java-sdk/daytona.mdx
Comment thread sdk-python/tests/test_v1.py Outdated
Comment thread artifacts/sdk-docs/ruby-sdk/daytona.mdx
Comment thread sdk-python/src/daytona/_root.py Outdated
Comment thread sdk-ruby/spec/daytona/root_namespace_spec.rb
Comment thread sdk-python/src/daytona/__init__.py
Comment thread sdk-go/README.md
Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx Outdated
Comment thread sdk-ruby/lib/daytona/config.rb Outdated
@MDzaja
MDzaja force-pushed the feat/v1-namespace branch from fac741a to 6e98cd0 Compare October 15, 2026 09:52

@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 22 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread artifacts/sdk-docs/ruby-sdk/sandbox.mdx Outdated
Prepare SDK 1.x for SDK 2.x. In 2.x the root client exposes only .v1 / .v2,
close() and the context manager. 1.x now has the same shape: the existing
implementation becomes the v1 client, and the root client is a thin wrapper
that owns one v1 instance and keeps every previous member as a deprecated
forwarder, so existing code keeps working. Code written against daytona.v1
on 1.x runs unchanged on 2.x.

- v1 client: daytona.v1.Daytona / AsyncDaytona (Python), Daytona from
  @daytona/sdk/v1 (TypeScript), ClientV1 via client.V1() (Go),
  Daytona::V1::Daytona (Ruby), DaytonaV1 via daytona.v1() (Java)
- root members are marked deprecated and warn once per process on first use;
  close and the context manager are not deprecated; a parity test per SDK
  fails if the v1 client gains a member the root lacks
- DaytonaConfig.target and DAYTONA_TARGET are deprecated in favour of
  per-call target / region_id, with a separate one-time warning
- V1_API_URL, the 2.x shared error names, and V1-suffixed aliases
  (DaytonaV1, SandboxV1, ImageV1, ...) in the v1 namespace
- READMEs, examples and reference docs use the .v1 form

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@MDzaja
MDzaja force-pushed the feat/v1-namespace branch from 6e98cd0 to 2359f24 Compare October 15, 2026 10:09
@MDzaja

MDzaja commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

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

1 existing issue remains and 1 new issue found across 207 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="artifacts/sdk-docs/typescript-sdk/root-daytona.mdx">

<violation number="1" location="artifacts/sdk-docs/typescript-sdk/root-daytona.mdx:212">
P3: The generated `create()` parameter lists render literal `######` markers in the options entries. Fix the typedoc hook for nested option objects rather than editing this generated file, since the same artifact appears in image.mdx.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

**Parameters**:

- `params?` _CreateSandboxFromSnapshotParams_
- `options?` _###### timeout?_ - `number`

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The generated create() parameter lists render literal ###### markers in the options entries. Fix the typedoc hook for nested option objects rather than editing this generated file, since the same artifact appears in image.mdx.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At artifacts/sdk-docs/typescript-sdk/root-daytona.mdx, line 212:

<comment>The generated `create()` parameter lists render literal `######` markers in the options entries. Fix the typedoc hook for nested option objects rather than editing this generated file, since the same artifact appears in image.mdx.</comment>

<file context>
@@ -0,0 +1,357 @@
+**Parameters**:
+
+- `params?` _CreateSandboxFromSnapshotParams_
+- `options?` _###### timeout?_ - `number`
+
+**Returns**:
</file context>
Fix with cubic

…root by sync/async, raise every time under error filters

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>

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

5 issues found across 8 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdk-python/src/daytona/_root_sync.py">

<violation number="1" location="sdk-python/src/daytona/_root_sync.py:14">
P2: The new root wrappers import `typing_extensions.deprecated`, but the package only requires `typing-extensions>=4.0.0`; `deprecated` is available only from 4.5.0. Bump the dependency lower bound to `>=4.5.0` (or avoid this import), otherwise installs resolving 4.0–4.4.x fail when importing the root client.</violation>

<violation number="2" location="sdk-python/src/daytona/_root_sync.py:158">
P3: `getattr(self.v1, "create")` is equivalent to `self.v1.create` but returns `Any`, which hides this forwarding call from the type checker. Call `self.v1.create(...)` directly and resolve any overload mismatch explicitly, for example with a targeted `# type: ignore` and a comment.</violation>
</file>

<file name="artifacts/sdk-docs/python-sdk/root-daytona.mdx">

<violation number="1" location="artifacts/sdk-docs/python-sdk/root-daytona.mdx:6">
P3: This sentence says the sync root imports "only" the sync v1 chain, but `common/*` modules import the async generated clients (`daytona_api_client_async`, `daytona_toolbox_api_client_async`). Reword it to match what is true; update the module docstring too, since this mdx is regenerated from it.</violation>
</file>

<file name="sdk-python/src/daytona/_root_async.py">

<violation number="1" location="sdk-python/src/daytona/_root_async.py:6">
P3: This docstring says the module imports only the async v1 chain, but `common.daytona` pulls in `common.image`, which imports `daytona._sync.object_storage`. Reword it so it does not claim exclusive imports, for example: "built on the async v1 client (`daytona._async`)".</violation>
</file>

<file name="sdk-python/src/daytona/_versioning.py">

<violation number="1" location="sdk-python/src/daytona/_versioning.py:60">
P2: `warnings.warn` runs user-configurable warning handlers synchronously while `_lock` is held. A handler that touches another deprecated SDK path can then deadlock on this non-reentrant lock; keep the lock only around warning-state transitions and dispatch the warning outside it, resetting the state if an error filter raises.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

from types import TracebackType
from typing import Callable, overload

from typing_extensions import deprecated

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The new root wrappers import typing_extensions.deprecated, but the package only requires typing-extensions>=4.0.0; deprecated is available only from 4.5.0. Bump the dependency lower bound to >=4.5.0 (or avoid this import), otherwise installs resolving 4.0–4.4.x fail when importing the root client.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_sync.py, line 14:

<comment>The new root wrappers import `typing_extensions.deprecated`, but the package only requires `typing-extensions>=4.0.0`; `deprecated` is available only from 4.5.0. Bump the dependency lower bound to `>=4.5.0` (or avoid this import), otherwise installs resolving 4.0–4.4.x fail when importing the root client.</comment>

<file context>
@@ -0,0 +1,188 @@
+from types import TracebackType
+from typing import Callable, overload
+
+from typing_extensions import deprecated
+
+from ._sync.daytona import Daytona as _DaytonaV1
</file context>
Fix with cubic

if _root_namespace_warning_emitted:
return
# Mark as emitted only once warn() returns: with warnings turned into errors, every call raises.
warnings.warn(root_namespace_message(member_name), DeprecationWarning, stacklevel=user_stacklevel())

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: warnings.warn runs user-configurable warning handlers synchronously while _lock is held. A handler that touches another deprecated SDK path can then deadlock on this non-reentrant lock; keep the lock only around warning-state transitions and dispatch the warning outside it, resetting the state if an error filter raises.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_versioning.py, line 60:

<comment>`warnings.warn` runs user-configurable warning handlers synchronously while `_lock` is held. A handler that touches another deprecated SDK path can then deadlock on this non-reentrant lock; keep the lock only around warning-state transitions and dispatch the warning outside it, resetting the state if an error filter raises.</comment>

<file context>
@@ -56,8 +56,9 @@ def warn_root_namespace_once(member_name: str) -> None:
         if _root_namespace_warning_emitted:
             return
+        # Mark as emitted only once warn() returns: with warnings turned into errors, every call raises.
+        warnings.warn(root_namespace_message(member_name), DeprecationWarning, stacklevel=user_stacklevel())
         _root_namespace_warning_emitted = True
-    warnings.warn(root_namespace_message(member_name), DeprecationWarning, stacklevel=user_stacklevel())
</file context>
Fix with cubic

Comment on lines +158 to +159
create = getattr(self.v1, "create")
return create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: getattr(self.v1, "create") is equivalent to self.v1.create but returns Any, which hides this forwarding call from the type checker. Call self.v1.create(...) directly and resolve any overload mismatch explicitly, for example with a targeted # type: ignore and a comment.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_sync.py, line 158:

<comment>`getattr(self.v1, "create")` is equivalent to `self.v1.create` but returns `Any`, which hides this forwarding call from the type checker. Call `self.v1.create(...)` directly and resolve any overload mismatch explicitly, for example with a targeted `# type: ignore` and a comment.</comment>

<file context>
@@ -0,0 +1,188 @@
+        on_snapshot_create_logs: Callable[[str], None] | None = None,
+    ) -> Sandbox:
+        warn_root_namespace_once("create")
+        create = getattr(self.v1, "create")
+        return create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)
+
</file context>
Suggested change
create = getattr(self.v1, "create")
return create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)
return self.v1.create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)
Fix with cubic

hideTitleOnPage: true
---

The deprecated SDK 1.x sync root client. Imports only the sync v1 client chain.

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This sentence says the sync root imports "only" the sync v1 chain, but common/* modules import the async generated clients (daytona_api_client_async, daytona_toolbox_api_client_async). Reword it to match what is true; update the module docstring too, since this mdx is regenerated from it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At artifacts/sdk-docs/python-sdk/root-daytona.mdx, line 6:

<comment>This sentence says the sync root imports "only" the sync v1 chain, but `common/*` modules import the async generated clients (`daytona_api_client_async`, `daytona_toolbox_api_client_async`). Reword it to match what is true; update the module docstring too, since this mdx is regenerated from it.</comment>

<file context>
@@ -3,6 +3,8 @@ title: "RootDaytona"
 hideTitleOnPage: true
 ---
 
+The deprecated SDK 1.x sync root client. Imports only the sync v1 client chain.
+
 ## Daytona
</file context>
Suggested change
The deprecated SDK 1.x sync root client. Imports only the sync v1 client chain.
The deprecated SDK 1.x sync root client. Imports the sync v1 client chain and the shared `common` modules.
Fix with cubic

Comment thread sdk-python/src/daytona/_root_async.py Outdated

# pylint: disable=protected-access

"""The deprecated SDK 1.x async root client. Imports only the async v1 client chain."""

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: This docstring says the module imports only the async v1 chain, but common.daytona pulls in common.image, which imports daytona._sync.object_storage. Reword it so it does not claim exclusive imports, for example: "built on the async v1 client (daytona._async)".

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_async.py, line 6:

<comment>This docstring says the module imports only the async v1 chain, but `common.daytona` pulls in `common.image`, which imports `daytona._sync.object_storage`. Reword it so it does not claim exclusive imports, for example: "built on the async v1 client (`daytona._async`)".</comment>

<file context>
@@ -3,9 +3,11 @@
 
 # pylint: disable=protected-access
 
+"""The deprecated SDK 1.x async root client. Imports only the async v1 client chain."""
+
 from __future__ import annotations
</file context>
Suggested change
"""The deprecated SDK 1.x async root client. Imports only the async v1 client chain."""
"""The deprecated SDK 1.x async root client, built on the async v1 client (`daytona._async`)."""
Fix with cubic

@MDzaja

MDzaja commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

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

1 existing issue remains and 2 new issues found across 209 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdk-python/src/daytona/_root_async.py">

<violation number="1" location="sdk-python/src/daytona/_root_async.py:158">
P3: `getattr(self.v1, "create")` with a literal name bypasses basedpyright for this call. `v1.create`'s overloads reject the union `params` type, so a direct call would fail type checking. Any future signature change in `v1.create` will not be caught here. Narrow `params` with `isinstance` before calling, or add a typed cast.</violation>
</file>

<file name="sdk-python/src/daytona/_versioning.py">

<violation number="1" location="sdk-python/src/daytona/_versioning.py:25">
P2: The once-only warning state is scoped to each package copy, not the process. Importing both supported package names (`daytona` and `daytona_sdk`) can therefore emit duplicate root or target deprecation warnings; store the state in a process-global registry shared by both package names.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

+ "(CreateSnapshotParams.region_id) instead."
)

_root_namespace_warning_emitted = False

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The once-only warning state is scoped to each package copy, not the process. Importing both supported package names (daytona and daytona_sdk) can therefore emit duplicate root or target deprecation warnings; store the state in a process-global registry shared by both package names.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_versioning.py, line 25:

<comment>The once-only warning state is scoped to each package copy, not the process. Importing both supported package names (`daytona` and `daytona_sdk`) can therefore emit duplicate root or target deprecation warnings; store the state in a process-global registry shared by both package names.</comment>

<file context>
@@ -0,0 +1,78 @@
+    + "(CreateSnapshotParams.region_id) instead."
+)
+
+_root_namespace_warning_emitted = False
+_target_warning_emitted = False
+_lock = threading.Lock()
</file context>
Fix with cubic

on_snapshot_create_logs: Callable[[str], None] | None = None,
) -> AsyncSandbox:
warn_root_namespace_once("create")
create = getattr(self.v1, "create")

@cubic-dev-ai cubic-dev-ai Bot Oct 16, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: getattr(self.v1, "create") with a literal name bypasses basedpyright for this call. v1.create's overloads reject the union params type, so a direct call would fail type checking. Any future signature change in v1.create will not be caught here. Narrow params with isinstance before calling, or add a typed cast.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-python/src/daytona/_root_async.py, line 158:

<comment>`getattr(self.v1, "create")` with a literal name bypasses basedpyright for this call. `v1.create`'s overloads reject the union `params` type, so a direct call would fail type checking. Any future signature change in `v1.create` will not be caught here. Narrow `params` with `isinstance` before calling, or add a typed cast.</comment>

<file context>
@@ -0,0 +1,188 @@
+        on_snapshot_create_logs: Callable[[str], None] | None = None,
+    ) -> AsyncSandbox:
+        warn_root_namespace_once("create")
+        create = getattr(self.v1, "create")
+        return await create(params, timeout=timeout, on_snapshot_create_logs=on_snapshot_create_logs)
+
</file context>
Fix with cubic

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@MDzaja

MDzaja commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

@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 209 files

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx Outdated
Comment thread sdk-go/pkg/daytona/client.go
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@MDzaja

MDzaja commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

@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 209 files

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread sdk-go/pkg/daytona/v1_client.go
Comment thread artifacts/sdk-docs/go-sdk/daytona.mdx
…xample field name

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@MDzaja

MDzaja commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

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

No issues found across 209 files

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@MDzaja

MDzaja commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

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

No issues found across 209 files

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic

…mental_fork at v1.fork

Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
@MDzaja

MDzaja commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this PR

@MDzaja I have started the AI code review. It will take a few minutes to complete.

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

4 existing issues remain and 1 new issue found across 209 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdk-typescript/src/RootDaytona.ts">

<violation number="1" location="sdk-typescript/src/RootDaytona.ts:34">
P1: The root constructor forwards endpoint configuration to v1, so `root.v1` can use `apiUrl`, `serverUrl`, or `DAYTONA_API_URL` instead of the fixed `V1_API_URL` promised for portable root clients. Force the root-owned v1 client to `V1_API_URL` and keep custom endpoints on `@daytona/sdk/v1`.</violation>
</file>

Note: This PR contains a large number of files. cubic selects up to 200 of the highest-priority eligible files for this review, so some files may not have been reviewed.
Requires human review: Auto-approval blocked because this review re-detected 4 unresolved issues already reported by Cubic.
You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

View guided diff | Turn on auto-fix | Re-trigger cubic


/** Creates the root client and its v1 client from `config` (or the environment). */
constructor(config?: DaytonaConfig) {
this.client = new DaytonaV1(config)

@cubic-dev-ai cubic-dev-ai Bot Oct 17, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: The root constructor forwards endpoint configuration to v1, so root.v1 can use apiUrl, serverUrl, or DAYTONA_API_URL instead of the fixed V1_API_URL promised for portable root clients. Force the root-owned v1 client to V1_API_URL and keep custom endpoints on @daytona/sdk/v1.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At sdk-typescript/src/RootDaytona.ts, line 34:

<comment>The root constructor forwards endpoint configuration to v1, so `root.v1` can use `apiUrl`, `serverUrl`, or `DAYTONA_API_URL` instead of the fixed `V1_API_URL` promised for portable root clients. Force the root-owned v1 client to `V1_API_URL` and keep custom endpoints on `@daytona/sdk/v1`.</comment>

<file context>
@@ -0,0 +1,157 @@
+
+  /** Creates the root client and its v1 client from `config` (or the environment). */
+  constructor(config?: DaytonaConfig) {
+    this.client = new DaytonaV1(config)
+  }
+
</file context>
Fix with cubic

This branch has not been deployed

No deployments
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.

1 participant