Skip to content

fix(frontend/marketplace): prevent agent page crash on 404 - #14453

Open
seer-by-sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/agent-page-404-crash
Open

fix(frontend/marketplace): prevent agent page crash on 404#14453
seer-by-sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/agent-page-404-crash

Conversation

@seer-by-sentry

@seer-by-sentry seer-by-sentry Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Why / What / How

The agent marketplace page (/(platform)/marketplace/agent/[creator]/[slug]) previously crashed with an ApiError when attempting to load a non-existent agent. This was due to getV2GetSpecificAgent() being called in both generateMetadata() and the main page component without proper error handling for 404 responses.

This PR implements a try/catch block around calls to getV2GetSpecificAgent() to gracefully handle 404 ApiError responses.

If an ApiError with a 404 status is caught, notFound() from next/navigation is called, ensuring the page renders a 404 page instead of crashing. This pattern mirrors the existing robust error handling found in the sibling creator page (/(platform)/marketplace/creator/[creator]/page.tsx).

Changes 🏗️

  • Added try/catch blocks around calls to getV2GetSpecificAgent() within generateMetadata() and the main page component for /(platform)/marketplace/agent/[creator]/[slug].
  • Implemented notFound() from next/navigation to be called when a 404 ApiError is caught from getV2GetSpecificAgent().

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Navigate to /(platform)/marketplace/agent/[creator]/[slug] with a valid agent slug and confirm the page loads correctly.
    • Navigate to /(platform)/marketplace/agent/[creator]/[slug] with a non-existent agent slug (e.g., a random string) and confirm a 404 page is displayed instead of a crash.
    • Verify the behavior for both generateMetadata() (initial page load) and the main page component (data fetching).
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

Fixes BUILDER-8X2

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@seer-by-sentry
seer-by-sentry Bot requested a review from a team as a code owner September 8, 2026 22:08
@seer-by-sentry
seer-by-sentry Bot requested review from Pwuts and kcze and removed request for a team September 8, 2026 22:08
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR targets the master branch but does not come from dev or a hotfix/* branch.

Automatically setting the base branch to dev.

@github-actions github-actions Bot added the platform/frontend AutoGPT Platform - Front end label Sep 8, 2026
@github-actions
github-actions Bot changed the base branch from master to dev September 8, 2026 22:08
@github-actions github-actions Bot added the size/m label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Overlap Detection

This check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early.

🔴 Merge Conflicts Detected

The following PRs have been tested and will have merge conflicts if merged after this PR. Consider coordinating with the authors.

Summary: 1 conflict(s), 0 medium risk, 0 low risk (out of 1 PRs with file overlap)


Auto-generated on push. Ignores: openapi.json, lock files.

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.64%. Comparing base (98381ab) to head (5016d6b).
⚠️ Report is 56 commits behind head on dev.

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #14453      +/-   ##
==========================================
- Coverage   80.64%   80.64%   -0.01%     
==========================================
  Files        3386     3386              
  Lines      255966   255976      +10     
  Branches    23691    23694       +3     
==========================================
- Hits       206434   206426       -8     
- Misses      44285    44372      +87     
+ Partials     5247     5178      -69     
Flag Coverage Δ
platform-frontend 58.22% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Platform Backend 85.89% <ø> (ø)
Platform Frontend 60.67% <0.00%> (-0.04%) ⬇️
AutoGPT Libs ∅ <ø> (∅)
Classic AutoGPT 28.43% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

platform/frontend AutoGPT Platform - Front end size/m

Projects

Status: 🆕 Needs initial review
Status: No status

Development

Successfully merging this pull request may close these issues.

0 participants