Skip to content

test(frontend/builder): add integration tests for builder stores, components, and hooks (part-1) - #12433

Merged
Abhi1992002 merged 4 commits into
devfrom
abhi/builder-integration-test-part-1
Mar 17, 2026
Merged

test(frontend/builder): add integration tests for builder stores, components, and hooks (part-1)#12433
Abhi1992002 merged 4 commits into
devfrom
abhi/builder-integration-test-part-1

Conversation

@Abhi1992002

Copy link
Copy Markdown
Member

Changes

  • Add 329 integration tests across 11 test files for the builder (visual
    workflow editor)
  • Cover all Zustand stores (nodeStore, edgeStore, historyStore, graphStore,
    copyPasteStore, blockMenuStore, controlPanelStore)
  • Cover key components (CustomNode, NewBlockMenu, NewSaveControl, RunGraph)
  • Cover hooks (useFlow, useCopyPaste)

Test files

File Tests Coverage
nodeStore.test.ts 58 Node lifecycle, bulk ops, backend conversion,
execution tracking, status, errors, resolution mode
edgeStore.test.ts 37 Edge CRUD, duplicate rejection, bead
visualization, backend link conversion, upsert
historyStore.test.ts 22 Undo/redo, history limits (50), microtask
batching, deduplication, canUndo/canRedo
graphStore.test.ts 28 Execution status transitions, isGraphRunning,
schema management, sub-graphs
copyPasteStore.test.ts 8 Copy/paste with ID remapping, position offset,
edge preservation
CustomNode.test.tsx 25 Rendering by block type (NOTE, WEBHOOK, AGENT,
OUTPUT, AYRSHARE), error states
NewBlockMenu.test.tsx 29 Store state (search, filters, creators,
categories), search/default view routing
NewSaveControl.test.tsx 11 Save dialog rendering, form validation,
version display, popover state
RunGraph.test.tsx 11 Run/stop button states, loading, click handlers,
RunInputDialog visibility
useFlow.test.ts 4 Loading states, initial load completion
useCopyPaste.test.ts 16 Clipboard copy/paste, UUID remapping, viewport
centering, input field guard

This commit introduces comprehensive unit tests for the AutoGPT frontend
build platform, covering:

- **Component tests**: CustomNode, NewBlockMenu, NewSaveControl,
  RunGraph
- **Store tests**: nodeStore, edgeStore, graphStore, historyStore,
  controlPanelStore, blockMenuStore, copyPasteStore
- **Hook tests**: useCopyPaste, useFlow
- **Test utilities**: Mocked child components, localStorage, clipboard,
  and API calls

Tests follow Vitest conventions with proper setup/teardown and
comprehensive edge case coverage.
@Abhi1992002
Abhi1992002 requested a review from a team as a code owner March 16, 2026 11:18
@Abhi1992002
Abhi1992002 requested review from Bentlybro and majdyz and removed request for a team March 16, 2026 11:18
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Mar 16, 2026
@Abhi1992002
Abhi1992002 requested a review from 0ubbe March 16, 2026 11:18
@github-actions github-actions Bot added the platform/frontend AutoGPT Platform - Front end label Mar 16, 2026
@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f7824b0a-fb73-470e-8131-7f9a1e72dd1b

📥 Commits

Reviewing files that changed from the base of the PR and between 1e90bcc and 010fc5f.

📒 Files selected for processing (2)
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • autogpt_platform/frontend/src/app/(platform)/build/tests/CustomNode.test.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: integration_test
  • GitHub Check: types
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (typescript)
  • GitHub Check: Check PR Status
  • GitHub Check: conflicts
🧰 Additional context used
📓 Path-based instructions (12)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Run pnpm format to auto-fix formatting issues before completing work
Run pnpm lint to check for lint errors and fix any that appear before completing work

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/
'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development

Run pnpm types to check for type errors and fix any that appear before completing work

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code using pnpm format
Never use components from src/components/__legacy__/*

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts and use design system components from src/components/ (atoms, molecules, organisms)
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName} and regenerate with pnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local /components folder
Avoid large hooks, abstract logic into helpers.ts files when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not use useCallback or useMemo unless asked to optimize a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components and handlers
Use type-safe generated API hooks via Orval + React Query for data fetching
Use React Query for server state management and co-locate UI state in components/hooks
Separate render logic (.tsx) from business logic (use*.ts hooks)
Use only shadcn/ui (Radix UI primitives) with Tailwind CSS for UI components
Use Phosphor Icons only for all icon implementations
Use ErrorCard component for render errors, toast for mutations, and Sentry for exceptions
Use design system components from src/components/ (atoms, molecules, organisms)
Never use src/components/__legacy__/* components
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Use Tailwind CSS only for styling with design tokens
Do not use useCallback or useMemo unless asked to optimize a specific function
Never type with any unless a variable/attribute can actually be of any type

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not type hook returns, let Typescript infer as much as possible

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never type with any, if no types available use unknown

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run pnpm test or pnpm test-ui for frontend Playwright tests

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Use Playwright for E2E testing and Storybook for component development

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Add Storybook stories for new components and Playwright tests for E2E scenarios

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
🧠 Learnings (18)
📓 Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts} : Add Storybook stories for new components and Playwright tests for E2E scenarios
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Place integration tests in a `__tests__` folder next to the component being tested
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.stories.tsx : Use Storybook for design system, atoms, molecules, visual states (hover, disabled, loading), and responsive layouts
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Place unit tests co-located with the source file: `Component.test.tsx` next to `Component.tsx`
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts} : Add Storybook stories for new components and Playwright tests for E2E scenarios

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for authentication flows (login, signup, logout) that MUST work in a real browser

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx} : Use Playwright for E2E testing and Storybook for component development

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.stories.tsx : Use Storybook for design system, atoms, molecules, visual states (hover, disabled, loading), and responsive layouts

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test TypeScript types

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-03-12T10:01:25.168Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12378
File: autogpt_platform/frontend/src/components/contextual/CredentialsInput/components/CredentialTypeSelector/CredentialTypeSelector.tsx:32-32
Timestamp: 2026-03-12T10:01:25.168Z
Learning: In `autogpt_platform/frontend/src/components/contextual/CredentialsInput/components/CredentialTypeSelector/CredentialTypeSelector.tsx`, the `supportedTypes` prop is always guaranteed to have at least two entries at runtime because `CredentialTypeSelector` is only rendered when `hasMultipleCredentialTypes` is true, which is only set when `countSupportedTypes() > 1` (in `useCredentialsInput.ts`). Therefore, `defaultTab` (which is `supportedTypes[0]`) is always a valid value and will never be undefined. Do not flag `supportedTypes: CredentialsType[]` as potentially empty in this component.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/**/*.{ts,tsx} : Never type with `any`, if no types available use `unknown`

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Never type with `any` unless a variable/attribute can actually be of any type

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Run `pnpm types` to check for type errors and fix any that appear before completing work

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for payment or sensitive transactions requiring a real browser

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
🔇 Additional comments (6)
autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts (6)

1-6: LGTM!

Imports are correctly structured and all are used in the test file.


22-22: Replace "STANDARD" as never with the proper enum value.

The as never assertion bypasses type checking. Use BlockUIType.STANDARD (which equals "Standard") for type-safe test data.


31-42: LGTM!

The createTestEdge helper creates minimal test fixtures appropriately. The type assertion is acceptable for test mocks.


44-52: LGTM!

The flushMicrotasks helper correctly uses queueMicrotask matching the production implementation's batching mechanism. The beforeEach ensures proper test isolation by resetting all relevant stores.


54-173: LGTM!

Comprehensive coverage of undo/redo functionality including single actions, multiple actions, empty history edge cases, and the MAX_HISTORY limit (50). The tests correctly use flushMicrotasks() to account for microtask batching in the production implementation.


175-407: LGTM!

Excellent coverage of edge cases, API helpers (canUndo/canRedo), deduplication logic, and microtask batching behavior. The tests correctly verify that:

  • Interleaved undo/redo sequences maintain consistency
  • Microtask batching commits only the first state within a tick
  • Diverging changes after undo clear the future stack
  • Edges are properly restored alongside nodes

Walkthrough

Adds comprehensive unit and integration tests across the frontend build area (components, stores, and hooks). No production API or exported signatures were changed.

Changes

Cohort / File(s) Summary
Component tests
autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx, autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx, autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx, autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
Adds extensive UI tests with heavy mocking: rendering permutations, mode-specific behavior, form validation, dialog visibility, and interaction assertions.
Store tests
autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts, .../edgeStore.test.ts, .../graphStore.test.ts, .../historyStore.test.ts, .../nodeStore.test.ts
Comprehensive store coverage: copy/paste semantics and clipboard, edge add/remove/upsert and bead counting, graph execution status and schemas, undo/redo with microtask batching, and node lifecycle/execution-result accumulation.
Hook tests
autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts, autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
Validates keyboard/clipboard flows, focus guards, viewport-aware paste positioning, and flow loading/initial-load timing.
Test infra & mocks
autogpt_platform/frontend/src/app/(platform)/build/__tests__/*
Adds builders, store reset utilities, and heavy mocks (XYFlow hooks/components, query client, UUIDs, clipboard, toasts, child components) to stabilize isolated tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested labels

Review effort 4/5

Suggested reviewers

  • 0ubbe
  • Bentlybro
  • majdyz

Poem

🐰 I hopped through tests with nimble feet,
Nodes, edges, histories all in neat,
Copy, paste, undo — each case I cheered,
Mocks and builders kept logic cleared,
Hooray — the frontend grows complete!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding integration tests for builder stores, components, and hooks, marking this as part 1 of a multi-part effort.
Description check ✅ Passed The description is directly related to the changeset, providing detailed coverage of test files, test counts, and areas covered by the 329 integration tests across 11 test files.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abhi/builder-integration-test-part-1
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (4)
autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts (1)

44-46: Optional: make flushMicrotasks truly microtask-based.

Using setTimeout(0) works but waits a full macrotask; queueMicrotask (or equivalent) keeps this helper tighter and faster for batching tests.

🔧 Optional cleanup
 async function flushMicrotasks() {
-  await new Promise((resolve) => setTimeout(resolve, 0));
+  await new Promise<void>((resolve) => queueMicrotask(resolve));
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/historyStore.test.ts
around lines 44 - 46, The helper flushMicrotasks currently uses setTimeout(0)
which schedules a macrotask; change the implementation of flushMicrotasks to
schedule a true microtask instead (e.g., use queueMicrotask(() => resolve()) or
await Promise.resolve()) so tests run faster and more tightly; update the async
function flushMicrotasks to call queueMicrotask or return Promise.resolve() to
await a microtask tick, keeping the function name flushMicrotasks unchanged.
autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts (1)

416-418: Avoid fixed sleeps in async tests.

setTimeout(50) introduces nondeterministic timing and slower tests. Prefer waiting on the expected stable state directly with waitFor.

⏱️ Suggested refactor
-      // Wait a tick to ensure no state changes happen
-      await new Promise((r) => setTimeout(r, 50));
-
-      const { nodes } = useNodeStore.getState();
-      expect(nodes).toHaveLength(1);
-      expect(nodes[0].id).toBe("1");
+      await vi.waitFor(() => {
+        const { nodes } = useNodeStore.getState();
+        expect(nodes).toHaveLength(1);
+        expect(nodes[0].id).toBe("1");
+      });
...
-      await new Promise((r) => setTimeout(r, 50));
-
-      const { nodes } = useNodeStore.getState();
-      expect(nodes).toHaveLength(1);
-      expect(nodes[0].id).toBe("1");
+      await vi.waitFor(() => {
+        const { nodes } = useNodeStore.getState();
+        expect(nodes).toHaveLength(1);
+        expect(nodes[0].id).toBe("1");
+      });

Also applies to: 440-440

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/useCopyPaste.test.ts
around lines 416 - 418, Replace the fixed sleep (await new Promise((r) =>
setTimeout(r, 50))) in the tests in useCopyPaste.test.ts with a deterministic
wait: import and use waitFor from your testing library and wait on the expected
stable condition (e.g., an assertion that a piece of state/DOM does not change
or a specific element is present/absent) instead of sleeping; update both
occurrences (the one after the comment "// Wait a tick to ensure no state
changes happen" and the similar instance around line 440) to use waitFor(() =>
/* assert stable condition */) so the test becomes deterministic and faster.
autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts (1)

