improvement(media-gen): retire vision block, add hosted key for fal ai for image/video gen, search visibility in cmd-k#4684
Conversation
…i for image/video gen
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates the hosted-key injector to skip injection when a tool’s hosting predicate is false or when the user already supplied an API key, and adds Fal.ai to BYOK provider IDs/UI. Improves Cmd-K search by introducing Retires Vision from surfaced UI/docs by removing the Reviewed by Cursor Bugbot for commit 3c7fd57. Configure here. |
Greptile SummaryThis PR retires the Vision block (hidden from toolbar), adds Fal.ai hosted-key support for image and video generators with markup-based billing, and enables provider dropdown options to appear as Cmd-K search entries via a new
Confidence Score: 5/5Safe to merge — the cost-tracking chain is robust end-to-end and no generated content can be lost due to pricing-lookup failures. The three-tier fallback in getFalAICostMetadata (billing events → historical estimate → floor) ensures the billing path never propagates an exception to callers. The hosted-key injection correctly checks the enabled predicate, respects user-provided and BYOK keys, and gates cost tracking via __usingHostedKey. Dual apiKey subblock IDs are an intentional, mutually-exclusive conditional pattern consistent with how other blocks handle provider-scoped fields. The fallback-floor cost heuristic in falai-pricing.ts and the defensive throws in image/generate.ts and video/falai.ts are worth a second look if Fal.ai adds new endpoint families in the future. Important Files Changed
Sequence DiagramsequenceDiagram
participant Block as Image/Video Block
participant Index as tools/index.ts
participant Route as API Route
participant FalAI as fal.ai
participant Pricing as falai-pricing.ts
participant Billing as Billing System
Block->>Index: "execute(params, provider=falai)"
Index->>Index: injectHostedKeyIfNeeded
Index->>Route: POST api/tools/image or video
Route->>FalAI: generate(model, prompt)
FalAI-->>Route: result + requestId
Route->>Pricing: getFalAICostMetadata
Pricing->>FalAI: GET billing-events (2 attempts)
alt billing event found
FalAI-->>Pricing: cost_estimate_nano_usd
Pricing-->>Route: "source=billing_events"
else no event
Pricing->>FalAI: POST pricing/estimate
alt estimate ok
FalAI-->>Pricing: total_cost
Pricing-->>Route: "source=historical_estimate"
else estimate fails
Pricing-->>Route: "source=fallback_floor"
end
end
Route-->>Index: response with costDollars
Index->>Billing: getCost with 1.5x markup
Billing-->>Index: billing recorded
Reviews (2): Last reviewed commit: "address comments" | Re-trigger Greptile |
|
@greptile |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3c7fd57. Configure here.
Audited the docs against the product changelog (GitHub releases / staging git history) for content that misleads readers — features that moved, were renamed, or removed — rather than cosmetic drift. Fixes: - Skills: no longer a Settings tab. It was promoted to its own workspace page (simstudioai#4354), so "Settings → Skills under the Tools section" sent readers to a tab that no longer exists. (skills/index.mdx) - Env vars: the workspace tab is "Secrets", not "Environment Variables" (credentials→secrets rename, simstudioai#4364). (quick-reference/index.mdx) - Mothership FAQ pointed to "Settings → Credentials" for integration connections; integrations moved to their own page and there is no Credentials tab. (mothership/tasks.mdx) - Vision block was retired (simstudioai#4684); a tip still named it. Reworded to "an Agent using a vision-capable model". (files/passing-files.mdx) - Getting-started FAQ told new users to "use the Copilot feature" to build in natural language — that surface is Mothership. (getting-started) - Removed the dead "Mod+Y → Go to templates" shortcut; the templates gallery was removed (simstudioai#4354). (keyboard-shortcuts) Note: MCP "tools" (Settings → Tools, for consuming) and MCP "servers" (Settings → System, for exposing) are distinct surfaces — both doc references are correct and were intentionally left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Type of Change
Testing
Tested manually
Checklist