You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3.4 KiB
3.4 KiB
| phase | plan | type |
|---|---|---|
| 03-generate-node-refactor | 3 | execute |
Purpose: Existing saved workflows must load and execute without modification. Output: Migration logic, working execution with both legacy and new formats.
<execution_context> ~/.claude/get-shit-done/workflows/execute-phase.md ~/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/STATE.md @.planning/phases/03-generate-node-refactor/03-01-SUMMARY.md @.planning/phases/03-generate-node-refactor/03-02-SUMMARY.md @src/store/workflowStore.ts @src/components/nodes/GenerateImageNode.tsxConstraints: Node type "nanoBanana" unchanged, legacy ModelType must work
Task 1: Add workflow migration logic src/store/workflowStore.ts In workflow loading (loadWorkflow or where JSON is parsed): 1. For nanoBanana nodes without selectedModel, derive it from legacy model field: ```typescript if (node.type === "nanoBanana" && node.data.model && !node.data.selectedModel) { node.data.selectedModel = { provider: "gemini", modelId: node.data.model, displayName: node.data.model === "nano-banana" ? "Nano Banana" : "Nano Banana Pro" }; } ``` 2. Keep both fields synced on save for bidirectional compatibility Load existing workflow file, check node has selectedModel populated Old workflows load with selectedModel auto-populated Task 2: Update executeWorkflow for multi-provider src/store/workflowStore.ts In executeWorkflow nanoBanana case: 1. Check for selectedModel 2. If non-Gemini provider, add API key headers from providerSettings: ```typescript const headers = { "Content-Type": "application/json" }; if (nodeData.selectedModel?.provider === "replicate") { const config = get().providerSettings.providers.find(p => p.id === "replicate"); if (config?.apiKey) headers["X-Replicate-API-Key"] = config.apiKey; } // Similar for fal ``` 3. Include selectedModel in request body 4. Handle GenerationOutput response format Execute workflow with Gemini model Execution works for both legacy and new model selection Task 3: Handle legacy data in GenerateImageNode UI src/components/nodes/GenerateImageNode.tsx 1. On mount/data change: if model exists but not selectedModel, derive selectedModel 2. Ensure dropdowns reflect correct provider/model for migrated nodes 3. Save defaults in both formats for compatibility Open workflow with old nanoBanana node, verify correct selection shown UI correctly displays legacy nodes - [ ] `npm run build` succeeds - [ ] Existing workflow loads without errors - [ ] Legacy Gemini execution works - [ ] New provider selection persists correctly<success_criteria>
- Existing workflows load and execute unchanged
- Migration auto-populates selectedModel
- Both formats work in same workflow
- Phase 3 complete </success_criteria>