something is wrong. an agent wrote " The image gen server keeps failing — it's not a…
- User
something is wrong. an agent wrote " The image gen server keeps failing — it's not a rate limit this time, it's a generation error. Let me speak to the room and try the Words to Worlds soundtrack while the image server recovers. Then one more attempt.Openbotcity actionOpenbotcity actionOne final attempt on the self-portrait — trying cloudflare generator explicitly.Openbotcity actionOpenbotcity actionImage gen is down server-side — not a rate limit, a consistent failure across multiple generators. Moving on. Back to the Waveform Studio for the Words to Worlds soundtrack (Worldbuilder badge)."
Assistant
Let me investigate the image generation action handler to see what's failing.
Assistant
Now let me check the actual Cloudflare AI and PixelLab error handling to see what could cause consistent generation failures.
Assistant
Now let me check the actual worker logs to see what errors are coming back.
Assistant
Let me check the live worker logs to see the actual Cloudflare AI errors.
Assistant
That's frontend traffic. Let me check the API worker logs specifically for image generation errors.
Assistant
No live image gen traffic right now. Let me check recent Cloudflare Workers AI status and also look at what the agent's action calls look like.
Assistant
Found the issue. Cloudflare Workers AI has been having outages since March 25-26 — the agent's image generation failures are from
env.AI.run()throwing on the SDXL-Lightning model.The problem in the code: there's no automatic fallback. When Cloudflare AI fails, the agent gets a generic "Image generation failed — please try again" with no fallback to PixelLab. The agent tried passing
generator: "cloudflare"explicitly, which is already the default — doesn't help.Two things we should fix:
- Auto-fallback: If the default provider (Cloudflare) fails, automatically try PixelLab before returning an error
- Better error detail: Tell the agent which provider failed so it can make smarter decisions
Want me to implement the auto-fallback?
Sources:
- User
everything is operational at cloudflare. why they can't create images ???
Assistant
Let me look at how the agent is actually calling image generation through the MCP action tool.
Assistant
The action tool maps
/actions/create-image→/artifacts/generate-image. Let me check if the AI binding and PixelLab key are actually configured.Assistant
AI binding and PIXELLAB_API_KEY both exist. Let me test the actual endpoint directly to see what error comes back.
Assistant
Model is fine and active. Let me test the actual Cloudflare AI binding from inside the worker.
Assistant
Wait — I see
PIXELLABS_API_KEY(with an S) in the local env, but the code usesPIXELLAB_API_KEY. Let me verify the production secret name vs what the code expects.Assistant
That's not the production issue though (local .env typo is just for local dev, production uses wrangler secrets which has the right name). Let me look at this from a different angle — check what the agent is actually sending and whether it's even reaching the generation step.
Assistant
Storage is all 200s. Let me query the DB directly for recent failed image generation attempts.
Assistant
Images ARE being generated successfully — 10 in the last 24h. Both Cloudflare (
nullgenerator) and PixelLab are working. So it's not a system-wide issue. Let me find which specific agent is failing and why.Assistant
DeepBlocker is the one failing — recent paint actions at 19:52 and 20:28 UTC. Let me check their situation.
Assistant
Found it. DeepBlocker has NEVER successfully created an image — 0 image artifacts ever. And looking at their building history:
- Currently in: Neon Lounge (social_lounge)
- Previous visits: amphitheater, workshop, library, fountain_park
DeepBlocker has never been inside an art_studio. The
/artifacts/generate-imageendpoint requiresbuilding_type === 'art_studio'(line 95 ofgenerateImage.ts). The agent keeps trying to paint from non-art-studio buildings and getting a 403:"Image generation requires being inside an art_studio"
The agent interprets this as "the image gen server is down" because the error message is generic from the MCP tool layer:
Action failed: Image generation requires being inside an art_studio. The agent apparently doesn't understand it needs to physically enter an art_studio building first.- User
yes!!!! Option 2 (better error surfacing) is worth doing regardless, because "Image generation failed — please try again" is genuinely ambiguous. A message like "You must be inside an art_studio building to generate images. Enter one first with /actions/enter-building." would have caught this immediately. That's a one-line fix that saves every future agent the same confusion.
Assistant
Looking at the code again — the API error messages are actually clear (
"Image generation requires being inside an art_studio"), but the MCP tool's example is the real culprit. It shows:codePOST /actions/create-image {"title": "...", "prompt": "..."}No
building_id! So the agent never includes it, gets a 400, and interprets it as a server error.Assistant
Now let me also check
compose-track/ music generation to make sure it has the same building requirement.Assistant
Good, music_studio is correct. Now let me also check
create-text— does it require a specific building type?Assistant
Good —
create-textdoesn't need a building. The fix is clean. Let me verify the final file looks right.Assistant
Now let me check if there are tests for the action tool.
Assistant
No tests for the MCP package. Let me check if this needs to be published/deployed.
Assistant
Done. Here's what was wrong and what I fixed:
Root cause: DeepBlocker was never entering an
art_studiobuilding before trying to generate images. The agent kept tryingcreate-imagefrom social lounges, workshops, libraries — all of which return 403 "Image generation requires being inside an art_studio". The agent misread this as "the server is down."Why the agent was confused: The MCP tool's example showed
create-imagewith only{"title": "...", "prompt": "..."}— nobuilding_idfield. So the agent never knew it needed to pass one, and never knew it needed to be in an art_studio specifically.Fix (
packages/mcp/src/tools/action.ts:75-76): Updated theCOMMON_ACTIONSexamples to includebuilding_idand annotate the building type requirement:create-image→(must be inside an art_studio)compose-track→(must be inside a music_studio)
This needs an npm publish (
openbotcity-mcp) + Cloudflare MCP deploy to take effect. Want me to build and publish?- User
what is the command for npm publish AND can you cloudflare mcp deploy please (as well as update the github)
Assistant
Build OK. Now deploying to Cloudflare and pushing to GitHub:
Assistant
Cloudflare deployed, GitHub pushed. For npm publish, run:
code! cd /Users/vincentsider/Projects/obc/packages/mcp && npm publish --access public(npm publish requires interactive auth which I can't do — you'll need to run it yourself with the
!prefix.)All three targets:
- Cloudflare: deployed to
mcp.openbotcity.com - GitHub: pushed to
openclawcity/mcp - npm: ready — just run the command above
- Cloudflare: deployed to
- User
npm notice total files: 46 npm notice npm error You cannot publish over the previously published versions: 0.2.3. npm error A complete log of this run can be found in: /Users/vincentsider/.npm/_logs/2026-03-26T20_53_43_166Z-debug-0.log vincentsider@macbook-pro mcp %
Assistant
Need to bump the version first.
Assistant
Now run:
code! cd /Users/vincentsider/Projects/obc/packages/mcp && npm publish --access public