Skip to content

feat: clear auto-stop on resume; size-check file read/list - #21

Merged
parnexcodes merged 1 commit into
mainfrom
feat/resume-clear-ttl
Oct 11, 2026
Merged

parnexcodes merged 1 commit into
mainfrom
feat/resume-clear-ttl

Conversation

@parnexcodes

@parnexcodes parnexcodes commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Closes #20
Closes #19

What

  • docks.resume(ttl_seconds=UNSET): omitted keeps the current value, None sends ttlSeconds: null (clears auto-stop), a number sets it. Same pattern as update.
  • files.read, files.read_bytes and files.list check the UTF-8 byte length of the final command and raise DockError("file_too_large", 0, ...) before sending when it exceeds 64 KB.
  • README updated.

Why

Backend (usedock/dock #75) now accepts ttlSeconds on resume (number sets, null clears, absent keeps). An over-long path previously produced an opaque API error on read/list; dock-js and dock-go already refuse locally.

How to verify

Run in a venv: ruff check . && ruff format --check . && mypy && DOCK_SCENARIOS_DIR=<dock>/sdk-scenarios DOCK_SCENARIOS_REQUIRED=1 pytest -rs

  • ruff, ruff format, mypy: pass.
  • New tests: resume unset/null/number body shapes; read/read_bytes/list over the limit with a multibyte path raise file_too_large with zero requests sent.

Risk

Low. resume(ttl_seconds=None) now sends null instead of omitting (intended). The size check only rejects commands the API would reject anyway.

After rebasing on main (SCENARIOS_REF 05d0182), all offline scenarios pass, including list-connectors and list-images.

🤖 Generated with Claude Code

resume(ttl_seconds=UNSET): None sends ttlSeconds null, a number sets it.
files.read/read_bytes/list raise file_too_large (status 0) before
sending when the UTF-8 command exceeds the 64 KB exec limit.

Fixes #20
Fixes #19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@parnexcodes
parnexcodes force-pushed the feat/resume-clear-ttl branch from 08dda97 to 963b79f Compare October 11, 2026 01:19

@parnexcodes parnexcodes left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review: feat: clear auto-stop on resume; size-check file read/list

Verdict: SHIP

Rebased on origin/main (after #18: connectors/images, SCENARIOS_REF 05d0182). One conflict in tests/test_client.py, resolved by keeping both sides; client.py, README and SCENARIOS_REF merged cleanly. Force-pushed as 963b79f.

Verified against the backend at usedock/dock 51d3036 (#75): ResumeDockDto.ttlSeconds is @IsOptional with number | null, and DocksService.resume writes ttlSeconds only when it is not undefined (null clears, absent keeps). resume(ttl_seconds=UNSET) matches this and matches update and dock-js (compact drops only undefined, so null is sent). The read/list commands are byte-identical to dock-js readCommand/listCommand, and _check_size counts UTF-8 bytes against the same 64 KB limit as assertCommandSize, with file_too_large, status 0 and nothing sent.

Blocking

None.

Non-blocking

  1. PR body "How to verify" still reports 2 failing scenarios (list-connectors, list-images). After the rebase, all offline scenarios pass against SCENARIOS_REF. Update the body.
  2. README.md:51 says "files.read and files.list"; read_bytes is covered too. Mention it if you want the README complete.

Checks

  • ruff check ., ruff format --check .: pass
  • mypy: pass (4 source files)
  • pytest -rs with DOCK_SCENARIOS_DIR at usedock/dock 05d0182 and DOCK_SCENARIOS_REQUIRED=1: 98 passed, 9 skipped (8 live scenarios without credentials, 1 CI-only). All 8 offline scenarios pass, including list-connectors and list-images.
  • Mutation check: with the base client.py, all 4 new tests fail. The multibyte path (40003 chars, about 80 KB) also catches a check that counts characters instead of bytes.
  • CI after the rebase: test 3.9/3.13, gitleaks, cla all pass.

@parnexcodes
parnexcodes merged commit 7458df9 into main Oct 11, 2026
7 checks passed
@parnexcodes
parnexcodes deleted the feat/resume-clear-ttl branch October 11, 2026 01:21
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
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.

sdk: clear auto-stop on resume (ttlSeconds null) sdk: raise file_too_large for read and list commands over the exec limit

1 participant