Repository navigation
Description
Summary
When using gpt-5.5, reading an image with the read tool appears to end the agent turn after the image attachment is returned. The tool result is otherwise valid and the model can see/use the image, but the agent stops until the user manually sends another message.
This is disruptive for interactive use and breaks automated workflows that expect the agent to continue reasoning after read returns an image.
Current Behavior
- The agent calls
readon an image file. readreturns text plus an image content block.- With
gpt-5.5, the agent yields control instead of continuing to the next model call automatically. - The user must manually prompt the agent to proceed.
Proposed Behavior
- Image reads should behave like text reads from the agent-loop perspective.
- Unless the tool result explicitly sets
endTurn: true, the agent should continue to the next model call after processing the image tool result. - Automated workflows should be able to read images and continue without user intervention.
Acceptance Criteria
- Reproduce the issue with
gpt-5.5by callingreadon a supported image file. - Identify whether the premature yield is caused by provider response handling, image tool-result conversion, agent-loop stop-reason handling, or TUI/session orchestration.
- Add or update tests that cover image-returning tool results through the affected provider path.
- Confirm
readimage results do not set or implyendTurn. - Confirm tools that intentionally set
endTurn: truestill end the turn. - Manual verification: with
gpt-5.5, ask the agent to inspect an image and continue with a follow-up action; it should proceed without an extra user message.
Context
Reported behavior: "when using gpt-5.5 to view images, for some reason the READ tool on an image is ending the agents turn. Everything works but its annoying to have to manually tell the agent to proceed and this breaks any automated workflows."
Technical Notes
Relevant areas to inspect:
packages/coding-agent/src/core/tools/read.ts— image reads return a text note plus animagecontent block and should not setendTurn.packages/agent/src/agent-loop.ts— tool results should only stop the loop when the tool result explicitly hasendTurn: true.packages/agent/src/types.ts—AgentToolResult.endTurndocuments the explicit yield mechanism.packages/ai/test/openai-responses-tool-result-images.test.ts— existing coverage for OpenAI Responses-style tool-result images.packages/ai/test/image-tool-result.test.ts— cross-provider image tool-result coverage.
There may already be tests proving image tool results can be sent to providers, so the missing coverage may need to be closer to the full coding-agent/agent-loop flow with the read tool and the openai-codex/gpt-5.5 route.
Suggested Labels
bugP1
Activity
aebrer commentedon Jun 18, 2026
Reproduction Evidence from Session Log
I inspected the recent session log named
crengine drawbuf invertColors:/home/drew/.dreb/agent/sessions/--home-drew--/2026-06-17T21-47-56-476Z_7d14458e-e50b-4bad-8454-2ef19577f934.jsonlNear the end, the log shows the symptom clearly:
2026-06-18T21:56:07.218Z, the assistant callsreadon/home/drew/Downloads/signal-2026-06-18-175507.jpeg.2026-06-18T21:56:07.800Z, thereadtool returns successfully with:Read image file [image/png] ...image/png, base64 payload length about 1.58 MB2026-06-18T21:56:31.644Z:and the next one too./home/drew/Downloads/signal-2026-06-18-175507_002.jpeg:readat2026-06-18T21:56:36.069Z2026-06-18T21:56:36.551Zwith text plus image payload length about 1.52 MBSo what do you think, not bad right? ...Important observations:
readtool result itself is successful (isError: false).readtool settingendTurn, and there is no obvious explicit assistant stop/error immediately after the image tool result.This should be useful as a concrete repro trace for implementation planning.
Automated progress note by mach6
aebrer commentedon Jun 18, 2026
Additional Confirmation
User confirmed that the model did successfully read and understand the image contents after the manual follow-up. The issue is therefore not that image tool results are unusable or invisible to
gpt-5.5; the problem is specifically that the agent turn ends prematurely after the image-bearingreadtool result, requiring a user nudge before the model continues reasoning about the image.Automated progress note by mach6
aebrer commentedon Jun 18, 2026
Issue Assessment: Expected Background-Agent Guardrail
Root cause identified: this was not caused by
gpt-5.5, image tool-result serialization, or thereadtool.The session that appeared to reproduce the issue had background subagents running. dreb intentionally limits parent-agent continuation while background agents are active to prevent the parent from spinning/hyperactively continuing while waiting for subagent results.
Relevant implementation:
packages/coding-agent/src/core/tools/subagent.tsendTurn: trueintentionally.packages/coding-agent/src/core/agent-session.ts_bgTurnCounter.BG_TURN_LIMIT = 3.agent.setShouldContinue(...), which returns false once the parent has taken enough turns while background agents are still active.packages/agent/src/agent-loop.tsconfig.shouldContinue()before subsequent LLM calls, so when the guardrail says stop, the loop ends cleanly without another assistant message.Why it looked image-specific:
readresults were successful and visible to the model.Conclusion: close as expected behavior / not planned. No code change needed.
Automated assessment by mach6