AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(platform): remove picsum.photos placeholder images (product + e2e) (#13408)
Krzysztof Czerwinskie877391a55f0
diff --git a/autogpt_platform/backend/backend/TEST_DATA_README.md b/autogpt_platform/backend/backend/TEST_DATA_README.mdindex ef818df250..a15d910ef8 100644--- a/autogpt_platform/backend/backend/TEST_DATA_README.md+++ b/autogpt_platform/backend/backend/TEST_DATA_README.md@@ -16,7 +16,7 @@ Creates a comprehensive set of test data including:- Credit transactions**Image/Video Domains Used:**-- Images: `picsum.photos` (for all image URLs)+- Images: none. Avatars and listing images are seeded empty so the frontend renders its built-in fallback (no external image dependency).- Videos: `youtube.com` (for store listing videos)### test_data_updater.py@@ -119,7 +119,7 @@ Configured in `test_data_creator.py`:## Notes-- All image URLs use `picsum.photos` for consistency with Next.js image configuration+- Image fields are seeded empty; the frontend renders its built-in fallback (no external image dependency)- The scripts create realistic relationships between entities- Materialized views are refreshed at the end of each script- Data is designed to test both happy paths and edge casesdiff --git a/autogpt_platform/backend/migrations/20260622120000_scrub_picsum_image_urls/migration.sql b/autogpt_platform/backend/migrations/20260622120000_scrub_picsum_image_urls/migration.sqlnew file mode 100644index 0000000000..819eaab947--- /dev/null+++ b/autogpt_platform/backend/migrations/20260622120000_scrub_picsum_image_urls/migration.sql@@ -0,0 +1,34 @@+-- Scrub legacy picsum.photos placeholder URLs persisted in the database.+--+-- These were written by the old random picsum fallback (removed in this change)+-- and by old seed data. Now that picsum.photos is dropped from the Next.js image+-- domain allow-list, next/image throws on these unconfigured-host URLs at render+-- time (uncatchable by onError), crashing the card via the error boundary.+--+-- Real, user-chosen images (any non-picsum URL) are left untouched. Only the+-- random picsum placeholders are removed.++-- StoreListingVersion.imageUrls (String[]): drop any picsum entries, keeping the+-- order of the remaining real images. Only touch rows that actually contain one.+UPDATE "StoreListingVersion"+SET "imageUrls" = ARRAY(+ SELECT url+ FROM unnest("imageUrls") WITH ORDINALITY AS u(url, ord)+ WHERE url NOT LIKE '%picsum.photos%'+ ORDER BY ord+)+WHERE EXISTS (+ SELECT 1 FROM unnest("imageUrls") AS url WHERE url LIKE '%picsum.photos%'+);++-- Profile.avatarUrl: empty string (NOT NULL) — the Creator view types avatar_url+-- as a non-nullable String, so a NULL here would break GET /api/store/creators.+-- Empty renders the frontend's fallback avatar.+UPDATE "Profile"+SET "avatarUrl" = ''+WHERE "avatarUrl" LIKE '%picsum.photos%';++-- LibraryAgent.imageUrl: nullable with no dependent non-null view → NULL it out.+UPDATE "LibraryAgent"+SET "imageUrl" = NULL+WHERE "imageUrl" LIKE '%picsum.photos%';diff --git a/autogpt_platform/backend/test/e2e_test_data.py b/autogpt_platform/backend/test/e2e_test_data.pyindex 974b60fb1a..f31e042c6b 100644--- a/autogpt_platform/backend/test/e2e_test_data.py+++ b/autogpt_platform/backend/test/e2e_test_data.py@@ -5,16 +5,11 @@ This script creates test data for E2E tests by using API functions instead of diThis approach ensures compatibility with future model changes by using the API layer.Image/Video URL Domains Used:-- Images: picsum.photos (for all image URLs - avatars, store listing images, etc.)+- Images: none. Avatars and store listing images are seeded empty so the+ frontend renders its built-in solid-color/boring-avatars fallback. This+ avoids any external image dependency (e.g. picsum.photos) that intermittently+ 504'd through Next's /_next/image optimizer and stalled E2E navigations.- Videos: youtube.com (for store listing video URLs)--Add these domains to your Next.js config:-```javascript-// next.config.js-images: {- domains: ['picsum.photos'],-}-```"""import asyncio@@ -93,14 +88,6 @@ SEEDED_TEST_EMAILS = []-def get_image():- """Generate a consistent image URL using picsum.photos service."""- width = random.choice([200, 300, 400, 500, 600, 800])- height = random.choice([200, 300, 400, 500, 600, 800])- seed = random.randint(1, 1000)- return f"https://picsum.photos/seed/{seed}/{width}/{height}"--def get_video_url():"""Generate a consistent video URL using YouTube."""video_ids = [@@ -585,7 +572,10 @@ class TestDataCreator:+ str(random.randint(100, 999)), # Ensure uniqueness"description": faker.text(max_nb_chars=200),"links": [faker.url() for _ in range(random.randint(1, 3))],- "avatarUrl": get_image(),+ # Empty (not None): the Creator view types avatar_url as+ # non-nullable, so null breaks /api/store/creators. Empty+ # string renders the frontend's fallback avatar.+ "avatarUrl": "","isFeatured": is_featured,},)@@ -623,7 +613,8 @@ class TestDataCreator:"username": E2E_MARKETPLACE_CREATOR_USERNAME,"description": "Deterministic marketplace creator for Playwright PR E2E coverage.","links": ["https://example.com/e2e-marketplace"],- "avatarUrl": get_image(),+ # Empty (not None) — Creator view requires non-null avatar_url.+ "avatarUrl": "","isFeatured": True,},)@@ -729,11 +720,7 @@ class TestDataCreator:"name": E2E_MARKETPLACE_AGENT_NAME,"sub_heading": "A deterministic calculator agent for PR E2E coverage","video_url": "https://www.youtube.com/watch?v=test123",- "image_urls": [- "https://picsum.photos/seed/e2e-marketplace-1/200/300",- "https://picsum.photos/seed/e2e-marketplace-2/200/301",- "https://picsum.photos/seed/e2e-marketplace-3/200/302",- ],+ "image_urls": [],"description": ("A deterministic marketplace calculator agent that adds "f"{E2E_MARKETPLACE_AGENT_INPUT_VALUE} and 34 to produce "@@ -860,7 +847,7 @@ class TestDataCreator:name=graph.get("name", faker.sentence(nb_words=3)),sub_heading=faker.sentence(),video_url=get_video_url() if random.random() < 0.3 else None,- image_urls=[get_image() for _ in range(3)],+ image_urls=[],description=faker.text(),categories=[get_category()],changes_summary="Initial E2E test submission",diff --git a/autogpt_platform/backend/test/test_data_creator.py b/autogpt_platform/backend/test/test_data_creator.pyindex 15f6eec8fc..48a176dfdb 100644--- a/autogpt_platform/backend/test/test_data_creator.py+++ b/autogpt_platform/backend/test/test_data_creator.py@@ -4,16 +4,10 @@ Test Data Creator for AutoGPT PlatformThis script creates test data for the AutoGPT platform database.Image/Video URL Domains Used:-- Images: picsum.photos (for all image URLs - avatars, store listing images, etc.)+- Images: none. Avatars and store listing images are seeded empty so the+ frontend renders its built-in solid-color/boring-avatars fallback, avoiding+ any external image dependency (e.g. picsum.photos).- Videos: youtube.com (for store listing video URLs)--Add these domains to your Next.js config:-```javascript-// next.config.js-images: {- domains: ['picsum.photos'],-}-```"""import asyncio@@ -73,15 +67,6 @@ MIN_REVIEWS_PER_VERSION = 1 # Each version will have between 1-3 reviewsMAX_REVIEWS_PER_VERSION = 5 # Total reviews depends on number of versions created-def get_image():- """Generate a consistent image URL using picsum.photos service."""- width = random.choice([200, 300, 400, 500, 600, 800])- height = random.choice([200, 300, 400, 500, 600, 800])- # Use a random seed to get different images- seed = random.randint(1, 1000)- return f"https://picsum.photos/seed/{seed}/{width}/{height}"--def get_video_url():"""Generate a consistent video URL using a placeholder service."""# Using YouTube as a consistent source for video URLs@@ -195,7 +180,8 @@ async def main():username=faker.unique.user_name(),description=faker.text(),links=[faker.url() for _ in range(3)],- avatarUrl=get_image(),+ # Empty (not None) — Creator view requires non-null avatar_url.+ avatarUrl="",))profiles.append(profile)@@ -226,7 +212,7 @@ async def main():"agentGraphId": graph.id,"agentGraphVersion": graph.version,"creatorId": creator_profile.id if creator_profile else None,- "imageUrl": get_image() if random.random() < 0.5 else None,+ "imageUrl": None,"useGraphIsActiveVersion": random.choice([True, False]),"isFavorite": random.choice([True, False]),"isCreatedByUser": random.choice([True, False]),@@ -414,7 +400,7 @@ async def main():"name": graph.name or faker.sentence(nb_words=3),"subHeading": faker.sentence(),"videoUrl": get_video_url() if random.random() < 0.3 else None,- "imageUrls": [get_image() for _ in range(3)],+ "imageUrls": [],"description": faker.text(),"categories": [faker.word() for _ in range(3)],"isFeatured": random.choice([True, False]),diff --git a/autogpt_platform/frontend/next.config.mjs b/autogpt_platform/frontend/next.config.mjsindex 04f939fa4c..292841a7c0 100644--- a/autogpt_platform/frontend/next.config.mjs+++ b/autogpt_platform/frontend/next.config.mjs@@ -62,7 +62,6 @@ const nextConfig = {"storage.googleapis.com","ideogram.ai", // for generated images- "picsum.photos", // for placeholder images"example.com", // for local test data images],remotePatterns: [diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/styleguide/page.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/styleguide/page.tsxindex 295f3a7603..b704ff55fb 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/styleguide/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/styleguide/page.tsx@@ -762,9 +762,7 @@ export default function StyleguidePage() {block_name: "Image Generator",message: "Generated image successfully.",outputs: {- image: [- "https://picsum.photos/seed/styleguide/600/400",- ],+ image: ["/placeholder.png"],},},}}@@ -1426,9 +1424,7 @@ export default function StyleguidePage() {],},],- chart: [- "https://picsum.photos/seed/chart-demo/500/300",- ],+ chart: ["/placeholder.png"],},},},diff --git a/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentSelectStep/useAgentSelectStep.ts b/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentSelectStep/useAgentSelectStep.tsindex 8d1f34597a..70ec31aef2 100644--- a/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentSelectStep/useAgentSelectStep.ts+++ b/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/components/AgentSelectStep/useAgentSelectStep.ts@@ -105,7 +105,7 @@ export function useAgentSelectStep({id: agent.graph_id,version: agent.graph_version,lastEdited: agent.last_edited.toLocaleDateString(),- imageSrc: agent.agent_image || "https://picsum.photos/300/200",+ imageSrc: agent.agent_image || "",description: agent.description || "",recommendedScheduleCron: agent.recommended_schedule_cron ?? null,}),diff --git a/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/usePublishAgentModal.ts b/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/usePublishAgentModal.tsindex 3d3ababaff..7adaf6d972 100644--- a/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/usePublishAgentModal.ts+++ b/autogpt_platform/frontend/src/components/contextual/PublishAgentModal/usePublishAgentModal.ts@@ -150,7 +150,7 @@ export function usePublishAgentModal({...new Set(publishedSubmissionData.image_urls || []),].filter(Boolean) as string[],category: publishedSubmissionData.categories?.[0] || "",- thumbnailSrc: agent.agent_image || "https://picsum.photos/300/200",+ thumbnailSrc: agent.agent_image || "",slug: publishedSubmissionData.slug,recommendedScheduleCron: agent.recommended_schedule_cron || "",changesSummary: publishedSubmissionData.changes_summary || "",@@ -160,7 +160,7 @@ export function usePublishAgentModal({agent_id: preSelectedAgentId,title: agent.agent_name,description: agent.description || "",- thumbnailSrc: agent.agent_image || "https://picsum.photos/300/200",+ thumbnailSrc: agent.agent_image || "",slug: agent.agent_name.replace(/ /g, "-"),recommendedScheduleCron: agent.recommended_schedule_cron || "",};diff --git a/autogpt_platform/frontend/src/playwright/assets/test-thumbnail.png b/autogpt_platform/frontend/src/playwright/assets/test-thumbnail.pngnew file mode 100644index 0000000000..81f9595047Binary files /dev/null and b/autogpt_platform/frontend/src/playwright/assets/test-thumbnail.png differdiff --git a/autogpt_platform/frontend/src/playwright/credentials/index.ts b/autogpt_platform/frontend/src/playwright/credentials/index.tsindex cefa3931cb..3c62b8d7ae 100644--- a/autogpt_platform/frontend/src/playwright/credentials/index.ts+++ b/autogpt_platform/frontend/src/playwright/credentials/index.ts@@ -15,11 +15,9 @@ export const TEST_AGENT_DATA = {name: "E2E Calculator Agent",description:"A deterministic marketplace agent built from Calculator and Agent Output blocks for frontend E2E coverage.",- image_urls: [- "https://picsum.photos/seed/e2e-marketplace-1/200/300",- "https://picsum.photos/seed/e2e-marketplace-2/200/301",- "https://picsum.photos/seed/e2e-marketplace-3/200/302",- ],+ // Seed with no images so cards render their solid-color fallback. Avoids+ // the external picsum.photos dependency that intermittently 504'd in CI.+ image_urls: [] as string[],video_url: "https://www.youtube.com/watch?v=test123",sub_heading: "A deterministic calculator agent for PR E2E coverage",categories: ["test", "demo", "frontend"],diff --git a/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts b/autogpt_platform/frontend/src/playwright/pages/marketplace.page.tsindex e9ba527223..3d1293c608 100644--- a/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts+++ b/autogpt_platform/frontend/src/playwright/pages/marketplace.page.ts@@ -1,10 +1,26 @@import { expect, Page } from "@playwright/test";+import path from "path";import { BasePage } from "./base.page";import { dismissFeedbackDialog } from "./library.page";import { getSelectors } from "../utils/selectors";const DETERMINISTIC_MARKETPLACE_AGENT_SEARCH = "E2E Calculator Agent";+// Small local PNG selected in the publish flow to satisfy the "at least one+// image is required" rule. The upload request itself is stubbed (see+// submitAgentForReview) because the CI stack has no GCS media bucket — so the+// file content is irrelevant, only that a file is chosen.+const THUMBNAIL_FIXTURE_PATH = path.join(+ __dirname,+ "../assets/test-thumbnail.png",+);++// The store media upload endpoint requires a configured GCS bucket, which the+// E2E stack does not provide. Stub it with a local asset URL: this test covers+// the publish → track → delete dashboard flow, not GCS storage. The stubbed URL+// is served locally (no external fetch) and satisfies the image-required rule.+const STUBBED_THUMBNAIL_URL = "/placeholder.png";+export class MarketplacePage extends BasePage {constructor(page: Page) {super(page);@@ -246,6 +262,27 @@ export class MarketplacePage extends BasePage {await publishAgentModal.getByRole("combobox", { name: "Category" }).click();await this.page.getByRole("option", { name: "Other" }).click();+ // Stub the GCS-backed media upload so the flow is hermetic in CI, then+ // select a file to trigger it. This satisfies the "at least one image is+ // required" rule without a real storage bucket.+ await this.page.route(+ "**/api/store/submissions/media",+ async (route) =>+ await route.fulfill({+ status: 200,+ contentType: "application/json",+ body: JSON.stringify(STUBBED_THUMBNAIL_URL),+ }),+ );+ await publishAgentModal.getByRole("button", { name: /Thumbnails/ }).click();+ await publishAgentModal+ .locator("#image-upload")+ .setInputFiles(THUMBNAIL_FIXTURE_PATH);+ await expect(+ publishAgentModal.getByTestId("thumbnail-remove-0"),+ "uploaded thumbnail should appear before submitting",+ ).toBeVisible({ timeout: 15000 });+await publishAgentModal.getByRole("button", { name: /Experience details/ }).click();