Skip to content

feat(platform): voice brain-dump onboarding step - #13764

Merged
Abhi1992002 merged 42 commits into
devfrom
abhi/onboarding-brain-dump
Aug 5, 2026
Merged

feat(platform): voice brain-dump onboarding step#13764
Abhi1992002 merged 42 commits into
devfrom
abhi/onboarding-brain-dump

Conversation

@Abhi1992002

@Abhi1992002 Abhi1992002 commented Aug 2, 2026

Copy link
Copy Markdown
Member

Why / What / How

Why. Onboarding currently asks new users to pick pain points from a pillbox. It is fast to click and tells us almost nothing — a set of canned tags can't capture what someone actually does all day, so the copilot's first screen greets everyone the same way and the integrations list is a generic A-Z wall. The most valuable thing a new user can give us is two minutes of unedited talking about their work, and we were not asking for it.

What. Replaces the pain-points step with a voice brain dump: the user talks, we transcribe it, and the transcript drives a personalised greeting, personalised starter prompts, and a "Connect your tools" panel that recommends integrations picked from what they actually said. Everything is behind the onboarding-brain-dump LaunchDarkly flag; with the flag off the pillbox flow renders untouched and the backend endpoints 404.

How. The hard requirement is that a recording is never lost — someone who just talked for three minutes must not be asked to do it again.

  • Local-first capture. MediaRecorder emits a chunk every 3s. Each chunk is written to IndexedDB before it is offered to the network, and the store is only cleared once the server reports completed. A crash, refresh, dead tunnel or closed laptop can cost an upload, never a recording. On next mount an unfinalized recording with parts triggers a "Pick up where you left off?" prompt.
  • Uploads off the critical path. A background queue drains parts with backoff [1s, 3s, 8s]; a failed part stays at the head so ordering holds, and online/offline listeners park and resume it. Nothing is surfaced to the user while they are still talking. "I'm done" flushes the queue before finalize so the assembled audio can't have holes.
  • Server pipeline. Parts buffer in Redis (base64 — the shared client uses decode_responses=True, which would corrupt raw opus), then finalize assembles → virus scans → stores → transcribes. Transcription is gpt-4o-transcribe with a whisper-1 fallback, and splits recordings over 20 MiB / 20 min into overlapping 10-min segments that are re-stitched by longest-word-sequence match. Two independent background jobs then run: business-understanding extraction + greeting, and provider recommendations. Neither can block the other, and a failure in either releases the loading screen rather than hanging it.
  • Live captions are cosmetic. They stream mic audio straight to ElevenLabs Scribe (or Deepgram) using a short-lived token minted server-side, so API keys never reach the browser. With no key configured they fall back to on-device SpeechRecognition, then to a level meter. The real transcript is always produced server-side after upload.

Changes 🏗️

Backend — new backend/api/features/onboarding_dump/ package

  • 8 endpoints under /api/onboarding/brain-dump (/parts, /finalize, /status, /intro, /intro/complete, /recommended-providers, /recording, DELETE). Router-level flag dependency makes every one of them 404 when the flag is off.
  • Limits: 2 MiB/part, 50 MiB/recording, 20k typed chars, allow-listed audio MIME types.
  • Transcription with model fallback, retry/backoff, and ffmpeg-based splitting for long recordings. Language is never passed to the provider, so non-English dumps aren't translated.
  • Greeting generation (prompt managed in Langfuse when configured, built-in fallback otherwise) and provider recommendations validated against the live provider registry — hallucinated ids are dropped.
  • Eval harness: poetry run brain-dump-eval --dir <corpus> reports per-file and pooled WER against a reference corpus and gates at pooled WER < 5%. WER is computed inline; no new dependency. Corpus is deliberately not committed — see EVAL.md.
  • 68 tests covering the pipeline, error codes, idempotent finalize, flag gating on every route, stitching, and the WER math.

Database — 4 migrations

  • OnboardingBrainDump table + BrainDumpStatus / BrainDumpInputMode enums (1:1 with User, cascade delete).
  • Greeting columns (greeting, suggestedPrompts, greetingSeen).
  • recommendedProviders (nullable — NULL means the job is still running, [] means genuinely nothing to recommend).
  • CAPABILITY_CARDS added to OnboardingStep.

Frontend

  • New BrainDumpStep — one glass orb across rest → recording → processing → failed → recovery → typing, live captions, elapsed timer, timed encouragements, silence nudge, hard stop at 30 min.
  • Typed fallback (auto-entered on mic permission denial) and a skip path; neither is a dead end.
  • Failure state keeps the recording downloadable and offers "Continue without it".
  • Copilot welcome dialog (4 capability cards) with an inline "Connect your tools" panel — OAuth and API-key flows run without leaving the dialog, and recommendations are polled for ~60s and shown with the model's reason.
  • Onboarding intro card on the copilot home: greeting reveals word-by-word, then prompts, then composer.
  • Composer toggles moved into a new ComposerTray with a ToggleChip primitive.
  • Dev-only debug page at /dev/brain-dump-debug, triple-gated (404s in production, 404s with the flag off).
  • 18 new tests, including a regression test for a real bug found here: drain() returned a no-op instead of the in-flight promise, so flush() awaited nothing and reported failure on every single dump.

Configuration (all commented out by default — an active value would force the feature on for every install and bypass LaunchDarkly)

  • backend/.env.default: FORCE_FLAG_ONBOARDING_BRAIN_DUMP, BRAIN_DUMP_TRANSCRIPTION_MODEL, BRAIN_DUMP_TRANSCRIPTION_FALLBACK_MODEL, BRAIN_DUMP_GREETING_MODEL, BRAIN_DUMP_GREETING_PROMPT_NAME, BRAIN_DUMP_RECOMMEND_MODEL.
  • frontend/.env.default: NEXT_PUBLIC_FORCE_FLAG_ONBOARDING_BRAIN_DUMP, plus ELEVENLABS_API_KEY / DEEPGRAM_API_KEY / NEXT_PUBLIC_LIVE_CAPTIONS_ENGINE for live captions. Leaving the caption keys unset is fine — the step falls back to the browser engine.
  • No new backend dependencies. No new frontend dependencies.

Out of scope, flagged for reviewers. This branch also carries a couple of unrelated bits I'd rather call out than bury: some sidebar/chrome restyling and a chat-bubble gradient change (both now gated on onboarding-brain-dump). Happy to split either out if you'd prefer.

Previously listed here: a Flag.AUTOGPT_NEW_LAYOUT default flip from false → true. That is reverted — both it and onboarding-brain-dump default to false, and flag-defaults.test.ts now pins that.

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • poetry run pytest backend/api/features/onboarding_dump/ — 68 passed
    • pnpm test:unit — full suite green (4255 passed)
    • pnpm format && pnpm lint && pnpm types — clean
    • Flag off: onboarding renders the pillbox step, step count and progress bar unchanged, brain-dump endpoints return 404
    • Flag on, happy path: record ~2 min → "I'm done" → preparing screen → copilot home shows a personalised greeting and starter prompts drawn from what was said
    • Flag on, welcome dialog: "Connect your tools" recommends providers with a reason from the transcript; connect one via OAuth and one via API key without leaving the dialog
    • Recovery: record ~1 min, hard-refresh mid-recording, confirm "Pick up where you left off?" and that resuming produces a complete transcript
    • Offline: record with the network throttled to offline, restore it, confirm the queue drains and finalize succeeds
    • Deny mic permission → typed fallback appears; submit typed text and confirm the greeting still personalises
    • Skip the step → generic Path B greeting, no false "Reading your brain dump" copy
    • Safari: confirm audio/mp4 capture and that the recording transcribes
    • Long recording (>20 min) splits and stitches without a duplicated or dropped seam

For configuration changes:

  • .env.default is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes (ffmpeg is already in the backend image; no new services)
  • I have included a list of my configuration changes in the PR description (under Changes)

Replaces the pillbox pain-points step with a voice brain dump behind the
`onboarding-brain-dump` LaunchDarkly flag, and uses the transcript to
personalise the copilot home.

Backend adds `api/features/onboarding_dump/`: chunked audio upload
buffered in Redis, virus scan, cloud storage, transcription with model
fallback and long-recording splitting, then two independent background
jobs for the greeting and the integration recommendations.

Frontend adds a local-first recorder (IndexedDB before network), a
retrying upload queue, live captions, crash recovery, a typed fallback,
and the copilot welcome dialog / intro card that consume the result.
Removes the pieces that were only ever meant for local comparison work
and would otherwise ship to users:

- the live-caption A/B pills pinned to the onboarding screen; the engine
  now comes from NEXT_PUBLIC_LIVE_CAPTIONS_ENGINE alone
- Card1/2/3Vignette and CurveLab, all unreachable (CARDS only ever sets
  `icon`), together with the replay button and vignetteKey they fed
- the `ogl` dependency, which nothing imports

Also documents ELEVENLABS_API_KEY / DEEPGRAM_API_KEY /
NEXT_PUBLIC_LIVE_CAPTIONS_ENGINE in .env.default, corrects the greeting
model default, and adds CAPABILITY_CARDS to the legacy OnboardingStep
union so type-check passes.
@Abhi1992002
Abhi1992002 requested a review from a team as a code owner August 2, 2026 13:03
@Abhi1992002
Abhi1992002 requested review from Pwuts and kcze and removed request for a team August 2, 2026 13:03
@github-project-automation github-project-automation Bot moved this to 🆕 Needs initial review in AutoGPT development kanban Aug 2, 2026
@github-actions github-actions Bot added platform/frontend AutoGPT Platform - Front end platform/backend AutoGPT Platform - Back end labels Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The pull request adds a feature-flagged onboarding brain-dump flow. It includes browser recording, chunked upload, transcription, persistence, generated introductions, provider recommendations, Copilot onboarding, diagnostics, and evaluation tooling.

Changes

Onboarding brain-dump platform

Layer / File(s) Summary
Backend contracts and processing
autogpt_platform/backend/backend/api/features/onboarding_dump/*, autogpt_platform/backend/schema.prisma, autogpt_platform/backend/migrations/*
Adds database models, storage helpers, upload and finalization routes, transcription with fallback and chunk stitching, extraction, greeting generation, provider recommendations, and feature-flag enforcement.
Frontend recording flow
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/*
Adds browser recording, IndexedDB persistence, ordered uploads, recovery, typed fallback, skipping, retries, captions, and state-specific onboarding screens.
Copilot onboarding integration
autogpt_platform/frontend/src/app/(platform)/copilot/*
Adds intro cards, capability cards, provider connections, greeting completion, handoff state, analytics, and composer integration.
Diagnostics and evaluation
autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/*, autogpt_platform/backend/backend/api/features/onboarding_dump/brain_dump_eval.py
Adds a debug page and a WER evaluation command with reports, seam diagnostics, and a 5% aggregate gate.
API and supporting contracts
autogpt_platform/frontend/src/app/api/*, autogpt_platform/frontend/src/services/*
Adds OpenAPI schemas, live-caption token minting, feature flags, mocks, onboarding types, analytics, and handoff helpers.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: documentation

Suggested reviewers: pwuts, kcze

Poem

A rabbit records, then chunks hop in a queue,
Captions and transcripts become clear and true.
Greetings arise,
Provider cards surprise,
While onboarding paths guide each step through.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding voice brain-dump onboarding.
Description check ✅ Passed The description directly explains the brain-dump onboarding changes, implementation details, testing, and feature-flag behavior.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch abhi/onboarding-brain-dump

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.

…enapi

- `PrivacyNote.tsx` was never committed: the `pri*` rule in .gitignore
  ("Allow for locally private items") silently matched it, so the file
  only existed locally and the production build could not resolve it.
  Force-added.
- Removes `ArrowClockwiseIcon` and `ComponentType`, left unused when the
  vignettes were deleted, and updates the two comments that still
  referred to them.
- Regenerates openapi.json with `export-api-schema` + plain prettier so
  it matches what the "check API types" job produces; the previous copy
  had escaped unicode (⚠) where the exporter emits literal glyphs.
`stop()` wrote `elapsedSeconds` straight from React state, which is the
value from the caller's own render. `handleDone` awaits `stop()`, and
stopping waits on the encoder draining plus the pending IndexedDB
writes, so every second spent there was missing from the duration.

That number is what the backend splits recordings on: a take just over
20 minutes could report just under, skip splitting, and fail to
transcribe — which strands the user at the end of onboarding, having
already talked for twenty minutes.

`stop()` now measures the elapsed time itself and returns it, and
`handleDone` uses the returned value. A ref mirrors the state so the
early-return path stays accurate too.

Adds a regression test: it reports 60s instead of 64s against the old
code.

@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: 17

Note

Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.

🟡 Minor comments (11)
autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py-386-397 (1)

386-397: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Stub the LLM generation in the intro route tests.

finalize() waits for intro.generate_intro(transcript), which calls get_openai_client(prefer_openrouter=True). These routes-level fixtures mock only STT and extraction, but not the greeting/prompt generation path, so test_intro_returns_greeting_and_prompts_before_completion can hit an unmocked client. Add a fixture that replaces backend.util.clients.get_openai_client or backend.api.features.onboarding_dump.intro.client and assert a deterministic greeting/prompt set.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py`
around lines 386 - 397, Stub the intro LLM generation used by finalize() in the
onboarding route tests, targeting backend.util.clients.get_openai_client or
intro.client. Configure the stub to return a deterministic greeting and prompt
set, then update test_intro_returns_greeting_and_prompts_before_completion to
assert those values while preserving the existing response checks.
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts-261-277 (1)

261-277: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Revoke the object URL after the download starts.

URL.revokeObjectURL(url) runs in the same tick as link.click(). Some browsers cancel the download when the blob URL is revoked before the transfer begins. This is the failure-path safety net, so a cancelled download loses the recording for the user. Also append the anchor to the document; Firefox ignores clicks on detached anchors.

🐛 Proposed fix
     const link = document.createElement("a");
     link.href = url;
     link.download = `brain-dump-${recordingId}.webm`;
+    document.body.appendChild(link);
     link.click();
-    URL.revokeObjectURL(url);
+    link.remove();
+    setTimeout(() => URL.revokeObjectURL(url), 0);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
around lines 261 - 277, Update handleDownloadRecording to append the generated
anchor to the document before clicking it, then defer URL.revokeObjectURL until
the download has had time to start rather than revoking it in the same tick.
Preserve the existing recording download behavior and cleanup the temporary
anchor as part of the deferred cleanup.
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/OrbFrame.tsx-97-104 (1)

97-104: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a visible focus style to the orb button.

OrbFrame.tsx:97-104 wraps the recording orb in an always-mounted button, but the class only includes rounded-full. Add focus-visible: utilities so keyboard users see focus on the primary control.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/OrbFrame.tsx
around lines 97 - 104, Add visible keyboard focus styling to the always-mounted
button in OrbFrame by extending its className with appropriate focus-visible
utilities, while preserving the existing positioning and rounded shape styles.
Ensure the primary recording control has a clear focus indicator when focused
via keyboard.
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts-110-116 (1)

110-116: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Persisted durationSecs is 0 on the hard-stop path.

tick is passed to setInterval inside start(), so it captures the stop closure from that render. In that render elapsedSeconds is 0. When HARD_STOP_SECONDS triggers the auto-stop, line 134 writes durationSecs: 0 into the recovery metadata. Derive the duration from startedAtRef instead, which is correct for both the manual and the automatic path.

🐛 Proposed fix
-      durationSecs: elapsedSeconds,
+      durationSecs: (Date.now() - startedAtRef.current) / 1000,

Also applies to: 130-136

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts
around lines 110 - 116, Update the recovery metadata write in stop to derive
durationSecs from startedAtRef.current and the current time rather than the
captured elapsedSeconds value. Ensure both manual stops and the
HARD_STOP_SECONDS path triggered by tick persist the actual elapsed duration.
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts-115-118 (1)

115-118: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Both cloud caption hooks parse untrusted socket frames without a guard. The shared root cause is the duplicated socket.onmessage body: message.data is cast to string and passed straight to JSON.parse. A binary frame or a malformed payload makes the parse throw inside the event handler.

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts#L115-L118: check typeof message.data === "string", wrap the JSON.parse in try/catch, and return early on an unparseable frame.
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useScribeLiveCaptions.ts#L122-L125: apply the identical guard to the Scribe handler.

Both hooks are near-identical. Consider extracting the shared socket, PCM capture, and word-slot logic into one helper that each provider configures.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts
around lines 115 - 118, Guard both socket.onmessage handlers against non-string
data and malformed JSON: in useDeepgramLiveCaptions.ts lines 115-118 and
useScribeLiveCaptions.ts lines 122-125, validate message.data is a string, parse
it inside try/catch, and return early when parsing fails. Keep valid Results
processing unchanged; do not require the optional helper extraction.
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.tsx-18-18 (1)

18-18: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Move aria-hidden off the subtree that renders children.

<div aria-hidden> currently includes {children}, so content passed through <GlassOrb> can be hidden from assistive technology. Keep aria-hidden on the decorative SVG/filter wrapper and layers only, or omit it if the inner content is meaningful.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.tsx
at line 18, Update the GlassOrb component’s outer wrapper so aria-hidden no
longer applies to the subtree rendering children. Keep the attribute only on the
decorative SVG/filter wrapper and visual layers, or remove it when the inner
content is meaningful, while preserving children accessibility.
autogpt_platform/backend/migrations/20260801100000_add_onboarding_brain_dump/migration.sql-43-45 (1)

43-45: 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Drop the redundant userId index from the migration.

OnboardingBrainDump_userId_key already indexes every userId lookup. The extra OnboardingBrainDump_userId_idx adds write-time index maintenance and storage without query benefit. Keeping schema.prisma as userId String @unique`` without an extra @@index([userId]) is sufficient.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/backend/migrations/20260801100000_add_onboarding_brain_dump/migration.sql`
around lines 43 - 45, Remove the redundant OnboardingBrainDump_userId_idx
creation from the migration, keeping the unique OnboardingBrainDump_userId_key
index and the existing userId uniqueness configuration unchanged.
autogpt_platform/backend/backend/api/features/onboarding_dump/models.py-19-28 (1)

19-28: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Validate FinalizeRequest.mime_type before you store it.

upload_brain_dump_part() rejects unsupported part content types, but finalize_brain_dump() passes request.mime_type straight to service.finalize_voice_dump(), and that stores mime_type verbatim as mimeType without referencing ALLOWED_AUDIO_MIME_TYPES. Add the allow-list validation in routes.py before calling service.finalize_voice_dump() so later validation cannot be bypassed by a malformed finalize request.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/models.py`
around lines 19 - 28, Validate FinalizeRequest.mime_type in
finalize_brain_dump() against ALLOWED_AUDIO_MIME_TYPES before invoking
service.finalize_voice_dump(). Reject unsupported MIME types using the route’s
existing validation/error response pattern, while preserving the current
finalize flow for allowed audio types.
autogpt_platform/backend/backend/api/features/onboarding_dump/service.py-199-210 (1)

199-210: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Move generate_recommendations inside the try block.

The docstring states that generate_recommendations never raises. The call sits outside the try, so that claim is the only thing preventing an unhandled exception in a background task. If the guarantee ever breaks, the exception escapes with no request to report to, and the recommendation column stays null forever while the client keeps polling.

🛡️ Proposed fix
-    recommendations = await recommend.generate_recommendations(transcript)
     try:
+        recommendations = await recommend.generate_recommendations(transcript)
         await db.update_dump(
             user_id,
             recommendedProviders=Json([r.model_dump() for r in recommendations]),
         )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/service.py`
around lines 199 - 210, Move the recommend.generate_recommendations call into
the existing try block in the background recommendation flow, keeping the
database update and serialization there as well so any exception is caught by
the existing logger.warning handler and reported with the user_id.
autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx-127-131 (1)

127-131: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Handle clipboard write failures.

handleCopyTranscript awaits navigator.clipboard.writeText(transcript) with no try/catch. If the write rejects (permission denied, non-secure context, or an older browser without navigator.clipboard), the function throws before setIsCopied(true) runs. The user clicks the button, sees no feedback, and the failure is unhandled.

🐛 Proposed fix
 async function handleCopyTranscript() {
-    await navigator.clipboard.writeText(transcript);
-    setIsCopied(true);
-    setTimeout(() => setIsCopied(false), 2000);
+    try {
+      await navigator.clipboard.writeText(transcript);
+      setIsCopied(true);
+      setTimeout(() => setIsCopied(false), 2000);
+    } catch {
+      // Clipboard access can fail silently in some browsers/contexts.
+    }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx
around lines 127 - 131, Update handleCopyTranscript to catch clipboard write
failures, including unavailable or rejected navigator.clipboard writes, so they
do not become unhandled errors. Only set isCopied to true and start the reset
timeout after a successful write; preserve the existing success feedback timing.
autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx-105-111 (1)

105-111: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wire composerStart into EmptySession or remove it.

introRevealTimings returns composerStart for the composer entrance, but this file only consumes promptsStart and footerStart, and EmptySession.tsx gates the composer with !intro.isAwaitingGreeting. Either apply composerStart as a delay for the EmptySession composer visibility, or remove the unused returned field.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx
around lines 105 - 111, Update introRevealTimings and its consumers so
composerStart is not left unused: either apply it to EmptySession’s composer
entrance timing alongside the !intro.isAwaitingGreeting gate, or remove
composerStart from the returned timing object and related destructuring. Keep
promptsStart and footerStart behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py`:
- Around line 104-105: The part-0 handling around start_dump must not reset a
dump that has already progressed past upload for the same recording_id. Update
the logic before invoking db.start_dump to check the existing dump status and
recording_id, preserving finalized/completed state while still resetting
eligible in-progress or new uploads.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/service.py`:
- Around line 52-67: Update the idempotency guard in finalize_voice_dump to
include BrainDumpStatus.transcribing alongside the existing transcribed,
extracting, and completed states, so retries during transcription return the
existing in-progress response without reassembling audio or marking the
recording failed.
- Around line 313-322: Validate recording_id at the model level using a UUID or
[A-Za-z0-9_-]{1,64} constraint, then reuse that validated type for the multipart
route’s Form recording_id and FinalizeRequest. Ensure the validated value is
used by _audio_filename, assemble_parts, and discard_parts so untrusted path or
key prefixes cannot be accepted.

In
`@autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py`:
- Around line 184-208: Update _probe_duration to catch parsing failures for the
Duration value, including N/A or malformed timestamps, and raise
TranscriptionFailedError instead of allowing ValueError to escape. Preserve the
existing successful conversion and no-Duration error behavior, using the same
filename context in the domain-specific error.
- Around line 150-181: Update split_audio to offload both blocking file
operations—the source write and each segment read—to asyncio.to_thread or the
existing equivalent executor, while preserving the current paths, data, and
segment-processing order.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts:
- Around line 110-114: Update the onopen handlers in useDeepgramLiveCaptions.ts
(lines 110-114) and useScribeLiveCaptions.ts (lines 117-121) to call
startAudio() inside try/catch, invoke fail() on errors, and move
setStatus("live") after successful audio initialization.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts:
- Around line 117-126: Update getMeta to support a recordingId-based lookup,
returning the metadata record keyed by that id while preserving the existing
newest-unfinalized behavior for callers without an id. In completeAndAdvance
within useBrainDumpStep.ts, pass the specific recordingId to getMeta before
marking the record finalized and clearing its parts.
- Around line 39-59: Add an onblocked handler in openDB that rejects the
returned Promise with an appropriate error, ensuring the version upgrade cannot
leave callers waiting indefinitely when another tab holds an older IndexedDB
connection. Preserve the existing onsuccess and onerror behavior.
- Around line 75-84: Update the promise transaction handling around openDB and
the request callbacks: always close the database when the transaction completes
or aborts, including request failures, and resolve write operations only from
transaction.oncomplete so callers are notified after commit. Preserve request
error rejection and ensure aborted transactions reject rather than resolving a
write that was not persisted.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts:
- Around line 173-193: Update handleSubmitTyped to inspect the result returned
by finalizeBrainDump, not only thrown errors, and treat non-success
responses—including a 200 response with status "failed"—as failure. On any
unsuccessful result, set the screen to "failed" and return before tracking
completion or calling completeAndAdvance; preserve the existing success flow for
valid finalized responses.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useUploadQueue.ts:
- Around line 62-64: Guard the markPartUploaded call in drainQueue so an
IndexedDB rejection cannot propagate after a successful upload. Catch and safely
ignore or log the bookkeeping failure, while preserving queue completion so
drain() and flush() resolve normally and enqueue() does not create an unhandled
rejection.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts:
- Around line 73-89: Update useOnboardingIntroCard’s useGetBrainDumpIntro query
to also require useGetFlag(Flag.ONBOARDING_BRAIN_DUMP) to be enabled, alongside
!isDone and !isWelcomeOpen. Reuse the existing flag hook and ensure the query
remains disabled for users without the onboarding brain-dump flag.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx:
- Around line 98-119: Update the modal implementation around
OnboardingWelcomeDialog and its outer onboarding-welcome-overlay container to
provide dialog semantics with role="dialog" and aria-modal="true". Reuse the
existing dialog primitive or focus-management behavior from ConnectServiceDialog
if available; otherwise move focus into the dialog when opened, trap Tab
navigation within it, and close it on Escape while preserving the existing
isOpen and close flow.
- Around line 74-87: Update the completeStep mutation call in finish to provide
an onError callback that displays a toast notification using the established
mutation error-handling convention and existing toast utility. Keep the
tracking, mutation request, and dialog close behavior unchanged.

In `@autogpt_platform/frontend/src/app/api/transcribe/live-session/route.ts`:
- Around line 35-38: Update the upstream fetch calls in the live-session route,
including the token request and the request inside mintDeepgram, to pass an
AbortSignal.timeout with an appropriate short timeout. Preserve the existing
error handling so timed-out requests produce a 502 and allow useLiveCaptions to
fall back to the browser engine.
- Around line 19-29: Add a shared per-user rate-limit check in POST before
mintDeepgram or mintElevenLabs, using the authenticated authToken/user identity
and a stable /api/transcribe/* limit such as N successful tokens per hour.
Reject requests exceeding the limit without minting a provider token, while
preserving the existing provider selection and unauthorized response behavior.

In `@autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts`:
- Line 63: Confirm whether AUTOGPT_NEW_LAYOUT should be enabled as the baseline;
if not, restore the false value in defaultFlags so disabled-feature, Playwright
mock, and missing LaunchDarkly values remain fail-closed. If true is
intentional, retain the change and document that new-layout behavior in the PR
description.

---

Minor comments:
In `@autogpt_platform/backend/backend/api/features/onboarding_dump/models.py`:
- Around line 19-28: Validate FinalizeRequest.mime_type in finalize_brain_dump()
against ALLOWED_AUDIO_MIME_TYPES before invoking service.finalize_voice_dump().
Reject unsupported MIME types using the route’s existing validation/error
response pattern, while preserving the current finalize flow for allowed audio
types.

In
`@autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py`:
- Around line 386-397: Stub the intro LLM generation used by finalize() in the
onboarding route tests, targeting backend.util.clients.get_openai_client or
intro.client. Configure the stub to return a deterministic greeting and prompt
set, then update test_intro_returns_greeting_and_prompts_before_completion to
assert those values while preserving the existing response checks.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/service.py`:
- Around line 199-210: Move the recommend.generate_recommendations call into the
existing try block in the background recommendation flow, keeping the database
update and serialization there as well so any exception is caught by the
existing logger.warning handler and reported with the user_id.

In
`@autogpt_platform/backend/migrations/20260801100000_add_onboarding_brain_dump/migration.sql`:
- Around line 43-45: Remove the redundant OnboardingBrainDump_userId_idx
creation from the migration, keeping the unique OnboardingBrainDump_userId_key
index and the existing userId uniqueness configuration unchanged.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.tsx:
- Line 18: Update the GlassOrb component’s outer wrapper so aria-hidden no
longer applies to the subtree rendering children. Keep the attribute only on the
decorative SVG/filter wrapper and visual layers, or remove it when the inner
content is meaningful, while preserving children accessibility.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/OrbFrame.tsx:
- Around line 97-104: Add visible keyboard focus styling to the always-mounted
button in OrbFrame by extending its className with appropriate focus-visible
utilities, while preserving the existing positioning and rounded shape styles.
Ensure the primary recording control has a clear focus indicator when focused
via keyboard.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts:
- Around line 115-118: Guard both socket.onmessage handlers against non-string
data and malformed JSON: in useDeepgramLiveCaptions.ts lines 115-118 and
useScribeLiveCaptions.ts lines 122-125, validate message.data is a string, parse
it inside try/catch, and return early when parsing fails. Keep valid Results
processing unchanged; do not require the optional helper extraction.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts:
- Around line 110-116: Update the recovery metadata write in stop to derive
durationSecs from startedAtRef.current and the current time rather than the
captured elapsedSeconds value. Ensure both manual stops and the
HARD_STOP_SECONDS path triggered by tick persist the actual elapsed duration.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts:
- Around line 261-277: Update handleDownloadRecording to append the generated
anchor to the document before clicking it, then defer URL.revokeObjectURL until
the download has had time to start rather than revoking it in the same tick.
Preserve the existing recording download behavior and cleanup the temporary
anchor as part of the deferred cleanup.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx:
- Around line 127-131: Update handleCopyTranscript to catch clipboard write
failures, including unavailable or rejected navigator.clipboard writes, so they
do not become unhandled errors. Only set isCopied to true and start the reset
timeout after a successful write; preserve the existing success feedback timing.
- Around line 105-111: Update introRevealTimings and its consumers so
composerStart is not left unused: either apply it to EmptySession’s composer
entrance timing alongside the !intro.isAwaitingGreeting gate, or remove
composerStart from the returned timing object and related destructuring. Keep
promptsStart and footerStart behavior unchanged.

---

Nitpick comments:
In `@autogpt_platform/backend/backend/api/features/onboarding_dump/intro.py`:
- Around line 262-273: Update both return tuples in the transcript response
logic to wrap each implicitly concatenated multi-line string in explicit
parentheses, including the branches for empty and non-empty transcripts.
Preserve the existing messages and fallback_prompts() values while resolving
Ruff ISC004 without adding noqa directives.
- Around line 28-34: Update the module-level greeting model and Langfuse prompt
name configuration near _MODEL and LANGFUSE_PROMPT_NAME to read their values
from the existing Settings instance or configuration fields, rather than
os.environ. Reuse the established Settings access pattern used for Langfuse
keys, preserving the current defaults and keeping these settings within the
dedicated configuration mechanism.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/models.py`:
- Around line 85-101: Update IntroCardResponse.path to use the typing Literal
type constrained to "A" and "B", preserving the documented contract and causing
invalid values to fail validation during model construction.

In
`@autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py`:
- Around line 49-85: Update the fake DumpStore methods, especially start_dump,
get_dump, update_dump, and mark_failed, to record the received user_id and
enforce that calls use the same user scope. Add a single assertion in the test
against the mocked JWT subject so incorrect or missing identifiers fail while
preserving the existing row behavior.
- Around line 123-132: Retarget the five patches in the dumps fixture at
routes.py’s imported/used helper symbols rather than the definitions in the db
module. Likewise, update the six storage_mocks patches to target the symbols
used by service.py, following the extraction fixture’s usage-site pattern; apply
these changes at routes_test.py lines 123-132 and 135-148.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py`:
- Around line 95-109: Remove the non-atomic buffered_size precheck in the upload
flow and enforce the limit using the cumulative value returned by
storage.append_part. If that value exceeds MAX_RECORDING_BYTES, discard or
remove the just-appended part and raise the existing 413 HTTPException; preserve
normal continuation for uploads within the limit.

In
`@autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py`:
- Around line 133-141: Add a test near the existing finalize_voice_dump tests
that invokes the finalize_voice helper twice with the same RECORDING_ID, runs
each background task flow, and asserts the transcription mock was awaited
exactly once. Ensure the test verifies the second finalization preserves the
completed recording rather than triggering duplicate transcription.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/service.py`:
- Around line 101-113: Replace the isinstance-based dispatch in the
transcription error handler with dedicated except clauses: handle
transcription.TranscriptionUnavailableError by marking the user failed with
transcription_unavailable, and handle other Exceptions with
transcription_failed. Preserve the existing warning log and FinalizeResponse
behavior for each path, avoiding isinstance for type dispatch.
- Around line 44-140: The finalize_voice_dump function exceeds the function-size
guideline and onboarding_dump/service.py is oversized. Extract the audio
assembly, safety scan, persistence, and buffer cleanup into an _store_audio
helper, and extract transcription, error mapping, failure persistence, and
success logging into a _transcribe_or_fail helper; keep finalize_voice_dump
focused on orchestration and background scheduling. Move the intro-card read
path, including get_intro_card and _stored_prompts, into a dedicated module so
the service file stays within the size guideline.

In `@autogpt_platform/backend/backend/api/features/onboarding_dump/storage.py`:
- Line 17: Update the typing imports in storage.py to import Awaitable from
collections.abc instead of typing, while preserving the existing Any and cast
imports and all current usages.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/__tests__/brain-dump.test.tsx:
- Around line 304-306: Remove the redundant afterEach cleanup block from the
brain-dump test while retaining the cleanup import for the explicit mid-test
cleanup later in the file. Keep the globally configured Testing Library teardown
unchanged.

In `@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/page.tsx:
- Line 7: Replace the static BrainDumpStep import and its onboarding usage with
a next/dynamic lazy load, ensuring the component is only fetched when the
BrainDump feature flag enables that step. Preserve the existing onboarding
behavior and rendering for enabled users.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/__tests__/PreparingStep.test.tsx:
- Around line 32-34: Remove the redundant afterEach cleanup hook from
PreparingStep.test.tsx and delete its cleanup import, relying on the global
cleanup configured in vitest.setup.tsx.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useUploadQueue.test.ts:
- Around line 33-36: Update the useUploadQueue test suite to import afterEach
from vitest and register afterEach(() => vi.useRealTimers()) alongside the
existing beforeEach hook. Remove the trailing vi.useRealTimers() calls from both
timer-based tests so real timers are restored even when assertions fail.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/BrainDumpStep.tsx:
- Around line 218-251: Extract the self-contained OrbCaption component into
components/OrbCaption.tsx, defining its props via a local type Props and
preserving its existing caption behavior and imports. Move the pure toOrbScreen
mapper into helpers.ts, then update BrainDumpStep.tsx to import both symbols and
remove their inline definitions, keeping all behavior unchanged.
- Around line 59-65: Replace the raw “Skip for now” button in BrainDumpStep.tsx
lines 59-65 with the design-system Button using variant="ghost" and
size="small", matching the existing Button usage in that component. Apply the
same replacement to the “Start over” button in RecoveryPrompt.tsx lines 34-40,
preserving each action handler and label.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.module.css:
- Around line 7-33: Update the GlassOrb animation styles, including the spinner
and blob animation rules, with a prefers-reduced-motion media query that
disables all continuous orb animations while preserving their static visual
styling.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.tsx:
- Around line 19-36: Update the GlassOrb component to generate a unique SVG
filter id with React’s useId() and use that id both on the filter element and
its corresponding url(#...) reference, replacing the fixed glass-orb-refraction
id while preserving the existing distortion behavior.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassSurface.tsx:
- Line 28: Define a non-exported type Props for the GlassSurface component
props, containing the existing params: GlassParams field, and update
GlassSurface to use Props instead of the anonymous inline type.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/MicButton.tsx:
- Line 9: Move the AudioWaveform component out of the copilot ChatInput
internals into the shared src/components design-system location, then update
MicButton to import it from that stable shared path. Adjust any other references
or exports required by the move while preserving AudioWaveform’s existing
behavior.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/TypedFallback.tsx:
- Around line 17-31: Add a textarea keyboard handler to the Input in
TypedFallback that invokes onSubmit when Cmd/Ctrl+Enter is pressed and
value.trim() is non-empty; otherwise preserve normal key behavior and the
existing button submission flow.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/components/useLiveCaptions.ts:
- Line 71: Remove the unused recognitionRef declaration and all assignments or
clears to it in the live-captions hook. Keep the existing local recognition
binding and cleanup behavior unchanged.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts:
- Around line 130-142: Update clearRecording to delete all recording parts
within one readwrite transaction on PARTS_STORE, using a cursor over the
recordingId index to remove matching records instead of calling runTransaction
once per part. Preserve the subsequent META_STORE deletion for the recording
metadata.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts:
- Around line 47-61: Update the mount-only recovery effect in useBrainDumpStep
and remove the eslint suppression. Make recorder.findRecoverable stable by
storing the recorder lookup in a ref or exposing it outside the render-scoped
hook object, then list the resulting stable dependencies in the effect array
while preserving the existing one-time recovery behavior.
- Around line 21-306: Split useBrainDumpStep into smaller modules under
BrainDumpStep/ so the main hook is under approximately 200 lines. Extract the
recovery workflow centered on handleResumeRecovered, handleDiscardRecovered,
handleTypeInsteadOfRecovered, and dropRecoverable into a dedicated hook or
helper, and move handleDownloadRecording into a separate download helper while
preserving the hook’s existing behavior and returned handlers.

In `@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/store.ts:
- Around line 125-138: Update the onboarding store’s reset() method to
explicitly set isStepBusy to false alongside the other reset fields, ensuring
reset clears any busy state and restores Back-button visibility.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/useOnboardingPage.ts:
- Around line 95-104: Optionally extract the repeated ref-based flag snapshot
logic from the payment and brain-dump sections into a shared useFlagSnapshot
helper hook accepting the flag and areFlagsReady. Update both call sites to use
the helper while preserving the existing snapshot timing and false fallback
behavior.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/ChatInput/ChatInput.tsx:
- Around line 79-94: Extract composer-tray state and handlers from ChatInput
into a dedicated useChatInputComposer hook, including mode/model/dry-run state,
handleToggleMode, handleToggleModel, handleToggleDryRun, useOnboardingMicGlow,
and hasTrayItems. Update ChatInput to consume the hook’s returned values while
preserving existing behavior, leaving the component focused on rendering.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/EmptySession/EmptySession.tsx:
- Around line 18-22: Move GlassOrb and GlassSurface from the onboarding wizard’s
BrainDumpStep component tree into a shared visual/components location, then
update EmptySession and OnboardingIntroCard imports to use the shared module.
Preserve the existing exports and behavior while removing both Copilot
dependencies on onboarding-wizard internals.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx:
- Around line 67-74: Replace the Props interface in OnboardingIntroCard with a
non-exported type Props = { ... } declaration, preserving all existing fields
and their types.
- Around line 44-111: Extract PROMPT_ICONS, SMALL_ORB_PARAMS, ORB_PURPLE, the
reveal timing constants, and introRevealTimings from OnboardingIntroCard into a
colocated helpers.ts. Export the moved symbols and update OnboardingIntroCard to
import and use them, preserving their existing values and behavior.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingWelcomeDialog/ConnectMethodView.tsx:
- Around line 108-191: Update the wrapping div containing the method map to use
role="radiogroup", and update each method-selection button in the map to use
role="radio" with aria-checked bound to isSelected so assistive technologies
announce the current choice.

In
`@autogpt_platform/frontend/src/app/`(platform)/copilot/components/OnboardingWelcomeDialog/ConnectToolsPanel.tsx:
- Around line 117-130: Replace the raw input in the search field within
ConnectToolsPanel with the design-system Input atom imported from
"`@/components/atoms/Input/Input`". Preserve the existing query value, onChange
handler, placeholder, accessibility label, and search-field behavior while
relying on Input for its styling instead of duplicating Tailwind input classes.

In `@autogpt_platform/frontend/src/app/`(platform)/dev/brain-dump-debug/page.tsx:
- Around line 1-73: Add a Vitest/RTL/MSW integration test under __tests__ for
BrainDumpDebugPage, covering notFound behavior in production, notFound when
ONBOARDING_BRAIN_DUMP is disabled, and the fully loaded enabled state with
rendered panels and the user-scoped recording download link. Mock the
feature-flag and page hooks as needed, and verify the finalize action invokes
the real mutation path through the rendered UI.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f766752-221a-4de6-aec1-2b89979a225a

📥 Commits

Reviewing files that changed from the base of the PR and between 994598b and 0759e0f.

📒 Files selected for processing (108)
  • autogpt_platform/backend/.env.default
  • autogpt_platform/backend/backend/api/features/onboarding_dump/EVAL.md
  • autogpt_platform/backend/backend/api/features/onboarding_dump/__init__.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/brain_dump_eval.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/brain_dump_eval_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/brain_dump_wer.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/db.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/intro.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/models.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/prompts.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/recommend.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/recommend_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/routes_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/storage.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription_test.py
  • autogpt_platform/backend/backend/api/rest_api.py
  • autogpt_platform/backend/backend/data/onboarding.py
  • autogpt_platform/backend/backend/util/feature_flag.py
  • autogpt_platform/backend/migrations/20260801100000_add_onboarding_brain_dump/migration.sql
  • autogpt_platform/backend/migrations/20260801130000_add_brain_dump_greeting/migration.sql
  • autogpt_platform/backend/migrations/20260802090000_add_brain_dump_recommended_providers/migration.sql
  • autogpt_platform/backend/migrations/20260802120000_add_capability_cards_step/migration.sql
  • autogpt_platform/backend/pyproject.toml
  • autogpt_platform/backend/schema.prisma
  • autogpt_platform/frontend/.env.default
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/brain-dump.test.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/__tests__/page.test.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/page.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/BrainDumpStep.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useUploadQueue.test.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/ElapsedTime.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/FailureState.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.module.css
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassOrb.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/GlassOrb/GlassSurface.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/LiveCaptions.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/MicButton.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/OrbFrame.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/RecordingStatus.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/RecoveryPrompt.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/Reveal.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/SwapFade.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/TapHint.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/TypedFallback.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useLiveCaptions.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useScribeLiveCaptions.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/helpers.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useUploadQueue.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/PreparingStep.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PreparingStep.test.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/usePreparingStep.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/store.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/useOnboardingPage.ts
  • autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/ChatInput.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ComposerTray.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/DryRunToggleButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/RecordingButton.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ToggleChip.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useOnboardingMicGlow.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/useVoiceRecording.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/OnboardingIntroCard.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectMethodView.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectProviderRow.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/ConnectToolsPanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/GlassPixelBackdrop.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/InlineApiKeyForm.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/useConnectToolsPanel.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/DebugPanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/RecordingStatePanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/ServerStatusPanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/TimingPanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/TranscriptPanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/components/UploadQueuePanel.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/helpers.ts
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/page.tsx
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/useBrainDumpDebugPage.ts
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/useDebugFinalize.ts
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/useRecordingSnapshot.ts
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/useStatusTimeline.ts
  • autogpt_platform/frontend/src/app/(platform)/dev/brain-dump-debug/waterfall.ts
  • autogpt_platform/frontend/src/app/api/openapi.json
  • autogpt_platform/frontend/src/app/api/transcribe/live-session/route.ts
  • autogpt_platform/frontend/src/components/atoms/FadeIn/FadeIn.tsx
  • autogpt_platform/frontend/src/components/atoms/Input/Input.tsx
  • autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx
  • autogpt_platform/frontend/src/components/ui/text-generate-effect.tsx
  • autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
  • autogpt_platform/frontend/src/mocks/mock-handlers.ts
  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/services/onboarding/brain-dump-analytics.ts
  • autogpt_platform/frontend/src/services/onboarding/brain-dump-handoff.ts

Comment thread autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py Outdated
Comment thread autogpt_platform/frontend/src/app/api/transcribe/live-session/route.ts Outdated
Comment thread autogpt_platform/frontend/src/app/api/transcribe/live-session/route.ts Outdated
Comment thread autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts Outdated
@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.84818% with 228 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.50%. Comparing base (2c97b67) to head (1be1dea).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #13764      +/-   ##
==========================================
+ Coverage   77.24%   77.50%   +0.25%     
==========================================
  Files        2775     2842      +67     
  Lines      211552   214766    +3214     
  Branches    20241    20558     +317     
==========================================
+ Hits       163418   166447    +3029     
- Misses      43652    43795     +143     
- Partials     4482     4524      +42     
Flag Coverage Δ
platform-backend 83.58% <92.00%> (+0.09%) ⬆️
platform-frontend 51.61% <94.66%> (+1.62%) ⬆️
platform-frontend-e2e 30.74% <15.91%> (-0.49%) ⬇️

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

Components Coverage Δ
Platform Backend 83.58% <92.00%> (+0.09%) ⬆️
Platform Frontend 55.02% <94.29%> (+1.43%) ⬆️
AutoGPT Libs ∅ <ø> (∅)
Classic AutoGPT 28.43% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
autogpt_platform/frontend/src/app/api/openapi.json (1)

14852-14865: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Enforce the finalized recording_id contract on upload.

Body_upload_brain_dump_part.recording_id has no minLength or maxLength, while FinalizeRequest.recording_id enforces minLength: 1, maxLength: 200. Upload Part 0 can therefore create Redis keys under onboarding:braindump:parts:{user_id}:{recording_id} and discard paths for IDs that finalize will reject, leaving parts on the server with no valid completion or cleanup path.

Add the same min_length=1, max_length=200 validation to upload_brain_dump_part.recording_id.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@autogpt_platform/frontend/src/app/api/openapi.json` around lines 14852 -
14865, Update the recording_id field in Body_upload_brain_dump_part to enforce
the same 1–200 character validation as FinalizeRequest, adding both minimum and
maximum length constraints while preserving its existing string type.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@autogpt_platform/frontend/src/app/api/openapi.json`:
- Around line 14852-14865: Update the recording_id field in
Body_upload_brain_dump_part to enforce the same 1–200 character validation as
FinalizeRequest, adding both minimum and maximum length constraints while
preserving its existing string type.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 93e39eca-69d6-4684-97aa-67011524ac68

📥 Commits

Reviewing files that changed from the base of the PR and between 0759e0f and 57c84c4.

📒 Files selected for processing (6)
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
  • autogpt_platform/frontend/src/app/api/openapi.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: integration_test
  • GitHub Check: end-to-end tests
  • GitHub Check: test (3.13)
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.12)
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (16)
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

Format frontend code using pnpm format

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI
No linter suppressors (// @ts-ignore``, // eslint-disable) — fix the actual issue

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.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/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.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

autogpt_platform/frontend/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components/handlers
No any types unless the value genuinely can be anything
Keep render functions and hooks under ~50 lines; extract named helpers or sub-components when they grow longer

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ following the pattern use{Method}{Version}{OperationName}, and regenerate with pnpm generate:api
Separate render logic from business logic using component.tsx + useComponent.ts + helpers.ts pattern, colocate state when possible and avoid creating large components, use sub-components in local /components folder
Use function declarations for components and handlers, use arrow functions only for callbacks
Do not use useCallback or useMemo unless asked to optimise a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Keep files under ~200 lines; extract sub-components or hooks into their own files when a file grows beyond this
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Always import the -Icon-suffixed alias from @phosphor-icons/react (e.g. TrashIcon, PlusIcon, SquareIcon) — bare exports are deprecated
Do not use useCallback or useMemo unless asked to optimize a given function
Never use src/components/__legacy__/* — use design system components from src/components/

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/**/*.{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/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
autogpt_platform/frontend/src/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.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/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/**/*.{tsx,jsx}

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

autogpt_platform/frontend/**/*.{tsx,jsx}: No dark: Tailwind classes — the design system handles dark mode
Use Next.js <Link> for internal navigation — never raw <a> tags
Use Tailwind CSS only for styling with design tokens and Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
autogpt_platform/frontend/src/**/components/**/*.{tsx,jsx}

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

Put sub-components in local components/ folder; component props should be type Props = { ... } (not exported) unless used outside the component

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
autogpt_platform/frontend/src/**/components/**/*.{ts,tsx}

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

Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

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

Avoid index and barrel files

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

No barrel files or index.ts re-exports in the frontend

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

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

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

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}: Use Vitest + RTL + MSW for integration tests as the primary testing approach (~90%, page-level), use Playwright for E2E critical flows, and use Storybook for design system components
Run frontend integration tests with pnpm test:unit (Vitest + RTL + MSW)

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/src/app/**/__tests__/**/*.{test,spec}.{ts,tsx}

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

Write integration tests in __tests__/ next to page.tsx using Vitest + RTL + MSW for new pages/features

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
autogpt_platform/frontend/src/**/__tests__/**/*.{test,spec}.{ts,tsx}

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

Use Orval-generated MSW handlers from @/app/api/__generated__/endpoints/{tag}/{tag}.msw.ts for API mocking

Files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
🧠 Learnings (13)
📚 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/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
📚 Learning: 2026-03-24T02:05:04.672Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12526
File: autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx:0-0
Timestamp: 2026-03-24T02:05:04.672Z
Learning: When gating React component logic on a React Query result (e.g., hooks like `useQuery` / `useGetV2GetCopilotUsage`), prefer destructuring and checking `isSuccess` (or aliasing it to a meaningful boolean like `isSuccess: hasUsage`) instead of relying on `!isLoading`. Reason: `isLoading` can be `false` in error/idle states where `data` may still be `undefined`, while `isSuccess` indicates the query completed successfully and `data` is populated.

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
📚 Learning: 2026-04-01T18:54:16.035Z
Learnt from: Bentlybro
Repo: Significant-Gravitas/AutoGPT PR: 12633
File: autogpt_platform/frontend/src/app/(platform)/library/components/AgentFilterMenu/AgentFilterMenu.tsx:3-10
Timestamp: 2026-04-01T18:54:16.035Z
Learning: In the frontend, the legacy Select component at `@/components/__legacy__/ui/select` is an intentional, codebase-wide visual-consistency pattern. During code reviews, do not flag or block PRs merely for continuing to use this legacy Select. If a migration to the newer design-system Select is desired, bundle it into a single dedicated cleanup/migration PR that updates all Select usages together (e.g., avoid piecemeal replacements).

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
📚 Learning: 2026-04-07T09:24:16.582Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12686
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx:1-19
Timestamp: 2026-04-07T09:24:16.582Z
Learning: In Significant-Gravitas/AutoGPT’s `autogpt_platform/frontend` (Vite + `vitejs/plugin-react` with the automatic JSX transform), do not flag usages of React types/components (e.g., `React.ReactNode`) in `.ts`/`.tsx` files as missing `React` imports. Since the React namespace is made available by the project’s TS/Vite setup, an explicit `import React from 'react'` or `import type { ReactNode } ...` is not required; only treat it as missing if typechecking (e.g., `pnpm types`) would actually fail.

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
📚 Learning: 2026-07-28T15:32:54.931Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13699
File: autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletFullPanel.tsx:0-0
Timestamp: 2026-07-28T15:32:54.931Z
Learning: In AutoGPT's frontend (autogpt_platform/frontend), prefer importing the non-legacy ScrollArea component from `@/components/ui/scroll-area` over `@/components/__legacy__/ui/scroll-area` for new or migrated code. The non-legacy component is a drop-in superset: it preserves the legacy component’s props and additionally supports the optional `showScrollToTop` prop—so reviewers should flag new legacy imports unless there’s a specific, documented reason they can’t use the non-legacy version.

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
📚 Learning: 2026-04-02T05:43:49.128Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12640
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/WelcomeStep.tsx:13-13
Timestamp: 2026-04-02T05:43:49.128Z
Learning: Do not flag `import { Question } from "phosphor-icons/react"` as an invalid import. `Question` is a valid named export from `phosphor-icons/react` (as reflected in the package’s generated `.d.ts` files and re-exports via `dist/index.d.ts`), so it should be treated as a supported named export during code reviews.

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
📚 Learning: 2026-04-13T13:11:07.445Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12764
File: autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsx:143-145
Timestamp: 2026-04-13T13:11:07.445Z
Learning: In `autogpt_platform/frontend`, do not flag direct interpolation of `executionID` UUID strings into URL query parameters (e.g., `activeItem=${executionID}` in JSX/Next links). If the value is a UUID string matching `[0-9a-f-]`, it contains no reserved URL characters, so additional `encodeURIComponent` or Next.js object-based `href` encoding is unnecessary. Only treat it as an encoding issue if the query-param value is not guaranteed to be UUID-formatted (i.e., may include characters outside `[0-9a-f-]`).

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
📚 Learning: 2026-04-15T22:49:06.896Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11235
File: autogpt_platform/frontend/src/app/(platform)/admin/diagnostics/components/ExecutionsTable.tsx:0-0
Timestamp: 2026-04-15T22:49:06.896Z
Learning: In the AutoGPT frontend (React Query + toast/ErrorCard patterns), do not require `Sentry.captureException` in React Query mutation `catch` blocks. React Query handles error propagation for mutation paths, so follow the established pattern: show toast notifications for mutation errors and use `ErrorCard` for render/fetch errors. Only add `Sentry.captureException` for truly manual/unexpected exception paths that are outside React Query’s control (e.g., standalone async utilities or event handlers not wired through React Query).

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
📚 Learning: 2026-07-03T04:19:11.799Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13474
File: autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx:38-38
Timestamp: 2026-07-03T04:19:11.799Z
Learning: When reviewing Tailwind usage in .tsx components, allow intentional raw hex color values if they exactly match the design-spec and there is no equivalent Tailwind design token/utility class available (e.g., a utility like `bg-zinc-50` may be a different shade than the required `#f9f9f9`). Do not flag these as "design-token violations" as long as the reviewer can confirm that an appropriate Tailwind token does not exist or would not match the exact color.

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx
📚 Learning: 2026-04-20T20:07:22.981Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11235
File: autogpt_platform/frontend/src/app/(platform)/admin/diagnostics/__tests__/ExecutionsTable.test.tsx:27-76
Timestamp: 2026-04-20T20:07:22.981Z
Learning: In this codebase, Orval-generated API modules under `src/app/api/__generated__/` are not committed to git and must be generated via `pnpm generate:api` (requires a running backend). In integration tests, it’s acceptable—and expected—to stub generated hooks/modules by mocking them with `vi.mock("`@/app/api/__generated__/endpoints/`{tag}/{tag}")`. Do not treat `vi.mock` of these generated hook modules as a violation of the MSW handler guideline, since the corresponding MSW handlers cannot be imported at test time when generated files are absent.

Applied to files:

  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts
📚 Learning: 2026-03-01T07:58:56.207Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12213
File: autogpt_platform/frontend/src/app/api/openapi.json:10030-10037
Timestamp: 2026-03-01T07:58:56.207Z
Learning: When a backend field represents sensitive data, use a secret type (e.g., Pydantic SecretStr with length constraints) so OpenAPI marks it as a password/writeOnly field. Apply this pattern to similar sensitive request fields across API schemas so generated TypeScript clients and docs treat them as secrets and do not mishandle sensitivity. Review all openapi.jsons where sensitive inputs are defined and replace plain strings with SecretStr-like semantics with appropriate minLength constraints.

Applied to files:

  • autogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-04-14T06:39:49.111Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12773
File: autogpt_platform/frontend/src/app/api/openapi.json:12803-12806
Timestamp: 2026-04-14T06:39:49.111Z
Learning: In OpenAPI specs, ensure the schema/message length caps for the StreamChatRequest.message and QueuePendingMessageRequest.message fields are set to the intended values: StreamChatRequest.message maxLength must be 64000 and QueuePendingMessageRequest.message maxLength must be 32000. Keep QueuePendingMessageRequest.message consistent with PendingMessage.content, and ensure the pending (queue) ceiling never exceeds the stream ceiling because both ultimately feed the same LLM context window. Update any legacy smaller limits (e.g., 4000/16000) to these newer ceilings.

Applied to files:

  • autogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-03-07T07:43:09.871Z
Learnt from: kcze
Repo: Significant-Gravitas/AutoGPT PR: 12328
File: autogpt_platform/frontend/src/app/api/openapi.json:1116-1118
Timestamp: 2026-03-07T07:43:09.871Z
Learning: For autogpt_platform/frontend/src/app/api/openapi.json, preserve the existing behavior: HTTPBearerJWT is declared at the router level with Depends(auth.get_user_id) returning None for unauthenticated users; treat as optional auth. Do not change per-operation security descriptions unless you plan a repo-wide OpenAPI update. If you change this file, prefer clarifying operation descriptions rather than altering security requirements.

Applied to files:

  • autogpt_platform/frontend/src/app/api/openapi.json
🔇 Additional comments (2)
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/PrivacyNote.tsx (1)

1-21: LGTM!

autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/__tests__/useBrainDumpRecorder.test.ts (1)

1-111: LGTM!

`start_dump` unconditionally reset the row to `recording_uploaded`, so
two paths could knock an in-flight take back to the start of the
pipeline:

- recovery replays every part on disk, part 0 included, and part 0 is
  what triggers `start_dump`. Navigating back to onboarding while a
  transcription was running reset it underneath.
- a repeated typed finalize did the same, and queued a second extraction
  and greeting on top of the pair already running.

`start_dump` now returns an in-flight take untouched when the recording
id matches. `failed` is deliberately not in that set — retrying a failed
take must still reset it — and a different recording id is a genuinely
new take, so re-recording is unaffected. `finalize_typed_dump` gains the
same early return the voice path already had.

Adds db_test.py plus a typed-finalize idempotency test; 5 of the new
cases fail against the previous code.

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py`:
- Around line 213-238: Update finalize_typed_dump to claim the recording via an
atomic conditional database update from its initial eligible status to
transcribed, and continue queuing completion and recommendation work only when
that claim succeeds. Add a barrier-based concurrent test that starts two
finalizations before either claim completes, then assert exactly one call queues
the task pair and the other is a no-op.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcff1080-8725-40d6-b781-52069c9c5631

📥 Commits

Reviewing files that changed from the base of the PR and between 57c84c4 and 537179a.

📒 Files selected for processing (4)
  • autogpt_platform/backend/backend/api/features/onboarding_dump/db.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • autogpt_platform/backend/backend/api/features/onboarding_dump/db.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
📜 Review details
⏰ Context from checks skipped due to timeout. (11)
  • GitHub Check: lint
  • GitHub Check: integration_test
  • GitHub Check: check API types
  • GitHub Check: test (3.12)
  • GitHub Check: type-check (3.11)
  • GitHub Check: test (3.11)
  • GitHub Check: test (3.13)
  • GitHub Check: type-check (3.13)
  • GitHub Check: Seer Code Review
  • GitHub Check: end-to-end tests
  • GitHub Check: Check PR Status
🧰 Additional context used
📓 Path-based instructions (5)
autogpt_platform/backend/**/*.py

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

autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development

autogpt_platform/backend/**/*.py: Use poetry run ... command for executing Python package dependencies
Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl
Use absolute imports with from backend.module import ... for cross-package imports; single-dot relative imports are acceptable for sibling modules within the same package; avoid double-dot relative imports
Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead
Use Pydantic models over dataclass/namedtuple/dict for structured data
Do not use linter suppressors — no # type: ignore, # noqa, # pyright: ignore; fix the type/code instead
Prefer list comprehensions over manual loop-and-append patterns
Use early return with guard clauses first to avoid deep nesting
Use %s for deferred interpolation in debug log statements for efficiency; use f-strings elsewhere for readability (e.g., logger.debug("Processing %s items", count) vs logger.info(f"Processing {count} items"))
Sanitize error paths by using os.path.basename() in error messages to avoid leaking directory structure
Be aware of TOCTOU (Time-Of-Check-Time-Of-Use) issues — avoid check-then-act patterns for file access and credit charging
Use transaction=True for Redis pipelines to ensure atomicity on multi-step operations
Use max(0, value) guards for computed values that should never be negative
Keep files under ~300 lines; if a file grows beyond this, split by responsibility (extract helpers, models, or a sub-module into a new file)
Keep functions under ~40 lines; extract named helpers when a function grows longer
...

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
autogpt_platform/backend/backend/api/features/**/*.py

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

Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
autogpt_platform/{backend,autogpt_libs}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Format Python code with poetry run format

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
autogpt_platform/backend/**/api/**/*.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

autogpt_platform/backend/**/api/**/*.py: Use Security() instead of Depends() for authentication dependencies to get proper OpenAPI security specification
Follow SSE (Server-Sent Events) protocol: use data: lines for frontend-parsed events (must match Zod schema) and : comment lines for heartbeats/status

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
autogpt_platform/backend/**/*_test.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

autogpt_platform/backend/**/*_test.py: Use pytest with snapshot testing for API responses
Colocate test files with source files using *_test.py naming convention
Mock at boundaries — mock where the symbol is used, not where it's defined; after refactoring, update mock targets to match new module paths
Use AsyncMock from unittest.mock for async functions in tests
When writing tests, use Test-Driven Development (TDD): write failing tests marked with @pytest.mark.xfail before implementation, then remove the marker once the implementation is complete
When creating snapshots in tests, use poetry run pytest path/to/test.py --snapshot-update; always review snapshot changes with git diff before committing

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
🧠 Learnings (12)
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-03-05T15:42:08.207Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12297
File: .claude/skills/backend-check/SKILL.md:14-16
Timestamp: 2026-03-05T15:42:08.207Z
Learning: In Python files under autogpt_platform/backend (recursively), rely on poetry run format to perform formatting (Black + isort) and linting (ruff). Do not run poetry run lint as a separate step after poetry run format, since format already includes linting checks.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-03-16T16:35:40.236Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12440
File: autogpt_platform/backend/backend/api/features/workflow_import.py:54-63
Timestamp: 2026-03-16T16:35:40.236Z
Learning: Avoid using the word 'competitor' in public-facing identifiers and text. Use neutral naming for API paths, model names, function names, and UI text. Examples: rename 'CompetitorFormat' to 'SourcePlatform', 'convert_competitor_workflow' to 'convert_workflow', '/competitor-workflow' to '/workflow'. Apply this guideline to files under autogpt_platform/backend and autogpt_platform/frontend.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-03-31T15:37:38.626Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/backend/backend/copilot/tools/agent_generator/fixer.py:37-47
Timestamp: 2026-03-31T15:37:38.626Z
Learning: When validating/constructing Anthropic API model IDs in Significant-Gravitas/AutoGPT, allow the hyphen-separated Claude Opus 4.6 model ID `claude-opus-4-6` (it corresponds to `LlmModel.CLAUDE_4_6_OPUS` in `autogpt_platform/backend/backend/blocks/llm.py`). Do NOT require the dot-separated form in Anthropic contexts. Only OpenRouter routing variants should use the dot separator (e.g., `anthropic/claude-opus-4.6`); `claude-opus-4-6` should be treated as correct when passed to Anthropic, and flagged only if it’s used in the OpenRouter path where the dot form is expected.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-04-15T02:43:36.890Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12780
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-15T02:43:36.890Z
Learning: When reviewing Python exception handlers, do not flag `isinstance(e, X)` checks as dead/unreachable if the caught exception `X` is a subclass of the exception type being handled. For example, if `X` (e.g., `VirusScanError`) inherits from `ValueError` (directly or via an intermediate class) and it can be raised within an `except ValueError:` block, then `isinstance(e, X)` inside that handler is reachable and should not be treated as dead code.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-05-23T05:29:43.085Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13200
File: autogpt_platform/backend/backend/executor/scheduler.py:590-593
Timestamp: 2026-05-23T05:29:43.085Z
Learning: When reviewing Python code that uses Pydantic discriminated/tagged unions (e.g., `Annotated[Union[...], Field(discriminator="kind")]`), recognize that using `isinstance(x, SomeVariantInfo)` to narrow the union is an intentional and correct runtime guard and should also enable static type narrowing in tools like Pyright. Do not recommend replacing such `isinstance`-based narrowing with `cast(...)` when the check already proves the variant at runtime.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-04-22T11:46:04.431Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/config.py:0-0
Timestamp: 2026-04-22T11:46:04.431Z
Learning: Do not flag the Claude Sonnet 4.6 model ID as incorrect when it uses the project’s established hyphenated convention: `anthropic/claude-sonnet-4-6`. This hyphen form is the intentional, production convention and should be treated as valid (including in files like llm.py, blocks tests, reasoning.py, `_is_anthropic_model` tests, and config defaults). Note that OpenRouter also accepts the dot variant `anthropic/claude-sonnet-4.6`, so either form may be tolerated, but `anthropic/claude-sonnet-4-6` should be considered the standard to match project usage.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-04-22T11:46:12.892Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/baseline/service.py:322-332
Timestamp: 2026-04-22T11:46:12.892Z
Learning: In this codebase (Significant-Gravitas/AutoGPT), OpenRouter-routed Anthropic model IDs should use the hyphen-separated convention (e.g., `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-6`). Although OpenRouter may accept both hyphen and dot variants, treat the hyphen-separated form as the intended, correct codebase-wide convention and do not flag it as an error. Only flag the dot-separated variant (e.g., `anthropic/claude-sonnet-4.6`) as incorrect when reviewing/validating model ID strings for OpenRouter-routed Anthropic models.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-05-07T18:48:14.242Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13040
File: autogpt_platform/backend/backend/blocks/llm.py:0-0
Timestamp: 2026-05-07T18:48:14.242Z
Learning: In this repository, isort may split imports from the same module into separate blocks when some imports are aliased (e.g., `from module import X as Y`) and others are not. Preserve the two-block layout when it results from isort (such as keeping `from openai.types.chat import ChatCompletion as OpenAIChatCompletion` separate from non-aliased imports from `openai.types.chat`). Do not treat that split as a style issue during review; merging them into a single block can fail CI with `Imports are incorrectly sorted and/or formatted`.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-05-26T14:24:34.866Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13217
File: autogpt_platform/backend/backend/api/features/search/service.py:137-137
Timestamp: 2026-05-26T14:24:34.866Z
Learning: In the Significant-Gravitas/AutoGPT backend, treat `user_id` (an opaque UUID used only for correlation/tracing) as non-PII. Do not flag direct logging of `user_id` in `logger.warning`/`logger.info` statements as a PII exposure issue, as the established convention is to log `user_id` for tracing while reserving PII for fields like email or display name.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-06-11T19:39:10.493Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 13337
File: autogpt_platform/backend/backend/copilot/graphiti/reranker.py:0-0
Timestamp: 2026-06-11T19:39:10.493Z
Learning: In the Significant-Gravitas/AutoGPT Python backend, when calling the OpenAI Python client `chat.completions.create`, construct the `messages` payload using the concrete typed-dict variants from `openai.types.chat` (e.g., `ChatCompletionSystemMessageParam`, `ChatCompletionUserMessageParam`, etc.) rather than trying to instantiate `ChatCompletionMessageParam` directly. `ChatCompletionMessageParam` is a `Union` alias and is not constructible, so `ChatCompletionMessageParam(role=..., content=...)` should fail type checking. Build each message element with the appropriate concrete typed dict and then annotate the resulting list as `list[ChatCompletionMessageParam]` (e.g., `messages: list[ChatCompletionMessageParam] = [ChatCompletionSystemMessageParam(...), ...]`).

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service_test.py
📚 Learning: 2026-06-22T15:12:38.754Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 13309
File: autogpt_platform/backend/backend/api/features/library/db_test.py:0-0
Timestamp: 2026-06-22T15:12:38.754Z
Learning: When constructing Prisma model instances in Significant-Gravitas/AutoGPT Python backend test code (e.g., `prisma.models.AgentNode`) for fields typed as Prisma `Json`, pass JSON-typed values as JSON-serialized strings (e.g., `json.dumps(some_dict)`) rather than passing a plain Python dict. Prisma/Pydantic expects the `Json` constructor input to be a string (`JSON input should be string` otherwise); the model will deserialize internally so the resulting attribute becomes a dict. If the field is annotated as `Json` but the constructor requires a `str`, keep the existing `# type: ignore` (or an equivalent, narrowly scoped typing adjustment) to satisfy the type checker without changing runtime behavior.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py
🔇 Additional comments (1)
autogpt_platform/backend/backend/api/features/onboarding_dump/db_test.py (1)

