Repository navigation
feat: send images to serverless agents from the playground and CLI - #822
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Co-Authored-By: Mohamed <mo@digger.dev>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Mohamed <mo@digger.dev>
|
Tested locally against a real Blue worker (https://github.com/diggerhq/blue/pull/133) and a real OpenCode/model runtime, with no API mocking. Passed: picker preview and removal; image + text, where the base64 sent matched the original file byte for byte and the model correctly identified the orange triangle and blue circle in the fixture; image-only send via paste; drag and drop; inline notices for SVG, files over 5 MB and a 5th image; image + steer gets queued; a text-only request has no
Follow-ups from the run:
Not covered: workerd forwarding (covered by an integration test instead), sending an image successfully from the CLI (a local route mismatch between |
…chments Co-Authored-By: Mohamed <mo@digger.dev> # Conflicts: # web/src/managed-agents/Detail.tsx
…chments Co-Authored-By: Mohamed <mo@digger.dev> # Conflicts: # web/src/managed-agents/Detail.tsx
Summary
This adds the client side of image turns. The backend support is in diggerhq/blue
feat/turn-image-attachments, which addsattachmentstoPOST /sessions/:id/turns. That PR needs to be deployed before the images reach the agent.Web playground (
managed-agents/Detail.tsx,images.ts):imageRefusalrejects anything that isn't PNG, JPEG, GIF or WebP, anything over 5 MB, and more than 4 images, with a message shown inline.FileUIPartdata URLs.ManagedAgentChatTransportturns them intoattachmentsforrunManagedAgentandcontinueManagedAgentSession. When a session is already active,admitManagedAgentInputsends them directly.CLI:
readTurnImageschecks that each path is a regular file of at most 5 MB, finds the type from the file's magic bytes (the file extension is ignored), and allows at most 4 images.createTurn(sessionId, input, key, attachments = [])only addsattachmentsto the request body when there are some, so text-only requests are sent exactly as before.Verified locally:
clinpm test(135 passed) andtsc;webvitest(299 passed),npm run build, and eslint on the changed files. The only remaining lint error inDetail.tsx(react-refresh/only-export-componentsonPROJECT_DETAIL_TABS) is already onmain.Link to Devin session: https://app.devin.ai/sessions/af9f2258a9af4cad96662ae2c820b4f1
Open in Devin Desktop: https://app.devin.ai/desktop/session/af9f2258a9af4cad96662ae2c820b4f1?variant=devin
Requested by: @motatoes
Polylane reviews this pull request when you ask: