Repository navigation
fix(fal): write onboarding default image model to mediaModels.image - #123447
Conversation
applyFalConfig wrote the default image model to agents.defaults.imageGenerationModel, a retired key the runtime never reads (image generation resolves agents.defaults.mediaModels.image, and the retired key is reported as an unrecognized dead key by config validation). After fal onboarding, image_generate still failed with "No image-generation model configured." until a doctor --fix migration ran. Write mediaModels.image directly, matching the vydra and pixverse onboarding flows.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 10:39 AM ET / 14:39 UTC. ClawSweeper reviewWhat this changesThe PR changes Fal API-key onboarding to save its default image model in Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still writes Fal onboarding’s image default to the retired key, while the image runtime reads only the canonical media-model setting. The patch repairs that producer boundary without altering existing user-selected media defaults. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherFal onboarding persists provider defaults after API-key setup. Image generation later resolves that default into the provider/model used for flowchart LR
A[Fal API-key onboarding] --> B[Fal config writer]
B --> C[Agent media-model defaults]
C --> D[Image model resolver]
D --> E[Image generation request]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +37. Total +38 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the owner-plugin change for future Fal onboarding while keeping any pre-existing retired configuration on the canonical repair path. Do we have a high-confidence way to reproduce the issue? Yes—source inspection gives a high-confidence path: current Fal onboarding writes only the retired field, while the image runtime resolves only Is this the best way to solve the issue? Yes—the producer-owned Fal onboarding writer is the narrowest maintainable repair, and its canonical merge pattern matches the Vydra provider rather than adding a runtime compatibility path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8458777e6a75. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Merged via squash.
|
…ge (openclaw#123447) applyFalConfig wrote the default image model to agents.defaults.imageGenerationModel, a retired key the runtime never reads (image generation resolves agents.defaults.mediaModels.image, and the retired key is reported as an unrecognized dead key by config validation). After fal onboarding, image_generate still failed with "No image-generation model configured." until a doctor --fix migration ran. Write mediaModels.image directly, matching the vydra and pixverse onboarding flows.
Summary
fix(fal): write the onboarding default image model to
agents.defaults.mediaModels.image— the key the runtime actually reads — instead of the retiredimageGenerationModelkeyWhat Problem This Solves
After completing fal onboarding (auth wizard /
--fal-api-key), the generated config sets the default image model soimage_generateworks out of the box. ButapplyFalConfigwrites it to a retired key:The runtime never reads that key — image generation resolves
agents.defaults.mediaModels.image(src/image-generation/runtime.ts:71viaresolveCapabilityModelCandidates). Three independent confirmations that the written key is dead:src/config/dead-config-keys.test.ts:53assertsagents.defaults.imageGenerationModelis reported as an unrecognized dead key by config validation.mediaModels.imageruns in doctor (legacy-config-migrations.runtime.retired.ts), i.e. the user must runopenclaw doctor --fixbefore the onboarding result takes effect.vydra/onboard.tsandpixverse/onboard.tsboth writemediaModels.image|video.代码证据:
extensions/fal/onboard.ts:6-22(writesimageGenerationModel);src/image-generation/runtime.ts:71(readsmediaModels.image).Trigger condition: any fresh fal onboarding.
User symptom: right after onboarding,
image_generatestill throwsNo image-generation model configured.— the onboarding result is a no-op until the user happens to rundoctor --fix.Root Cause
bca2501c7f7(2026-05-27) writing the then-current key; when the config schema moved image models tomediaModels.image, this call site was missed (vydra/pixverse onboardings were written later against the new key).Why This Fix
mediaModels.imagedirectly, mirroringvydra/onboard.tsexactly (same guard: don't overwrite an existingmediaModels.imagedefault). Minimal, consistent with sibling providers.doctor --fixbefore the feature works — that is the bug, not a fix.User Impact
--fal-api-key.image_generatefails with "No image-generation model configured." untilopenclaw doctor --fix.mediaModels.imagesettings are preserved.Evidence
Real Behavior Proof
Real stack, no mocks: the proof runs the real
applyFalConfigand then asks the real runtime resolver (resolveCapabilityModelCandidatesfromsrc/media-generation/runtime-shared.ts, the same callsrc/image-generation/runtime.ts:69makes) to resolve the image model from the produced config.Before (on main)
$ node node_modules/tsx/dist/cli.mjs proof-fal-onboard-model-key.mjs [proof] mediaModels.image after onboarding: null [proof] legacy imageGenerationModel after onboarding: {"primary":"fal/fal-ai/flux/dev"} [proof] runtime-resolved candidates: [] [proof] RESULT: FAIL - runtime resolves no image model after onboarding (expected fal/fal-ai/flux/dev); image_generate would throw "No image-generation model configured."After (with fix)
$ node node_modules/tsx/dist/cli.mjs proof-fal-onboard-model-key.mjs [proof] mediaModels.image after onboarding: {"primary":"fal/fal-ai/flux/dev"} [proof] legacy imageGenerationModel after onboarding: null [proof] runtime-resolved candidates: [{"provider":"fal","model":"fal-ai/flux/dev"}] [proof] RESULT: PASS - onboarding default fal/fal-ai/flux/dev is resolvable by the runtimeWhat was not tested: a live image generation call against fal's API (requires credentials); the proof covers the full config-write → runtime-resolve path that was broken.
Tests and Validation
extensions/fal/onboard.test.ts— 2/2 passed: onboarding writesmediaModels.image(and never the retired key), and an existingmediaModels.imagedefault is preserved.npx oxlint --deny=warnon both files — 0 warnings, 0 errors.mediaModels.imageand the contributor patch matches the existing Vydra provider ownership pattern.