1-101: LGTM!

Backend
- validate `recording_id` against `[A-Za-z0-9_-]{1,64}` at the model
  level and reuse it on the multipart route: it is concatenated into a
  cloud-storage object key and a Redis key, so a separator in it reached
  outside the caller's own prefix
- add `transcribing` to the finalize idempotency guard. The part buffer
  is dropped as soon as the audio is stored, so a retry arriving while a
  long recording was still transcribing assembled nothing and marked a
  good take `no_audio_received`
- move the multi-megabyte reads and writes in `split_audio` off the
  event loop
- `Duration: N/A` from ffmpeg (an unmuxed MediaRecorder stream) raised a
  bare ValueError instead of TranscriptionFailedError

Frontend
- recordingStore: resolve writes on transaction commit rather than
  `request.onsuccess`, which fires before it — an abort afterwards threw
  away a chunk already reported as persisted, which is exactly what the
  zero-loss guarantee promises not to do. Close the connection on abort
  and error too, and fail rather than hang when an upgrade is blocked by
  another tab
- add `getMetaById` and use it when finalizing: `getMeta()` answers
  "what should we offer to recover", which in a second tab is a
  different take, so the wrong row was marked finalized
- `markPartUploaded` rejection no longer takes out `flush()` and
  `enqueue()`; the part is already on the server by then
- `handleRetry` takes the duration from the recorder ref, matching
  `handleDone`
- `handleSubmitTyped` checks the finalize response instead of advancing
  on a failed pipeline
- both caption hooks only report "live" once the audio graph starts, so
  a throwing AudioContext falls back to the browser engine
- live-session route: 5s timeout on the provider calls plus a catch, so
  a stalled provider degrades instead of holding the request open
- welcome dialog: toast on a failed `completeStep`, plus `role="dialog"`,
  `aria-modal`, initial focus and Escape-to-close
