Repository navigation
feat: clear auto-stop on resume; size-check file read/list - #21
Conversation
08dda97 to
963b79f
Compare
parnexcodes
left a comment
There was a problem hiding this comment.
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
- 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. README.md:51says "files.readandfiles.list";read_bytesis covered too. Mention it if you want the README complete.
Checks
ruff check .,ruff format --check .: passmypy: pass (4 source files)pytest -rswith 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.
Closes #20
Closes #19
What
docks.resume(ttl_seconds=UNSET): omitted keeps the current value,NonesendsttlSeconds: null(clears auto-stop), a number sets it. Same pattern asupdate.files.read,files.read_bytesandfiles.listcheck the UTF-8 byte length of the final command and raiseDockError("file_too_large", 0, ...)before sending when it exceeds 64 KB.Why
Backend (usedock/dock #75) now accepts
ttlSecondson 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 -rsfile_too_largewith 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