10-31: Tighten createTestNode override types to remove pervasive unsafe casts.

The current helper typing forces repeated as Partial<CustomNodeData> as CustomNodeData. Accept data?: Partial<CustomNodeData> in the helper signature and merge defaults there.

Refactor direction
-function createTestNode(
-  overrides: Partial<CustomNode> & { id: string },
-): CustomNode {
+type TestNodeOverrides = {
+  id: string;
+  position?: CustomNode["position"];
+  data?: Partial<CustomNodeData>;
+};
+
+function createTestNode(overrides: TestNodeOverrides): CustomNode {
   const defaults: CustomNodeData = {
@@
   return {
     id: overrides.id,
     type: "custom",
     position: overrides.position ?? { x: 0, y: 0 },
-    data: { ...defaults, ...overrides.data },
+    data: { ...defaults, ...(overrides.data ?? {}) },
   };
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/nodeStore.test.ts
around lines 10 - 31, The helper createTestNode currently forces unsafe casts
when callers pass partial node data; change its signature to accept overrides: {
id: string; position?: { x: number; y: number }; data?: Partial<CustomNodeData>
} (or similar) so data is optional and partial, then inside createTestNode
define const mergedData: CustomNodeData = { ...defaults, ...overrides.data } and
return data: mergedData; update references to createTestNode to pass partial
data without casts and remove any as Partial<CustomNodeData> as CustomNodeData
conversions. Ensure you keep id required and preserve position defaulting to
{x:0,y:0}.
autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx (1)

45-51: Drop redundant cleanup() in beforeEach.

You already call cleanup() in afterEach, so running it again in beforeEach is unnecessary noise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/NewBlockMenu.test.tsx
around lines 45 - 51, Remove the redundant cleanup() call from the beforeEach
block since cleanup() already runs in afterEach; keep the beforeEach to only
reset the store by calling useBlockMenuStore.getState().reset() and remove the
extra cleanup() invocation to avoid duplicate cleanup calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/CustomNode.test.tsx:
- Line 14: Several test mocks and helpers use `any`; replace them with concrete
or unknown types: change the mock component props (NodeContainer, the components
at the other mock locations) to accept typed interfaces (e.g., define interfaces
for their props instead of `any`) and update the schema function parameter to
use `unknown`; change helper functions that currently use `NodeProps<any>` to
`NodeProps<CustomNodeData>` and make their return types
`NodeProps<CustomNodeData>`; replace `as any` casts for execution results with
the proper `NodeExecutionResult` import and type; update all referenced symbols
(NodeContainer, the other mock component names, the helper functions that return
NodeProps, and places casting to any for execution results) accordingly so no
`any` remains.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/NewBlockMenu.test.tsx:
- Around line 327-341: The clear button lacks an accessible name and the test
uses a synchronous role query; update the component (BlockMenuSearchBar's clear
button) to include aria-label="Clear" (or equivalent accessible text) so it can
be found by name, and update the test (NewBlockMenu.test.tsx -> the "shows clear
button when input has text and clears on click" case) to use the async query
await screen.findByRole("button", { name: /clear/i }) before clicking and then
await the input value assertion with waitFor as needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/NewSaveControl.test.tsx:
- Around line 152-163: The test only asserts the isSaving: false case; update
the test in NewSaveControl.test.tsx to also assert the disabled state when
isSaving is true by: after the existing assertions toggle the mock to
setupMock({ isSaving: true }) (or set useControlPanelStore state appropriately),
re-render or query the same button (test id "save-control-save-agent-button")
and assert that (saveButton as HTMLButtonElement).disabled is true; ensure you
reference useControlPanelStore.setState, setupMock, and the NewSaveControl
component so both save-enabled and save-disabled paths are covered in the same
test.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/nodeStore.test.ts:
- Around line 734-754: The test exposes a data-integrity bug: addNode/addNodes
currently allow duplicate node IDs while other ID-keyed operations
(getNodeStatus, getNodeErrors, updateNodeData, etc. in useNodeStore) use .find()
and thus only affect the first match; fix by enforcing a unique-ID invariant in
addNode and addNodes (e.g., check existing nodes in useNodeStore before
inserting and skip or replace entries with the same id, or throw an error) so
duplicate IDs cannot be appended and ID-keyed operations remain deterministic;
update or remove the ambiguous test accordingly to reflect the chosen behavior.

---

Nitpick comments:
In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/historyStore.test.ts:
- Around line 44-46: The helper flushMicrotasks currently uses setTimeout(0)
which schedules a macrotask; change the implementation of flushMicrotasks to
schedule a true microtask instead (e.g., use queueMicrotask(() => resolve()) or
await Promise.resolve()) so tests run faster and more tightly; update the async
function flushMicrotasks to call queueMicrotask or return Promise.resolve() to
await a microtask tick, keeping the function name flushMicrotasks unchanged.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/NewBlockMenu.test.tsx:
- Around line 45-51: Remove the redundant cleanup() call from the beforeEach
block since cleanup() already runs in afterEach; keep the beforeEach to only
reset the store by calling useBlockMenuStore.getState().reset() and remove the
extra cleanup() invocation to avoid duplicate cleanup calls.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/nodeStore.test.ts:
- Around line 10-31: The helper createTestNode currently forces unsafe casts
when callers pass partial node data; change its signature to accept overrides: {
id: string; position?: { x: number; y: number }; data?: Partial<CustomNodeData>
} (or similar) so data is optional and partial, then inside createTestNode
define const mergedData: CustomNodeData = { ...defaults, ...overrides.data } and
return data: mergedData; update references to createTestNode to pass partial
data without casts and remove any as Partial<CustomNodeData> as CustomNodeData
conversions. Ensure you keep id required and preserve position defaulting to
{x:0,y:0}.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/useCopyPaste.test.ts:
- Around line 416-418: Replace the fixed sleep (await new Promise((r) =>
setTimeout(r, 50))) in the tests in useCopyPaste.test.ts with a deterministic
wait: import and use waitFor from your testing library and wait on the expected
stable condition (e.g., an assertion that a piece of state/DOM does not change
or a specific element is present/absent) instead of sleeping; update both
occurrences (the one after the comment "// Wait a tick to ensure no state
changes happen" and the similar instance around line 440) to use waitFor(() =>
/* assert stable condition */) so the test becomes deterministic and faster.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9ac3697b-fe67-44eb-8ea2-f160e5477c7b

📥 Commits

Reviewing files that changed from the base of the PR and between 3f653e6 and e6d5811.

📒 Files selected for processing (11)
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: types
  • GitHub Check: integration_test
  • GitHub Check: Seer Code Review
  • GitHub Check: Check PR Status
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (15)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Run pnpm format to auto-fix formatting issues before completing work
Run pnpm lint to check for lint errors and fix any that appear before completing work

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/
'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development

Run pnpm types to check for type errors and fix any that appear before completing work

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code using pnpm format
Never use components from src/components/__legacy__/*

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts and use design system components from src/components/ (atoms, molecules, organisms)
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName} and regenerate with pnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local /components folder
Avoid large hooks, abstract logic into helpers.ts files when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not use useCallback or useMemo unless asked to optimize a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components and handlers
Use type-safe generated API hooks via Orval + React Query for data fetching
Use React Query for server state management and co-locate UI state in components/hooks
Separate render logic (.tsx) from business logic (use*.ts hooks)
Use only shadcn/ui (Radix UI primitives) with Tailwind CSS for UI components
Use Phosphor Icons only for all icon implementations
Use ErrorCard component for render errors, toast for mutations, and Sentry for exceptions
Use design system components from src/components/ (atoms, molecules, organisms)
Never use src/components/__legacy__/* components
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Use Tailwind CSS only for styling with design tokens
Do not use useCallback or useMemo unless asked to optimize a specific function
Never type with any unless a variable/attribute can actually be of any type

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not type hook returns, let Typescript infer as much as possible

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never type with any, if no types available use unknown

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run pnpm test or pnpm test-ui for frontend Playwright tests

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Use Playwright for E2E testing and Storybook for component development

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/src/**/use*.ts

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

autogpt_platform/frontend/src/**/use*.ts: Extract component logic into custom hooks grouped by concern, with each hook in its own .ts file
Do not type hook returns; let TypeScript infer types as much as possible

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Add Storybook stories for new components and Playwright tests for E2E scenarios

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Component props should be interface Props { ... } (not exported) unless the interface needs to be used outside the component

Use type Props = { ... } (not exported) for component props unless used outside the component

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
🧠 Learnings (24)
📓 Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts} : Add Storybook stories for new components and Playwright tests for E2E scenarios
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12284
File: autogpt_platform/frontend/src/app/api/openapi.json:11897-11900
Timestamp: 2026-03-04T23:58:18.476Z
Learning: Repo: Significant-Gravitas/AutoGPT — PR `#12284`
Backend/frontend OpenAPI codegen convention: In backend/api/features/store/model.py, the StoreSubmission and StoreSubmissionAdminView models define submitted_at: datetime | None, changes_summary: str | None, and instructions: str | None with no default. This is intentional to produce “required but nullable” fields in OpenAPI (properties appear in required[] and use anyOf [type, null]). This matches Prisma’s submittedAt DateTime? and changesSummary String?. Do not flag this as a required/nullable mismatch.
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Place unit tests co-located with the source file: `Component.test.tsx` next to `Component.tsx`
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/src/**/*[Ww]orkflow*/**/*.{ts,tsx} : Use xyflow/react for visual graph editor implementation in the Workflow Builder

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Mock API requests in integration tests via MSW (Mock Service Worker)

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for authentication flows (login, signup, logout) that MUST work in a real browser

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/src/**/use*.ts : Extract component logic into custom hooks grouped by concern, with each hook in its own `.ts` file

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.stories.tsx : Use Storybook for design system, atoms, molecules, visual states (hover, disabled, loading), and responsive layouts

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts} : Add Storybook stories for new components and Playwright tests for E2E scenarios

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for payment or sensitive transactions requiring a real browser

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx} : Use Playwright for E2E testing and Storybook for component development

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Place integration tests in a `__tests__` folder next to the component being tested

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Place unit tests co-located with the source file: `Component.test.tsx` next to `Component.tsx`

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use `findBy...` methods most of the time in integration tests to wait for elements to appear and avoid flaky tests

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test third-party library internals (Radix UI, React Query)

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
📚 Learning: 2026-02-27T10:45:49.499Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/(platform)/copilot/tools/RunMCPTool/helpers.tsx:23-24
Timestamp: 2026-02-27T10:45:49.499Z
Learning: Prefer using generated OpenAPI types from '@/app/api/__generated__/' for payloads defined in openapi.json (e.g., MCPToolsDiscoveredResponse, MCPToolOutputResponse). Use inline TypeScript interfaces only for payloads that are SSE-stream-only and not exposed via OpenAPI. Apply this pattern to frontend tool components (e.g., RunMCPTool) and related areas where similar SSE/openapi-discrepancies occur; avoid re-implementing types when a generated type is available.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test simple prop-passing components with no logic

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
🔇 Additional comments (6)
autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx (1)

198-402: Strong branch-focused coverage for CustomNode rendering states.

The scenario matrix is thorough (UI type branches + error/edge conditions) and clearly supports the PR’s integration-test objective.

autogpt_platform/frontend/src/app/(platform)/build/__tests__/RunGraph.test.tsx (1)

65-146: Solid interaction/state coverage for RunGraph.

Nice matrix across disabled states, running/not-running actions, and dialog visibility; this meaningfully protects regression-prone UI behavior.

autogpt_platform/frontend/src/app/(platform)/build/__tests__/useFlow.test.ts (1)

83-134: useFlow tests are focused and well-isolated.

The loading-state permutations and initial-load completion check are well targeted for this hook.

autogpt_platform/frontend/src/app/(platform)/build/__tests__/copyPasteStore.test.ts (1)

59-256: Good store-level coverage for copy/paste semantics.

The suite captures key invariants (edge filtering, remap correctness, selection behavior, and empty clipboard no-op) well.

autogpt_platform/frontend/src/app/(platform)/build/__tests__/edgeStore.test.ts (1)

65-751: Great depth on edgeStore behavioral contracts.

Coverage of duplicate rejection, history interaction, link conversion, and bead-state transitions is strong and pragmatic.

autogpt_platform/frontend/src/app/(platform)/build/__tests__/graphStore.test.ts (1)

34-347: Graph store behavior is covered comprehensively.

Execution lifecycle, schema predicates, reset semantics, and subgraph replacement paths are all tested clearly.

Comment thread autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx Outdated
@Abhi1992002 Abhi1992002 changed the title test(frontend/builder): add integration tests for builder stores, components, and hooks test(frontend/builder): add integration tests for builder stores, components, and hooks (part-1) Mar 16, 2026
@Abhi1992002 Abhi1992002 changed the title test(frontend/builder): add integration tests for builder stores, components, and hooks (part-1) test(frontend/builder): add integration tests for builder stores, components, and hooks (part-1) Mar 16, 2026
- Replace `any` types with proper interfaces and `unknown`
- Add `createExecutionResult()` helper for consistent test data
- Replace setTimeout-based microtask flushing with `queueMicrotask()`
- Use `vi.waitFor()` for reliable async assertions
- Remove redundant `cleanup()` call in beforeEach
- Split combined test case into separate assertions

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts (1)

736-752: ⚠️ Potential issue | 🟠 Major

Avoid encoding duplicate node IDs as valid behavior.

At Line 736, this test asserts duplicate IDs are accepted and retained. If ID-keyed store APIs resolve by single-ID lookup, this introduces ambiguous/non-deterministic updates and reads. Please enforce one invariant (reject/replace duplicates) and update this expectation accordingly.

#!/bin/bash
set -euo pipefail

node_store_file="$(fd 'nodeStore.ts$' | head -n1)"
echo "Inspecting: ${node_store_file}"

echo
echo "== addNode/addNodes implementations =="
rg -n -C4 '\b(addNode|addNodes)\s*:\s*\(' "${node_store_file}"

echo
echo "== ID-keyed methods =="
rg -n -C3 '\b(getNodeStatus|getNodeErrors|updateNodeData|getNodeExecutionResults|getLatestNodeExecutionResult)\s*:\s*\(' "${node_store_file}"

echo
echo "== Lookup patterns (.find / filtering by id) =="
rg -n -C2 '\.find\s*\(|\.filter\s*\(' "${node_store_file}"

Expected verification outcome: either duplicate IDs are prevented at insertion, or all ID-keyed methods handle duplicates deterministically by design.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/nodeStore.test.ts
around lines 736 - 752, The test and store must enforce a single consistent
invariant for node IDs; update the store implementation (addNode/addNodes) to
deduplicate incoming nodes by id (e.g., keep first or last occurrence) or reject
duplicates and throw, and ensure all ID-keyed accessors (getNodeStatus,
getNodeErrors, updateNodeData, getNodeExecutionResults,
getLatestNodeExecutionResult) operate against a unique-id invariant;
specifically, modify addNodes/addNode to detect duplicate ids in the input or
existing state and resolve them deterministically (dedupe by id before merging
into the nodes array or throw an error), then update the test to expect the
chosen behavior (no ambiguous duplicate IDs in the nodes array).
🧹 Nitpick comments (3)
autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx (2)

390-405: Consider adding test for NOTE type not rendering NodeExecutionBadge.

The describe block states "always renders NodeExecutionBadge for non-NOTE types" but doesn't include a test verifying that NOTE type does not render it. This would complete the coverage for that conditional.

💡 Suggested test addition
   it("renders NodeExecutionBadge for OUTPUT type", () => {
     renderCustomNode({ uiType: BlockUIType.OUTPUT });
     expect(screen.getByTestId("node-execution-badge")).toBeDefined();
   });
+
+  it("does not render NodeExecutionBadge for NOTE type", () => {
+    renderCustomNode({ uiType: BlockUIType.NOTE });
+    expect(screen.queryByTestId("node-execution-badge")).toBeNull();
+  });
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/CustomNode.test.tsx
around lines 390 - 405, Add a test to verify that NodeExecutionBadge is not
rendered for NOTE blocks: in the "NodeExecutionBadge" describe block use
renderCustomNode({ uiType: BlockUIType.NOTE }) and assert that
screen.queryByTestId("node-execution-badge") returns null (or use
expect(...).toBeFalsy()/toBeNull()) instead of getByTestId so the absence is
correctly asserted; place this alongside the existing tests for
STANDARD/AGENT/OUTPUT to complete the conditional coverage.

224-226: cleanup() call is typically redundant with Vitest.

Vitest with React Testing Library auto-runs cleanup after each test. This explicit call is not harmful but can be removed for brevity.

♻️ Optional cleanup
-beforeEach(() => {
-  cleanup();
-});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/CustomNode.test.tsx
around lines 224 - 226, Remove the redundant explicit cleanup() call from the
test setup: delete the beforeEach block that calls cleanup() since Vitest +
React Testing Library already auto-runs cleanup after each test; locate the
beforeEach containing cleanup() in CustomNode.test.tsx to remove it and leave
tests relying on the default automatic cleanup behavior.
autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts (1)

5-6: Use import type for type-only imports.

CustomNode and CustomEdge are used only as types in function signatures and return types. Using import type clarifies intent and allows bundlers to eliminate these imports.

♻️ Suggested fix
-import { CustomNode } from "../components/FlowEditor/nodes/CustomNode/CustomNode";
-import { CustomEdge } from "../components/FlowEditor/edges/CustomEdge";
+import type { CustomNode } from "../components/FlowEditor/nodes/CustomNode/CustomNode";
+import type { CustomEdge } from "../components/FlowEditor/edges/CustomEdge";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/historyStore.test.ts
around lines 5 - 6, Change the two runtime imports to type-only imports: replace
the current imports of CustomNode and CustomEdge with "import type" declarations
so they are treated as TypeScript type-only imports (e.g., import type {
CustomNode } and import type { CustomEdge }), and verify that neither CustomNode
nor CustomEdge is used at runtime in the test file (only in function
signatures/return types) so the change is safe and bundlers can remove them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/historyStore.test.ts:
- Line 22: Replace the unsafe type assertion on the test's uiType value: instead
of using the string literal "STANDARD" as never, set uiType to the enum member
BlockUIType.STANDARD (the correct value equals "Standard"); update the test
helper in historyStore.test.ts to import/use BlockUIType and assign uiType =
BlockUIType.STANDARD so the type matches and you don't suppress type checking.

---

Duplicate comments:
In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/nodeStore.test.ts:
- Around line 736-752: The test and store must enforce a single consistent
invariant for node IDs; update the store implementation (addNode/addNodes) to
deduplicate incoming nodes by id (e.g., keep first or last occurrence) or reject
duplicates and throw, and ensure all ID-keyed accessors (getNodeStatus,
getNodeErrors, updateNodeData, getNodeExecutionResults,
getLatestNodeExecutionResult) operate against a unique-id invariant;
specifically, modify addNodes/addNode to detect duplicate ids in the input or
existing state and resolve them deterministically (dedupe by id before merging
into the nodes array or throw an error), then update the test to expect the
chosen behavior (no ambiguous duplicate IDs in the nodes array).

---

Nitpick comments:
In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/CustomNode.test.tsx:
- Around line 390-405: Add a test to verify that NodeExecutionBadge is not
rendered for NOTE blocks: in the "NodeExecutionBadge" describe block use
renderCustomNode({ uiType: BlockUIType.NOTE }) and assert that
screen.queryByTestId("node-execution-badge") returns null (or use
expect(...).toBeFalsy()/toBeNull()) instead of getByTestId so the absence is
correctly asserted; place this alongside the existing tests for
STANDARD/AGENT/OUTPUT to complete the conditional coverage.
- Around line 224-226: Remove the redundant explicit cleanup() call from the
test setup: delete the beforeEach block that calls cleanup() since Vitest +
React Testing Library already auto-runs cleanup after each test; locate the
beforeEach containing cleanup() in CustomNode.test.tsx to remove it and leave
tests relying on the default automatic cleanup behavior.

In
`@autogpt_platform/frontend/src/app/`(platform)/build/__tests__/historyStore.test.ts:
- Around line 5-6: Change the two runtime imports to type-only imports: replace
the current imports of CustomNode and CustomEdge with "import type" declarations
so they are treated as TypeScript type-only imports (e.g., import type {
CustomNode } and import type { CustomEdge }), and verify that neither CustomNode
nor CustomEdge is used at runtime in the test file (only in function
signatures/return types) so the change is safe and bundlers can remove them.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf4fec29-f2a7-4a23-a97b-23115a874b78

📥 Commits

Reviewing files that changed from the base of the PR and between e6d5811 and 1e90bcc.

📒 Files selected for processing (6)
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewBlockMenu.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/useCopyPaste.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • autogpt_platform/frontend/src/app/(platform)/build/tests/NewSaveControl.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/tests/useCopyPaste.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/tests/NewBlockMenu.test.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: types
  • GitHub Check: Seer Code Review
  • GitHub Check: end-to-end tests
  • GitHub Check: Analyze (python)
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (14)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Run pnpm format to auto-fix formatting issues before completing work
Run pnpm lint to check for lint errors and fix any that appear before completing work

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{tsx,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/
'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development

Run pnpm types to check for type errors and fix any that appear before completing work

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code using pnpm format
Never use components from src/components/__legacy__/*

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts and use design system components from src/components/ (atoms, molecules, organisms)
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName} and regenerate with pnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local /components folder
Avoid large hooks, abstract logic into helpers.ts files when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not use useCallback or useMemo unless asked to optimize a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components and handlers
Use type-safe generated API hooks via Orval + React Query for data fetching
Use React Query for server state management and co-locate UI state in components/hooks
Separate render logic (.tsx) from business logic (use*.ts hooks)
Use only shadcn/ui (Radix UI primitives) with Tailwind CSS for UI components
Use Phosphor Icons only for all icon implementations
Use ErrorCard component for render errors, toast for mutations, and Sentry for exceptions
Use design system components from src/components/ (atoms, molecules, organisms)
Never use src/components/__legacy__/* components
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Use Tailwind CSS only for styling with design tokens
Do not use useCallback or useMemo unless asked to optimize a specific function
Never type with any unless a variable/attribute can actually be of any type

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Component props should be interface Props { ... } (not exported) unless the interface needs to be used outside the component

Use type Props = { ... } (not exported) for component props unless used outside the component

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
autogpt_platform/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never type with any, if no types available use unknown

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run pnpm test or pnpm test-ui for frontend Playwright tests

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/app/(platform)/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not type hook returns, let Typescript infer as much as possible

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Use Playwright for E2E testing and Storybook for component development

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts}

📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Add Storybook stories for new components and Playwright tests for E2E scenarios

Files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
🧠 Learnings (27)
📓 Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts} : Add Storybook stories for new components and Playwright tests for E2E scenarios
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Place integration tests in a `__tests__` folder next to the component being tested
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx} : Use Playwright for E2E testing and Storybook for component development
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Place unit tests co-located with the source file: `Component.test.tsx` next to `Component.tsx`

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Place integration tests in a `__tests__` folder next to the component being tested

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{stories.tsx,spec.ts,test.ts} : Add Storybook stories for new components and Playwright tests for E2E scenarios

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Mock API requests in integration tests via MSW (Mock Service Worker)

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/**/*.{ts,tsx} : Never type with `any`, if no types available use `unknown`

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Run `pnpm types` to check for type errors and fix any that appear before completing work

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Never type with `any` unless a variable/attribute can actually be of any type

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test TypeScript types

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-03-10T06:34:10.984Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 12354
File: autogpt_platform/frontend/src/components/renderers/InputRenderer/base/oneof/OneOfField.tsx:16-19
Timestamp: 2026-03-10T06:34:10.984Z
Learning: In `autogpt_platform/frontend/src/components/renderers/InputRenderer/base/oneof/OneOfField.tsx`, the schema parameters in functions like `getDiscriminatorPropName` use `any` intentionally because `discriminator`, `const`, and `advanced` are custom JSON Schema extensions not present in `RJSFSchema` from `rjsf/utils`. A typed intersection `RJSFSchema & { discriminator?: string | { propertyName: string }; const?: unknown; advanced?: boolean }` is the preferred alternative over bare `any` to maintain type safety while accommodating these extensions.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx,js,jsx} : Run `pnpm lint` to check for lint errors and fix any that appear before completing work

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use `findBy...` methods most of the time in integration tests to wait for elements to appear and avoid flaky tests

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test simple prop-passing components with no logic

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-27T10:45:49.499Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/(platform)/copilot/tools/RunMCPTool/helpers.tsx:23-24
Timestamp: 2026-02-27T10:45:49.499Z
Learning: Prefer using generated OpenAPI types from '@/app/api/__generated__/' for payloads defined in openapi.json (e.g., MCPToolsDiscoveredResponse, MCPToolOutputResponse). Use inline TypeScript interfaces only for payloads that are SSE-stream-only and not exposed via OpenAPI. Apply this pattern to frontend tool components (e.g., RunMCPTool) and related areas where similar SSE/openapi-discrepancies occur; avoid re-implementing types when a generated type is available.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx} : Run `pnpm test` or `pnpm test-ui` for frontend Playwright tests

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
📚 Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-03-10T08:39:13.707Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12356
File: autogpt_platform/backend/backend/copilot/constants.py:9-12
Timestamp: 2026-03-10T08:39:13.707Z
Learning: In Significant-Gravitas/AutoGPT PR `#12356`, the `COPILOT_SYNTHETIC_ID_PREFIX = "copilot-"` check in `create_auto_approval_record` (human_review.py) is intentional and safe. The `graph_exec_id` passed to this function comes from server-side `PendingHumanReview` DB records (not from user input); the API only accepts `node_exec_id` from users. Synthetic `copilot-*` IDs are only ever created server-side in `run_block.py`. The prefix skip avoids a DB lookup for a `AgentGraphExecution` record that legitimately does not exist for CoPilot sessions, while `user_id` scoping is enforced at the auth layer and on the resulting auto-approval record.

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for authentication flows (login, signup, logout) that MUST work in a real browser

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-02-26T21:29:44.105Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-26T21:29:44.105Z
Learning: Applies to autogpt_platform/frontend/**/*.{spec.ts,test.ts,stories.tsx} : Use Playwright for E2E testing and Storybook for component development

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
📚 Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.stories.tsx : Use Storybook for design system, atoms, molecules, visual states (hover, disabled, loading), and responsive layouts

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts
🔇 Additional comments (5)
autogpt_platform/frontend/src/app/(platform)/build/__tests__/CustomNode.test.tsx (2)

