Skip to content

fix: extract output format bug#1047

Open
RohitR311 wants to merge 1 commit intodevelopfrom
edit-fix
Open

fix: extract output format bug#1047
RohitR311 wants to merge 1 commit intodevelopfrom
edit-fix

Conversation

@RohitR311
Copy link
Copy Markdown
Collaborator

@RohitR311 RohitR311 commented Apr 24, 2026

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

  • Bug Fixes
    • Corrected scrape output format handling to apply only to scrape-type robots, preventing format configuration options from appearing or being saved for other robot types.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Walkthrough

The RobotEditPage restricts scrape output formats to apply exclusively when recording_meta.type === 'scrape'. Previously, formats were initialized, validated, displayed, and saved for 'extract' and unset types as well. The save payload's formats field now remains undefined for non-scrape types.

Changes

Cohort / File(s) Summary
Scrape Output Formats Scope Restriction
src/components/robot/pages/RobotEditPage.tsx
Narrowed scrape output formats applicability to 'scrape' recording type only; removed format handling for 'extract' and absent recording_meta.type values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • amhsirak

Poem

🐰 A rabbit hops through code so clean,
Formats scoped to places they're seen,
Only 'scrape' gets the special care,
Less confusion floating in the air! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: extract output format bug' directly aligns with the main objective: preventing output formats from displaying for extract robots in the edit section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edit-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RohitR311 RohitR311 added Type: Bug Something isn't working Scope: UI/UX Issues/PRs related to UI/UX labels Apr 24, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/robot/pages/RobotEditPage.tsx (1)

1206-1213: LGTM — formats: undefined is the right payload for extract.

Per server/src/routes/storage.ts (lines 443 and 494), an undefined formats bypasses validation and leaves updatedMeta.formats untouched, 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.formats due to the prior bug will retain those values, since the backend only overwrites when normalizedFormats !== undefined. If a cleanup is desired, it would need a separate migration or an explicit formats: []/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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f0da54 and f0a79b9.

📒 Files selected for processing (1)
  • src/components/robot/pages/RobotEditPage.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: UI/UX Issues/PRs related to UI/UX Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant