Conversation
WalkthroughThe RobotEditPage restricts scrape output formats to apply exclusively when Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/robot/pages/RobotEditPage.tsx (1)
1206-1213: LGTM —formats: undefinedis the right payload for extract.Per
server/src/routes/storage.ts(lines 443 and 494), an undefinedformatsbypasses validation and leavesupdatedMeta.formatsuntouched, so the fix is safe on the server side for extract/unknown types.One optional consideration (not blocking): extract robots that previously accumulated stale
recording_meta.formatsdue to the prior bug will retain those values, since the backend only overwrites whennormalizedFormats !== undefined. If a cleanup is desired, it would need a separate migration or an explicitformats: []/server-side clear — out of scope for this PR.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/robot/pages/RobotEditPage.tsx` around lines 1206 - 1213, The change correctly sets formats to undefined for extract/unknown robot types in RobotEditPage.tsx so the server skips updating recording_meta.formats; ensure the conditional in the payload that uses robot.recording_meta.type (and the branches referencing crawlOutputFormats, searchOutputFormats, scrapeOutputFormats) remains as shown — do not replace undefined with an explicit [] for the extract/unknown branch, and keep the search branch logic ((searchConfig.mode || 'discover') === 'discover' ? [] : searchOutputFormats) unchanged so existing server-side preservation behavior is preserved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/robot/pages/RobotEditPage.tsx`:
- Around line 1206-1213: The change correctly sets formats to undefined for
extract/unknown robot types in RobotEditPage.tsx so the server skips updating
recording_meta.formats; ensure the conditional in the payload that uses
robot.recording_meta.type (and the branches referencing crawlOutputFormats,
searchOutputFormats, scrapeOutputFormats) remains as shown — do not replace
undefined with an explicit [] for the extract/unknown branch, and keep the
search branch logic ((searchConfig.mode || 'discover') === 'discover' ? [] :
searchOutputFormats) unchanged so existing server-side preservation behavior is
preserved.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 35c74fa1-007e-4ac8-adfa-87fbfbe1f32b
📒 Files selected for processing (1)
src/components/robot/pages/RobotEditPage.tsx
It was noticed that output formats were being showed for an extract robot in the edit section which was clearly wrong as they dont contain any format configuration. This PR fixes the issue.
Summary by CodeRabbit