1-8: Good type imports and structure.

The imports are well-organized with proper type-only imports for CustomNodeData, NodeProps, and NodeExecutionResult. This addresses the previous review concerns about any types.


201-220: DateTime fields are correctly typed as Date objects.

The NodeExecutionResult type in autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts defines add_time, queue_time, start_time, and end_time as Date objects (not strings). The test helper correctly creates Date instances for these fields—no type mismatch exists.

			> Likely an incorrect or invalid review comment.
autogpt_platform/frontend/src/app/(platform)/build/__tests__/nodeStore.test.ts (1)

35-54: Good fixture normalization with createExecutionResult.

Centralizing NodeExecutionResult setup here makes the suite more consistent and easier to maintain.

autogpt_platform/frontend/src/app/(platform)/build/__tests__/historyStore.test.ts (2)

44-52: LGTM!

The flushMicrotasks helper correctly uses queueMicrotask matching the store's batching primitive. Test isolation is properly implemented by resetting all three interdependent stores.


54-407: LGTM!

Comprehensive test coverage for the historyStore including undo/redo semantics, history limits, microtask batching behavior, canUndo/canRedo API, deduplication, and edge restoration. The tests correctly verify state consistency across the interdependent nodeStore and edgeStore.

@github-project-automation github-project-automation Bot moved this from 🆕 Needs initial review to 👍🏼 Mergeable in AutoGPT development kanban Mar 16, 2026
@Abhi1992002
Abhi1992002 added this pull request to the merge queue Mar 17, 2026
Merged via the queue into dev with commit c268fc6 Mar 17, 2026
21 checks passed
@Abhi1992002
Abhi1992002 deleted the abhi/builder-integration-test-part-1 branch March 17, 2026 05:37
@github-project-automation github-project-automation Bot moved this to Done in Frontend Mar 17, 2026
@github-project-automation github-project-automation Bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban Mar 17, 2026
Bentlybro pushed a commit that referenced this pull request Apr 4, 2026
…ponents, and hooks (part-1) (#12433)

### Changes
- Add 329 integration tests across 11 test files for the builder (visual
  workflow editor)
- Cover all Zustand stores (nodeStore, edgeStore, historyStore,
graphStore,
  copyPasteStore, blockMenuStore, controlPanelStore)
- Cover key components (CustomNode, NewBlockMenu, NewSaveControl,
RunGraph)
- Cover hooks (useFlow, useCopyPaste)

### Test files

  | File | Tests | Coverage |
  |------|-------|----------|
| `nodeStore.test.ts` | 58 | Node lifecycle, bulk ops, backend
conversion,
  execution tracking, status, errors, resolution mode |
  | `edgeStore.test.ts` | 37 | Edge CRUD, duplicate rejection, bead
  visualization, backend link conversion, upsert |
| `historyStore.test.ts` | 22 | Undo/redo, history limits (50),
microtask
  batching, deduplication, canUndo/canRedo |
| `graphStore.test.ts` | 28 | Execution status transitions,
isGraphRunning,
  schema management, sub-graphs |
| `copyPasteStore.test.ts` | 8 | Copy/paste with ID remapping, position
offset,
   edge preservation |
| `CustomNode.test.tsx` | 25 | Rendering by block type (NOTE, WEBHOOK,
AGENT,
  OUTPUT, AYRSHARE), error states |
| `NewBlockMenu.test.tsx` | 29 | Store state (search, filters, creators,
  categories), search/default view routing |
| `NewSaveControl.test.tsx` | 11 | Save dialog rendering, form
validation,
  version display, popover state |
| `RunGraph.test.tsx` | 11 | Run/stop button states, loading, click
handlers,
  RunInputDialog visibility |
  | `useFlow.test.ts` | 4 | Loading states, initial load completion |
| `useCopyPaste.test.ts` | 16 | Clipboard copy/paste, UUID remapping,
viewport
  centering, input field guard |
Bentlybro pushed a commit to Bentlybro/AutoGPT that referenced this pull request Apr 4, 2026
…ponents, and hooks (part-1) (Significant-Gravitas#12433)

### Changes
- Add 329 integration tests across 11 test files for the builder (visual
  workflow editor)
- Cover all Zustand stores (nodeStore, edgeStore, historyStore,
graphStore,
  copyPasteStore, blockMenuStore, controlPanelStore)
- Cover key components (CustomNode, NewBlockMenu, NewSaveControl,
RunGraph)
- Cover hooks (useFlow, useCopyPaste)

### Test files

  | File | Tests | Coverage |
  |------|-------|----------|
| `nodeStore.test.ts` | 58 | Node lifecycle, bulk ops, backend
conversion,
  execution tracking, status, errors, resolution mode |
  | `edgeStore.test.ts` | 37 | Edge CRUD, duplicate rejection, bead
  visualization, backend link conversion, upsert |
| `historyStore.test.ts` | 22 | Undo/redo, history limits (50),
microtask
  batching, deduplication, canUndo/canRedo |
| `graphStore.test.ts` | 28 | Execution status transitions,
isGraphRunning,
  schema management, sub-graphs |
| `copyPasteStore.test.ts` | 8 | Copy/paste with ID remapping, position
offset,
   edge preservation |
| `CustomNode.test.tsx` | 25 | Rendering by block type (NOTE, WEBHOOK,
AGENT,
  OUTPUT, AYRSHARE), error states |
| `NewBlockMenu.test.tsx` | 29 | Store state (search, filters, creators,
  categories), search/default view routing |
| `NewSaveControl.test.tsx` | 11 | Save dialog rendering, form
validation,
  version display, popover state |
| `RunGraph.test.tsx` | 11 | Run/stop button states, loading, click
handlers,
  RunInputDialog visibility |
  | `useFlow.test.ts` | 4 | Loading states, initial load completion |
| `useCopyPaste.test.ts` | 16 | Clipboard copy/paste, UUID remapping,
viewport
  centering, input field guard |
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/xl

Projects

Status: ✅ Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants