fix(daemon): route image requests into media generation#3988
Conversation
Generated-By: looper 0.9.3 (runner=worker, agent=opencode)
Generated-By: looper 0.9.3 (runner=worker, agent=opencode)
Generated-By: looper 0.9.3 (runner=worker, agent=opencode)
Generated-By: looper 0.9.6 (runner=worker, agent=opencode)
|
@mrcfps I'm holding off on generating review comments for #3988 because this pull request has merge conflicts right now. Please resolve the conflicts with main and push the updated branch. Once that's done, request or wait for the review to run again and I'll take another look. 🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 370f7da246
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Generated-By: looper 0.9.6 (runner=fixer, agent=opencode)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bc3b3126b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Siri-Ray
left a comment
There was a problem hiding this comment.
@mrcfps Thanks for pushing this image-routing fix forward. I reviewed the daemon run-routing changes and the BYOK OpenAI image tool path; the main paths are covered, but I found one credential-precedence case worth tightening before users with an existing custom image provider hit it.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.
Generated-By: looper 0.9.6 (runner=fixer, agent=opencode)
|
Looper fixer round complete — e14819a
🔁 Powered by Looper · runner=fixer · agent=opencode · An autonomous AI dev team for your GitHub repos. |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e14819a2a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Siri-Ray
left a comment
There was a problem hiding this comment.
@mrcfps Thanks for continuing to tighten the image-routing flow. I reviewed the daemon routing changes, the OpenAI image tool loop, and the added regression coverage. One main-path gap is still present: the new OpenAI proxy gate depends on projectId, but the current web OpenAI-compatible caller does not forward the proxy context, so the BYOK OpenAI Image project path described in the PR will still miss the tool loop from the UI.
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.
Generated-By: looper 0.9.6 (runner=fixer, agent=opencode)
|
Looper fixer round complete — 0a17735
🔁 Powered by Looper · runner=fixer · agent=opencode · An autonomous AI dev team for your GitHub repos. |
|
To use Codex here, create an environment for this repo. |
Generated-By: looper 0.9.6 (runner=fixer, agent=opencode)
|
Looper fixer round complete — 3531c30
🔁 Powered by Looper · runner=fixer · agent=opencode · An autonomous AI dev team for your GitHub repos. |
|
To use Codex here, create an environment for this repo. |
Siri-Ray
left a comment
There was a problem hiding this comment.
@mrcfps I reviewed the current head's daemon image-routing changes, the BYOK OpenAI image tool loop, the credential/base-url fixes from the follow-up commits, and the web OpenAI proxy context forwarding. The previous concerns are addressed in the changed ranges, and I did not find any additional actionable correctness or safety issues. Thanks for sticking with this and tightening the regression coverage around the real user paths. 🙂
🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.Generated-By: looper 0.9.6 (runner=fixer, agent=opencode)
Siri-Ray
left a comment
There was a problem hiding this comment.
@mrcfps I reviewed the current head's changed ranges across the daemon image-routing fallback, the OpenAI BYOK image tool loop, media credential precedence, web proxy context forwarding, and the added daemon/web regression coverage. The previous review concerns are addressed on this head, and I did not find any new actionable correctness, safety, or maintainability issues. I was not able to rerun the targeted Vitest commands in this prepared worktree because vitest is not installed in the package context, but the changed test coverage matches the user paths this PR is protecting. Thanks for continuing to tighten this flow and for carrying the follow-up fixes through. 🙂
































































Closes #2953
Why
Users reported that plain image/poster requests could stay on the normal chat/code path instead of producing a real image file. I picked this up to close the repro where Image projects backed by BYOK OpenAI chat would print an
od media generatecommand, and short freeform prompts likeimagecould miss the media router entirely.What users will see
When they ask Open Design to generate an image or poster, the request now stays on the image-generation path more reliably:
imageroute into media generation instead of code output;Surface area
apps/weborapps/desktop(including Electron menu bar)odsubcommand or flag, newtools-dev/tools-pack/tools-prflag, or newOD_*env var/api/*endpoint, new SSE event, or changed shape inpackages/contractsskills/,design-systems/,design-templates/, orcraft/, or change to the skills protocolTRANSLATIONS.mdfor the locale workflow)package.json(dependenciesordevDependencies); workspace-packagepackage.jsonfiles are out of scope. Include a paragraph on what we get vs. what bytes we ship (seeCONTRIBUTING.md→ Code style)Screenshots
None.
Bug fix verification
apps/daemon/tests/chat-route.test.ts,apps/daemon/tests/proxy-routes.test.tsmainand green on this branch? no — I verified the targeted regressions green on this branch, but did not re-run them onmainin this worktree.Validation
pnpm exec vitest run -c vitest.config.ts tests/proxy-routes.test.tspnpm exec vitest run -c vitest.config.ts tests/chat-route.test.ts -t "routes concise image-only prompts away from od-default and into image generation"pnpm --filter @open-design/daemon typecheckpnpm guardpnpm typecheck🔁 Powered by Looper · runner=worker · agent=opencode · An autonomous AI dev team for your GitHub repos.