fix(#164): Update YOLO plugin to Phase 12 input contract (image_bytes)#93
Merged
fix(#164): Update YOLO plugin to Phase 12 input contract (image_bytes)#93
Conversation
…base64 Implements Phase 12 input contract: - Replace frame_base64 (base64 string) with image_bytes (bytes) - Update all tool functions to decode bytes → numpy array - Remove base64 validation/decoding helpers - Remove 'default' tool fallback (violates Phase 12) - Update tool input schemas to declare image_bytes - Add input contract tests (9 tests, all passing) This fixes the root cause of #164: YOLO was expecting frame_base64 but TaskProcessor sends image_bytes. Both YOLO and OCR now use the unified Phase 12 contract. Test results: - tests_contract/test_input_contract.py: 9/9 PASSED - mypy: clean - ruff: clean Closes #164 Amp-Thread-ID: https://ampcode.com/threads/T-019c3d29-4079-72fc-98f6-c6493dddb940 Co-authored-by: Amp <amp@ampcode.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
Fix #164: YOLO plugin now accepts
image_bytes(bytes) instead offrame_base64(base64 string), matching Phase 12 unified input contract.Changes
frame_base64withimage_bytesin all tool functionsimage_bytesfieldRoot Cause of #164
Server sends:
{"image_bytes": bytes}YOLO was looking for:
args.get("frame_base64")→ NoneResult: NoneType.startswith() crash
After Fix
Server sends:
{"image_bytes": bytes}YOLO now looks for:
args.get("image_bytes")✅Result: Decodes bytes → numpy array → inference → boxes ✅
Testing
Governance
Implements Phase 12 input contract:
image_bytes: bytesframe_base64,image, orimage_base64keysCloses #164