- gate the intro query on the flag; the endpoint 404s without it
- revert the unrelated `AUTOGPT_NEW_LAYOUT` default flip

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py`:
- Around line 204-213: Update the duration parsing logic around the raw split
and return expression to validate the computed duration before returning it.
Reject non-finite values such as NaN and infinities, as well as negative
durations, and route them through the existing failure path instead of returning
them; preserve valid non-negative finite durations.

In
`@autogpt_platform/frontend/src/app/`(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts:
- Around line 58-63: Update the IndexedDB open request handling around the
existing onblocked assignment to use a named blocked handler, and attach a
success handler that closes request.result if the open eventually succeeds after
being blocked. Preserve the rejection behavior in the named onblocked handler
while ensuring the late-opened database connection is closed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e55283fb-6566-4e4a-835f-c64d08fd7ae9

📥 Commits

Reviewing files that changed from the base of the PR and between 537179a and 709eefe.

📒 Files selected for processing (14)
  • autogpt_platform/backend/backend/api/features/onboarding_dump/models.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useScribeLiveCaptions.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useUploadQueue.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
  • autogpt_platform/frontend/src/app/api/transcribe/live-session/route.ts
  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/useOnboardingIntroCard.ts
  • autogpt_platform/frontend/src/app/api/transcribe/live-session/route.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpRecorder.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useUploadQueue.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useScribeLiveCaptions.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/components/useDeepgramLiveCaptions.ts
  • autogpt_platform/backend/backend/api/features/onboarding_dump/models.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/routes.py
  • autogpt_platform/backend/backend/api/features/onboarding_dump/service.py
  • autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingWelcomeDialog/OnboardingWelcomeDialog.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: check API types
  • GitHub Check: integration_test
  • GitHub Check: Seer Code Review
  • GitHub Check: end-to-end tests
  • GitHub Check: type-check (3.12)
  • GitHub Check: test (3.13)
  • GitHub Check: type-check (3.11)
  • GitHub Check: test (3.12)
  • GitHub Check: test (3.11)
  • GitHub Check: Check PR Status
🧰 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

Format frontend code using pnpm format

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI
No linter suppressors (// @ts-ignore``, // eslint-disable) — fix the actual issue

Files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.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/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.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

autogpt_platform/frontend/**/*.{ts,tsx}: Use function declarations (not arrow functions) for components/handlers
No any types unless the value genuinely can be anything
Keep render functions and hooks under ~50 lines; extract named helpers or sub-components when they grow longer

Files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Use generated API hooks from @/app/api/__generated__/endpoints/ following the pattern use{Method}{Version}{OperationName}, and regenerate with pnpm generate:api
Separate render logic from business logic using component.tsx + useComponent.ts + helpers.ts pattern, colocate state when possible and avoid creating large components, use sub-components in local /components folder
Use function declarations for components and handlers, use arrow functions only for callbacks
Do not use useCallback or useMemo unless asked to optimise a given function

autogpt_platform/frontend/src/**/*.{ts,tsx}: Keep files under ~200 lines; extract sub-components or hooks into their own files when a file grows beyond this
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Always import the -Icon-suffixed alias from @phosphor-icons/react (e.g. TrashIcon, PlusIcon, SquareIcon) — bare exports are deprecated
Do not use useCallback or useMemo unless asked to optimize a given function
Never use src/components/__legacy__/* — use design system components from src/components/

Files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
autogpt_platform/frontend/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

No barrel files or index.ts re-exports in the frontend

Files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
autogpt_platform/frontend/src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

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

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

Files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.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/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
autogpt_platform/frontend/src/**/*.{ts,tsx,js,jsx}

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

Avoid index and barrel files

Files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
autogpt_platform/backend/**/*.py

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

autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development

autogpt_platform/backend/**/*.py: Use poetry run ... command for executing Python package dependencies
Use top-level imports only — avoid local/inner imports except for lazy imports of heavy optional dependencies like openpyxl
Use absolute imports with from backend.module import ... for cross-package imports; single-dot relative imports are acceptable for sibling modules within the same package; avoid double-dot relative imports
Do not use duck typing — avoid hasattr/getattr/isinstance for type dispatch; use typed interfaces/unions/protocols instead
Use Pydantic models over dataclass/namedtuple/dict for structured data
Do not use linter suppressors — no # type: ignore, # noqa, # pyright: ignore; fix the type/code instead
Prefer list comprehensions over manual loop-and-append patterns
Use early return with guard clauses first to avoid deep nesting
Use %s for deferred interpolation in debug log statements for efficiency; use f-strings elsewhere for readability (e.g., logger.debug("Processing %s items", count) vs logger.info(f"Processing {count} items"))
Sanitize error paths by using os.path.basename() in error messages to avoid leaking directory structure
Be aware of TOCTOU (Time-Of-Check-Time-Of-Use) issues — avoid check-then-act patterns for file access and credit charging
Use transaction=True for Redis pipelines to ensure atomicity on multi-step operations
Use max(0, value) guards for computed values that should never be negative
Keep files under ~300 lines; if a file grows beyond this, split by responsibility (extract helpers, models, or a sub-module into a new file)
Keep functions under ~40 lines; extract named helpers when a function grows longer
...

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
autogpt_platform/backend/backend/api/features/**/*.py

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

Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
autogpt_platform/{backend,autogpt_libs}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Format Python code with poetry run format

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
autogpt_platform/backend/**/api/**/*.py

📄 CodeRabbit inference engine (autogpt_platform/backend/AGENTS.md)

autogpt_platform/backend/**/api/**/*.py: Use Security() instead of Depends() for authentication dependencies to get proper OpenAPI security specification
Follow SSE (Server-Sent Events) protocol: use data: lines for frontend-parsed events (must match Zod schema) and : comment lines for heartbeats/status

Files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
🧠 Learnings (15)
📚 Learning: 2026-04-01T18:54:16.035Z
Learnt from: Bentlybro
Repo: Significant-Gravitas/AutoGPT PR: 12633
File: autogpt_platform/frontend/src/app/(platform)/library/components/AgentFilterMenu/AgentFilterMenu.tsx:3-10
Timestamp: 2026-04-01T18:54:16.035Z
Learning: In the frontend, the legacy Select component at `@/components/__legacy__/ui/select` is an intentional, codebase-wide visual-consistency pattern. During code reviews, do not flag or block PRs merely for continuing to use this legacy Select. If a migration to the newer design-system Select is desired, bundle it into a single dedicated cleanup/migration PR that updates all Select usages together (e.g., avoid piecemeal replacements).

Applied to files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
📚 Learning: 2026-04-07T09:24:16.582Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12686
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/PainPointsStep.test.tsx:1-19
Timestamp: 2026-04-07T09:24:16.582Z
Learning: In Significant-Gravitas/AutoGPT’s `autogpt_platform/frontend` (Vite + `vitejs/plugin-react` with the automatic JSX transform), do not flag usages of React types/components (e.g., `React.ReactNode`) in `.ts`/`.tsx` files as missing `React` imports. Since the React namespace is made available by the project’s TS/Vite setup, an explicit `import React from 'react'` or `import type { ReactNode } ...` is not required; only treat it as missing if typechecking (e.g., `pnpm types`) would actually fail.

Applied to files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
📚 Learning: 2026-07-28T15:32:54.931Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13699
File: autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletFullPanel.tsx:0-0
Timestamp: 2026-07-28T15:32:54.931Z
Learning: In AutoGPT's frontend (autogpt_platform/frontend), prefer importing the non-legacy ScrollArea component from `@/components/ui/scroll-area` over `@/components/__legacy__/ui/scroll-area` for new or migrated code. The non-legacy component is a drop-in superset: it preserves the legacy component’s props and additionally supports the optional `showScrollToTop` prop—so reviewers should flag new legacy imports unless there’s a specific, documented reason they can’t use the non-legacy version.

Applied to files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
📚 Learning: 2026-04-02T05:43:49.128Z
Learnt from: 0ubbe
Repo: Significant-Gravitas/AutoGPT PR: 12640
File: autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/WelcomeStep.tsx:13-13
Timestamp: 2026-04-02T05:43:49.128Z
Learning: Do not flag `import { Question } from "phosphor-icons/react"` as an invalid import. `Question` is a valid named export from `phosphor-icons/react` (as reflected in the package’s generated `.d.ts` files and re-exports via `dist/index.d.ts`), so it should be treated as a supported named export during code reviews.

Applied to files:

  • autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts
  • autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts
📚 Learning: 2026-02-26T17:02:22.448Z
Learnt from: Pwuts
Repo: Significant-Gravitas/AutoGPT PR: 12211
File: .pre-commit-config.yaml:160-179
Timestamp: 2026-02-26T17:02:22.448Z
Learning: Keep the pre-commit hook pattern broad for autogpt_platform/backend to ensure OpenAPI schema changes are captured. Do not narrow to backend/api/ alone, since the generated schema depends on Pydantic models across multiple directories (backend/data/, backend/blocks/, backend/copilot/, backend/integrations/, backend/util/). Narrowing could miss schema changes and cause frontend type desynchronization.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-03-05T15:42:08.207Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12297
File: .claude/skills/backend-check/SKILL.md:14-16
Timestamp: 2026-03-05T15:42:08.207Z
Learning: In Python files under autogpt_platform/backend (recursively), rely on poetry run format to perform formatting (Black + isort) and linting (ruff). Do not run poetry run lint as a separate step after poetry run format, since format already includes linting checks.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-03-16T16:35:40.236Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12440
File: autogpt_platform/backend/backend/api/features/workflow_import.py:54-63
Timestamp: 2026-03-16T16:35:40.236Z
Learning: Avoid using the word 'competitor' in public-facing identifiers and text. Use neutral naming for API paths, model names, function names, and UI text. Examples: rename 'CompetitorFormat' to 'SourcePlatform', 'convert_competitor_workflow' to 'convert_workflow', '/competitor-workflow' to '/workflow'. Apply this guideline to files under autogpt_platform/backend and autogpt_platform/frontend.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-03-31T15:37:38.626Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12623
File: autogpt_platform/backend/backend/copilot/tools/agent_generator/fixer.py:37-47
Timestamp: 2026-03-31T15:37:38.626Z
Learning: When validating/constructing Anthropic API model IDs in Significant-Gravitas/AutoGPT, allow the hyphen-separated Claude Opus 4.6 model ID `claude-opus-4-6` (it corresponds to `LlmModel.CLAUDE_4_6_OPUS` in `autogpt_platform/backend/backend/blocks/llm.py`). Do NOT require the dot-separated form in Anthropic contexts. Only OpenRouter routing variants should use the dot separator (e.g., `anthropic/claude-opus-4.6`); `claude-opus-4-6` should be treated as correct when passed to Anthropic, and flagged only if it’s used in the OpenRouter path where the dot form is expected.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-04-15T02:43:36.890Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 12780
File: autogpt_platform/backend/backend/copilot/tools/workspace_files.py:0-0
Timestamp: 2026-04-15T02:43:36.890Z
Learning: When reviewing Python exception handlers, do not flag `isinstance(e, X)` checks as dead/unreachable if the caught exception `X` is a subclass of the exception type being handled. For example, if `X` (e.g., `VirusScanError`) inherits from `ValueError` (directly or via an intermediate class) and it can be raised within an `except ValueError:` block, then `isinstance(e, X)` inside that handler is reachable and should not be treated as dead code.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-05-23T05:29:43.085Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13200
File: autogpt_platform/backend/backend/executor/scheduler.py:590-593
Timestamp: 2026-05-23T05:29:43.085Z
Learning: When reviewing Python code that uses Pydantic discriminated/tagged unions (e.g., `Annotated[Union[...], Field(discriminator="kind")]`), recognize that using `isinstance(x, SomeVariantInfo)` to narrow the union is an intentional and correct runtime guard and should also enable static type narrowing in tools like Pyright. Do not recommend replacing such `isinstance`-based narrowing with `cast(...)` when the check already proves the variant at runtime.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-04-22T11:46:04.431Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/config.py:0-0
Timestamp: 2026-04-22T11:46:04.431Z
Learning: Do not flag the Claude Sonnet 4.6 model ID as incorrect when it uses the project’s established hyphenated convention: `anthropic/claude-sonnet-4-6`. This hyphen form is the intentional, production convention and should be treated as valid (including in files like llm.py, blocks tests, reasoning.py, `_is_anthropic_model` tests, and config defaults). Note that OpenRouter also accepts the dot variant `anthropic/claude-sonnet-4.6`, so either form may be tolerated, but `anthropic/claude-sonnet-4-6` should be considered the standard to match project usage.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-04-22T11:46:12.892Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 12881
File: autogpt_platform/backend/backend/copilot/baseline/service.py:322-332
Timestamp: 2026-04-22T11:46:12.892Z
Learning: In this codebase (Significant-Gravitas/AutoGPT), OpenRouter-routed Anthropic model IDs should use the hyphen-separated convention (e.g., `anthropic/claude-sonnet-4-6`, `anthropic/claude-opus-4-6`). Although OpenRouter may accept both hyphen and dot variants, treat the hyphen-separated form as the intended, correct codebase-wide convention and do not flag it as an error. Only flag the dot-separated variant (e.g., `anthropic/claude-sonnet-4.6`) as incorrect when reviewing/validating model ID strings for OpenRouter-routed Anthropic models.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-05-07T18:48:14.242Z
Learnt from: majdyz
Repo: Significant-Gravitas/AutoGPT PR: 13040
File: autogpt_platform/backend/backend/blocks/llm.py:0-0
Timestamp: 2026-05-07T18:48:14.242Z
Learning: In this repository, isort may split imports from the same module into separate blocks when some imports are aliased (e.g., `from module import X as Y`) and others are not. Preserve the two-block layout when it results from isort (such as keeping `from openai.types.chat import ChatCompletion as OpenAIChatCompletion` separate from non-aliased imports from `openai.types.chat`). Do not treat that split as a style issue during review; merging them into a single block can fail CI with `Imports are incorrectly sorted and/or formatted`.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-05-26T14:24:34.866Z
Learnt from: Abhi1992002
Repo: Significant-Gravitas/AutoGPT PR: 13217
File: autogpt_platform/backend/backend/api/features/search/service.py:137-137
Timestamp: 2026-05-26T14:24:34.866Z
Learning: In the Significant-Gravitas/AutoGPT backend, treat `user_id` (an opaque UUID used only for correlation/tracing) as non-PII. Do not flag direct logging of `user_id` in `logger.warning`/`logger.info` statements as a PII exposure issue, as the established convention is to log `user_id` for tracing while reserving PII for fields like email or display name.

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
📚 Learning: 2026-06-11T19:39:10.493Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 13337
File: autogpt_platform/backend/backend/copilot/graphiti/reranker.py:0-0
Timestamp: 2026-06-11T19:39:10.493Z
Learning: In the Significant-Gravitas/AutoGPT Python backend, when calling the OpenAI Python client `chat.completions.create`, construct the `messages` payload using the concrete typed-dict variants from `openai.types.chat` (e.g., `ChatCompletionSystemMessageParam`, `ChatCompletionUserMessageParam`, etc.) rather than trying to instantiate `ChatCompletionMessageParam` directly. `ChatCompletionMessageParam` is a `Union` alias and is not constructible, so `ChatCompletionMessageParam(role=..., content=...)` should fail type checking. Build each message element with the appropriate concrete typed dict and then annotate the resulting list as `list[ChatCompletionMessageParam]` (e.g., `messages: list[ChatCompletionMessageParam] = [ChatCompletionSystemMessageParam(...), ...]`).

Applied to files:

  • autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py
🪛 ast-grep (0.45.0)
autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py

[warning] 219-219: File path is request-/variable-derived; validate and normalize to prevent path traversal.
Context: open(path, "wb")
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(open-filename-from-request)


[warning] 224-224: File path is request-/variable-derived; validate and normalize to prevent path traversal.
Context: open(path, "rb")
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(open-filename-from-request)

🔇 Additional comments (5)
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/recordingStore.ts (1)

86-108: LGTM!

Also applies to: 154-165

autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/BrainDumpStep/useBrainDumpStep.ts (1)

10-15: LGTM!

Also applies to: 169-171, 189-200, 236-239

autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts (1)

63-63: LGTM!

autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py (2)

152-154: LGTM!

Also applies to: 178-178


219-226: LGTM!

Comment thread autogpt_platform/backend/backend/api/features/onboarding_dump/transcription.py Outdated
`routes_test.py` mocked STT and extraction but not the two LLM jobs the
background half of finalize kicks off. Both degrade rather than raise, so
the tests passed — while building a real client and reaching for the
network on every finalize.

Stubs `intro.generate_intro` and `recommend.generate_recommendations`,
which also gives the intro assertions a fixed greeting to match.
@Abhi1992002

Copy link
Copy Markdown
Member Author

Worked through the rest of the review — thanks, this was a genuinely good batch. Summary of the two items that were in the review body rather than inline, plus the one I'm pushing back on.

Stub the LLM generation in the intro route tests — fixed in 38d66ae

Correct, and worth doing. routes_test.py mocked STT and extraction but not intro.generate_intro / recommend.generate_recommendations. Both degrade instead of raising, so the tests passed while quietly constructing a real client and reaching for the network on every finalize. Added an autouse generation fixture; the suite is now offline and the intro assertions have a fixed greeting to match.

Enforce the finalized recording_id contract on upload — fixed in 709eefe

Already covered: recording_id is now a single model-level constrained type (^[A-Za-z0-9_-]{1,64}$) used by FinalizeRequest, and the multipart route reuses the same pattern via Form(pattern=...). Both sides now agree, so upload can no longer create Redis keys that finalize would reject.

Atomic claim for concurrent finalizes — not doing here

The check-then-act in finalize_typed_dump (and finalize_voice_dump, which has the same shape and predates this review) can let two simultaneous requests both pass the guard and queue two sets of background jobs.

It's a real race, but a narrow one: same user, two in-flight finalizes of the same take. The cost is duplicated LLM work and a last-write-wins greeting — not corrupted state, since every write is keyed on userId and idempotent in content. Converting it to an atomic conditional claim means restructuring both finalize paths around a status-guarded update_many, which I'd rather do as its own change with the concurrent barrier test you described than bolt onto an already-large PR.

Happy to do it here if you'd rather it not ship without one.

The rate-limiting note on live-session/route.ts has a reply on its own thread — short version: no rate-limit infra exists in these Next routes today, the route is auth-gated, and an in-memory counter in a serverless handler would look like protection without being any.

Comment thread autogpt_platform/frontend/src/app/(platform)/copilot/useCopilotPage.ts Outdated
A browser MediaRecorder stream is not muxed, so its header usually
carries no duration — and `Duration: N/A` was being treated as fatal for
exactly the long takes that reach `split_audio` in the first place.

`_probe_duration` is now best-effort and returns `None` for anything
unusable; `split_audio` falls back to the duration the browser measured
and only fails when neither is available.

Also rejects negative and non-finite durations. ffmpeg puts the sign on
the hours field and `int("-00")` is `0`, so `-00:00:01.00` previously
parsed as a positive second — caught by the new parametrized test.

Frontend: close a database that finishes opening after `onblocked`
already rejected, so the orphaned connection cannot block the next
upgrade.
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔄 Auto-redeploying: new commits pushed to a PR with an active deployment. Refreshing development environment for PR #13764.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🔄 Auto-redeploying: new commits pushed to a PR with an active deployment. Refreshing development environment for PR #13764.

@Abhi1992002

Copy link
Copy Markdown
Member Author

/reapprove

@Abhi1992002 Abhi1992002 closed this Aug 5, 2026
@github-project-automation github-project-automation Bot moved this to Done in Frontend Aug 5, 2026
@github-project-automation github-project-automation Bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban Aug 5, 2026
@Abhi1992002 Abhi1992002 reopened this Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🧹 Auto-undeploying: PR closed with active deployment. Cleaning up development environment for PR #13764.

@Abhi1992002

Copy link
Copy Markdown
Member Author

/reapprove

@github-actions github-actions 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.

Re-approved at the request of @Abhi1992002 (#13764 (comment))

@github-project-automation github-project-automation Bot moved this from ✅ Done to 👍🏼 Mergeable in AutoGPT development kanban Aug 5, 2026

@github-actions github-actions 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.

Re-approved at the request of @Abhi1992002 (#13764 (comment))

@Pwuts

Pwuts commented Aug 5, 2026

Copy link
Copy Markdown
Member

🧹 Preview Environment Cleaned Up

All resources for PR #13764 have been removed:

  • ☸️ Kubernetes namespace deleted
  • 🗃️ Preview branch database deleted

Cleanup completed successfully.

@Abhi1992002
Abhi1992002 enabled auto-merge August 5, 2026 11:06
@Abhi1992002
Abhi1992002 added this pull request to the merge queue Aug 5, 2026
Merged via the queue into dev with commit 6c5c9b4 Aug 5, 2026
69 checks passed
@Abhi1992002
Abhi1992002 deleted the abhi/onboarding-brain-dump branch August 5, 2026 11:25
@github-project-automation github-project-automation Bot moved this from 👍🏼 Mergeable to ✅ Done in AutoGPT development kanban Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🧹 Auto-undeploying: PR closed with active deployment. Cleaning up development environment for PR #13764.

@Pwuts

Pwuts commented Aug 5, 2026

Copy link
Copy Markdown
Member

🧹 Preview Environment Cleaned Up

All resources for PR #13764 have been removed:

  • ☸️ Kubernetes namespace deleted
  • 🗃️ Preview branch database deleted

Cleanup completed successfully.

ntindle added a commit to djpjronline-netizen/AutoGPT that referenced this pull request Aug 6, 2026
…meout (Significant-Gravitas#13780)

### Why / What / How

**Why.** Roughly half of all `dev` merge-queue enqueues were ejecting
PRs whose own checks were fully green, and the time-to-ejection
clustered hard around 17-22 minutes. Observed live on 2026-08-04/05:

| PR | enqueued | ejected | elapsed | PR's own checks | actual cause |
|---|---|---|---|---|---|
| Significant-Gravitas#13434 | 02:55 | 03:12 | ~17 min | all green | real test failures
(credit suite) |
| Significant-Gravitas#13434 | 04:07 (2nd) | 04:29 | ~22 min | all green | **20m job
timeout** |
| Significant-Gravitas#13743 | 18:33 | 18:54 | ~21 min | all green | **20m job timeout** |
| Significant-Gravitas#13575 | 19:05 | 19:26 | ~21 min | all green | **20m job timeout** |

(A fifth ejection, Significant-Gravitas#13764 at 03:21→03:42, was also the 20m timeout.)

**What.** The `test` job in `platform-backend-ci.yml` had
`timeout-minutes: 20`, which sits *below* the job's real p95 runtime.
GitHub reports a `timeout-minutes` kill as conclusion **`cancelled`**,
not `failure` — which is why this was invisible when reading the
merge-queue runs. `.github/workflows/scripts/check_actions_status.py`
treats any conclusion outside `success`/`skipped`/`neutral` as a
failure, so a timed-out `test` leg makes **`Check PR Status`** fail, and
GitHub ejects the PR from the merge queue.

**How.** Raise the cap so it guards against a genuinely hung job instead
of acting as a performance budget, and remove the single largest source
of setup variance from the job.

### Root-cause evidence

The three ~21-22 min ejections are all the same mechanism. GitHub's own
annotation on the cancelled job (`check-runs/92414409798/annotations`):

> `failure | The job has exceeded the maximum execution time of 20m0s`

Every timed-out leg died at **1217-1222s** — exactly the 20m0s cap:

| run | merge group | leg | job total | pytest step |
|---|---|---|---|---|
| 31037832829 | pr-13575 | `test (3.12)` | 1222s | 674s (killed) |
| 31035323338 | pr-13743 | `test (3.12)` | 1219s | killed |
| 30974258262 | pr-13434 | `test (3.12)` | 1217s | 1049s (killed) |
| 30972001003 | pr-13764 | `test (3.11)` | 1218s | 1054s (killed) |

These were healthy runs killed mid-suite, not hangs — the pytest step
was still actively emitting `PASSED` lines when the runner pulled the
plug.

Sibling matrix legs in the *same* runs passed comfortably, which is what
makes this look like a "flake":

- run 31037832829: `test (3.11)` 956s ✅, `test (3.13)` 975s ✅, `test
(3.12)` **1222s ❌**
- run 30972001003: `test (3.12)` 949s ✅, `test (3.13)` 898s ✅, `test
(3.11)` **1218s ❌**

Two independent variance sources push a leg over the line:

1. **The suite's own runtime.** ~10.6k tests run **serially** —
`pytest-xdist` is not a dependency, and the pytest invocation has no
`-n`. Measured across 126 `test` legs: pytest step p50 **787s**, max
**1093s**. Two of the four kills had entirely normal setup and were
killed purely because pytest itself was still running at 1049s/1054s.
2. **Checkout.** The `test` job is the only job using `fetch-depth: 0`
(it needs base-branch refs for the poetry.lock version comparison in
"Install Poetry"). On run 31037832829 that checkout took **429s** on the
leg that died, versus **27s** and **49s** on the two legs that passed —
same commit, same run.

Measured `test`-leg duration distribution (126 legs):

| event | n | p50 | p90 | max | killed at 20m |
|---|---|---|---|---|---|
| `pull_request` | 78 | 922s | 978s | 1218s | 2 (2.6%) |
| `merge_group` | 27 | 950s | 1056s | 1222s | 2 (7.4%) |
| `push` | 21 | 928s | 954s | 976s | 0 |

`merge_group` carries the heaviest tail. It is also the most damaging
place to fail: `merge_group` has no `paths:` filter (GitHub doesn't
support one), so **every** merge group runs the full backend suite even
for PRs that cannot touch the backend — Significant-Gravitas#13434 only changed
`platform-backend-ci.yml` and `TESTING.md`.

### Before / after

The meaningful rate for a `timeout-minutes` change is the share of legs
the cap kills, not a test pass rate:

| | legs exceeding the cap | per-leg | per enqueue (3-leg matrix) |
|---|---|---|---|
| **Before** (`20m`) | 4 / 126 | 3.2% | ~9.2%; on `merge_group` legs
alone 7.4% → **~20.6%** |
| **After** (`35m`) | **0 / 126** | 0% | 0% |

No leg in the sample has ever come within 14 minutes of the new cap. The
longest *completed* leg observed is 1218s (20.3m); the killed legs were
truncated, but extrapolating from their pytest progress they would have
landed at roughly 21-25m — still comfortably inside 35m, which retains
hang detection while leaving ~40% headroom over the worst realistic run.

### Not fixed here (separate issue)

The **Significant-Gravitas#13434 02:55 ejection was a genuinely different failure mode** and
is *not* addressed by this PR. `test (3.11)` (job 92194348225) failed
with 12 failures + 7 errors, all in the credit suite:

- First failure:
`credit_concurrency_test.py::test_concurrent_spends_insufficient_balance`
— `Expected 5 failures, got 4`. One of 10 concurrent `spend_credits`
coroutines raised something that was neither a success nor
`InsufficientBalanceError`.
- Then `test_race_condition_exact_balance` — `ValueError: User not found
with ID: exact-balance-…` for a user that had just been created
successfully.
- Then everything cascaded: ~8 minutes of `25P02 current transaction is
aborted, commands ignored until end of transaction block` across
`credit_concurrency_test.py`, `credit_integration_test.py`,
`credit_metadata_test.py` and `credit_refund_test.py`.

I deliberately have **not** shipped a speculative fix for this. My
initial hypothesis (a leaked interactive transaction in the spend path)
was **disproven**: `credit.py` opens no Prisma interactive transaction
anywhere — `_add_transaction` runs a single autocommit `query_raw` CTE
with `SELECT … FOR UPDATE`, so it structurally cannot leave a connection
in an aborted state. The real poisoning vector is still open, and
reproducing it needs the full stack (Postgres + 3-shard Redis cluster +
RabbitMQ + ClamAV + FalkorDB), which I could not stand up in this
environment. Fixing it on a guess risks introducing a *new* merge-queue
failure mode, which is exactly the problem this PR exists to remove.

### Changes 🏗️

- `.github/workflows/platform-backend-ci.yml`, `test` job:
- `timeout-minutes: 20` → **`35`**, with a comment recording the
measured runtime distribution so it doesn't get tightened back into the
failure zone.
- Added **`filter: blob:none`** to the `fetch-depth: 0` checkout. This
is a blobless partial clone: every ref stays reachable (so the
base-branch `poetry.lock` lookup in "Install Poetry" is unchanged) while
the blobs for all other branches are never downloaded. If the lazy fetch
ever fails, the existing `; true` fallback already degrades to the HEAD
poetry version, so the worst case is benign.

No configuration, service, port, secret or env changes. Behaviour of the
tests themselves is unchanged.

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [ ] I have tested my changes according to the test plan:
- [x] `python3 -c "yaml.safe_load(...)"` parses the workflow;
`jobs.test.timeout-minutes == 35` and the checkout `with:` block
resolves to `{fetch-depth: 0, filter: blob:none, submodules: true}`
- [x] `actionlint` on the changed workflow reports **5** shellcheck
findings — byte-identical to the count on `dev`, so no new lint issues
are introduced (all 5 are pre-existing, on lines this PR does not touch)
- [x] Confirmed `test` is the only job referencing `BASE_REF`, so
`fetch-depth: 0` is load-bearing there and nowhere else — it is
preserved, only made blobless
  - [x] All `pre-commit` hooks pass on the commit
- [ ] End-to-end confirmation that a `merge_group` run completes inside
35m and that the blobless checkout still resolves `git show
"origin/$BASE_BRANCH":./poetry.lock` — this can only be observed on CI,
and this PR's own `merge_group` run is the test

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Workflow-only timing and checkout tuning; no application code,
secrets, or test behavior changes.
> 
> **Overview**
> Raises the backend CI **`test`** job cap from **20m to 35m** and
documents why: serial ~10.6k-test runs often exceed 20m, GitHub marks
timeouts as **`cancelled`**, and merge-queue **`Check PR Status`**
treats that as failure—ejecting otherwise green PRs.
> 
> Adds **`filter: blob:none`** on the existing **`fetch-depth: 0`**
checkout so base-branch **`poetry.lock`** resolution for Install Poetry
stays the same while avoiding full blob downloads that sometimes
stretched checkout to hundreds of seconds on one matrix leg.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
2814a3a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---

### CI verification (this PR's own run 31045429279)

All three legs green, and both changes behave as intended:

| leg | result | job total | headroom to 35m | checkout | pytest |
|---|---|---|---|---|---|
| `test (3.11)` | ✅ success | 935s (15.6m) | 19.4m | **9s** | 795s |
| `test (3.12)` | ✅ success | 751s (12.5m) | 22.5m | **9s** | 624s |
| `test (3.13)` | ✅ success | 925s (15.4m) | 19.6m | **14s** | 773s |

**Checkout: 9s / 9s / 14s**, against **27s / 49s / 429s** on the
pre-change baseline (run 31037832829) — the 429s outlier that blew the
budget is gone.

The one real risk in the checkout change was whether a blobless clone
could still resolve the base branch's `poetry.lock`. Confirmed from the
`Install Poetry` step log:

```
Found Poetry version 2.2.1 in backend/poetry.lock
Found Poetry version 2.2.1 in backend/poetry.lock on dev
Using Poetry version 2.2.1
```

The lazy blob fetch resolves correctly and the base-branch comparison is
unchanged.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@sentry

sentry Bot commented Aug 6, 2026

Copy link
Copy Markdown

Issues attributed to commits in this pull request

This pull request was merged and Sentry observed the following issues:

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

Labels

platform/backend AutoGPT Platform - Back end platform/frontend AutoGPT Platform - Front end size/xl

Projects

Status: ✅ Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants