agent CLI: accept tcp:// / rfc2217:// / socket:// (route via platform factory)#87
Merged
Merged
Conversation
… factory) The six `defib agent ...` commands hardcoded `SerialTransport.create(port)`, so `-p tcp://<host>:<port>` returned "No such file or directory: 'tcp:...'" even though the underlying agent protocol works fine over `SocketTransport` (now that PR #86 fixed the multi-packet recv-loss on async transports). Drop-in switch to `create_transport(normalize_port_name(port))` — the same factory the burn / install / restore commands already use. Help strings updated to mention the supported URL schemes globally. Affected: `agent upload`, `agent flash`, `agent info`, `agent read`, `agent write`, `agent scan`. Verified end-to-end against rack pod at 10.216.128.69: defib agent info -p tcp://10.216.128.69:9000 JEDEC ID: ef4018, Flash: 16384 KB, caps: flash_stream, sector_bitmap, page_skip, set_baud, reboot, selfupdate, scan defib agent read -p tcp://10.216.128.69:9000 -a 0x14050000 -s 256 256/256 bytes, CRC32 OK on device — uImage header visible defib agent scan -p tcp://10.216.128.69:9000 256/256 sectors scanned in 29.6 s — "Flash is healthy!" Suite: 457 passed / 2 skipped; ruff + mypy clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
The six
defib agent ...commands hardcodedSerialTransport.create(port), so-p tcp://<host>:<port>errored with "No such file or directory: 'tcp://...'", even though the underlying COBS protocol works fine overSocketTransport(now that #86 fixed the multi-packet recv-loss).Drop-in switch to
create_transport(normalize_port_name(port))— the same factoryburn/install/restorealready use. Help strings on every command updated to mention the supported URL schemes globally.Affected:
agent upload,agent flash,agent info,agent read,agent write,agent scan.Verification on rack pod at
10.216.128.69The scan command in particular is a stress test of the multi-packet bridge path — every sector returns its own
RSP_SCANpacket plus the finalRSP_ACK. Streams cleanly thanks to #86's leftover-buffer fix.Test plan
uv run pytest tests/ -x -v --ignore=tests/fuzz— 457 passed / 2 skippeduv run ruff check src/defib/cli/app.pyuv run mypy src/defib/cli/app.py --ignore-missing-imports/dev/ttyUSB*(they go through the samecreate_transportfactory, so should be unchanged).🤖 Generated with Claude Code