fix: SDK API compatibility, port range, and empty string form handling#1
Open
hjpinheiro wants to merge 3 commits into
Open
fix: SDK API compatibility, port range, and empty string form handling#1hjpinheiro wants to merge 3 commits into
hjpinheiro wants to merge 3 commits into
Conversation
The Daytona SDK changed the list() signature from list(limit=N) to list(query=ListSandboxesQuery). The old call caused credential validation to fail on every new install with the current SDK (0.187.0). Also pin daytona>=0.187.0,<0.188.0 to match the tested API surface. The previous daytona>=0.1.0 had no upper bound, silently installing incompatible SDK versions.
The previous 3000-9999 restriction blocked valid services running on common ports (80, 443, 8000, etc.). Use the full valid TCP port range.
Dify form inputs send empty strings (not None) when fields are left
blank. The previous code only checked for None, causing ValueError on
int("") when cpu/memory/disk/auto_stop_interval were empty.
Treat empty strings the same as None for all numeric resource parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three bug fixes that prevent the plugin from working correctly with the current Daytona SDK (0.187.0).
1. Credential validation broken —
list()API changeThe Daytona SDK changed the
list()signature:This causes credential validation to fail on every new install.
2. Unpinned SDK dependency
daytona>=0.1.0has no upper bound and silently installs incompatible SDK versions. Pinned to>=0.187.0,<0.188.0to match the tested API surface.3. Port range restriction (3000–9999 → 1–65535)
get_preview_urlrejected valid ports outside the arbitrary 3000–9999 range, blocking common services (port 80, 443, etc.).4. Empty string form values crash
create_sandboxDify form inputs send empty strings (
"") when fields are left blank, notNone. The previousis Nonechecks missed this, causingValueError: invalid literal for int() with base 10: ""whencpu,memory,disk, orauto_stop_intervalwere empty.Testing
yaml.safe_load()py_compilelist()signature verified against installeddaytona==0.187.0Files changed
provider/daytona.pylist(limit=1)→list(query=ListSandboxesQuery(limit=1))requirements.txtdaytona>=0.1.0→daytona>=0.187.0,<0.188.0pyproject.tomltools/get_preview_url.py3000-9999→1-65535tools/get_preview_url.yamlllm_descriptionport rangetools/create_sandbox.py""same asNonefor numeric params