Skip to content

Adding nitro server layer support for vite apps#3251

Merged
azizmejri1 merged 20 commits into
dyad-sh:mainfrom
azizmejri1:nitro
Apr 30, 2026
Merged

Adding nitro server layer support for vite apps#3251
azizmejri1 merged 20 commits into
dyad-sh:mainfrom
azizmejri1:nitro

Conversation

@azizmejri1

Copy link
Copy Markdown
Collaborator

No description provided.

@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@socket-security

socket-security Bot commented Apr 21, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednext-themes@​0.3.01001006282100
Addedclass-variance-authority@​0.7.11001006880100
Added@​radix-ui/​react-label@​2.1.31001007091100
Added@​radix-ui/​react-separator@​1.1.31001007091100
Added@​radix-ui/​react-toggle@​1.1.31001007191100
Added@​radix-ui/​react-aspect-ratio@​1.1.31001007191100
Added@​radix-ui/​react-progress@​1.1.31001007291100
Updated@​radix-ui/​react-slot@​1.2.3 ⏡ 1.2.0100 +110072 +491100
Added@​radix-ui/​react-avatar@​1.1.41001007391100
Added@​radix-ui/​react-switch@​1.1.4991007391100
Addedtypescript-eslint@​8.30.11001007398100
Added@​radix-ui/​react-collapsible@​1.1.4991007392100
Added@​radix-ui/​react-checkbox@​1.1.5991007391100
Added@​radix-ui/​react-toggle-group@​1.1.3991007391100
Added@​radix-ui/​react-tabs@​1.1.4991007391100
Added@​radix-ui/​react-hover-card@​1.1.7991007491100
Added@​radix-ui/​react-radio-group@​1.2.4991007491100
Added@​radix-ui/​react-dropdown-menu@​2.1.7991007491100
Added@​radix-ui/​react-popover@​1.1.7991007491100
Added@​radix-ui/​react-context-menu@​2.2.7991007493100
Added@​radix-ui/​react-accordion@​1.2.4991007492100
Updated@​radix-ui/​react-dialog@​1.1.15 ⏡ 1.1.799 +110075 +491100
Addedrecharts@​2.15.27510010094100
Addedreact-router-dom@​6.30.0961007598100
Updated@​types/​react-dom@​19.1.9 ⏡ 19.2.310010075 +186100
Added@​radix-ui/​react-alert-dialog@​1.1.7991007592100
Added@​radix-ui/​react-menubar@​1.1.7991007593100
Added@​radix-ui/​react-tooltip@​1.2.0991007591100
Added@​radix-ui/​react-slider@​1.2.4991007591100
Added@​radix-ui/​react-toast@​1.2.7991007691100
Added@​radix-ui/​react-scroll-area@​1.2.4991007691100
Added@​radix-ui/​react-navigation-menu@​1.2.6991007693100
Added@​radix-ui/​react-select@​2.1.7981007791100
See 32 more rows in the dashboard

View full report

gemini-code-assist[bot]

This comment was marked as resolved.

@github-actions github-actions Bot added the needs-human:review-issue ai agent flagged an issue that requires human review label Apr 21, 2026
dyad-assistant[bot]

This comment was marked as resolved.

@dyad-assistant

Copy link
Copy Markdown
Contributor

πŸ” Dyadbot Code Review Summary

Verdict: πŸ€” NOT SURE - Potential issues

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟑 MEDIUM worker/dyad-sw.js:30 if (request.destination) return is overly broad β€” drops monitoring for images, CSS, fonts
🟑 MEDIUM src/pro/.../enable_nitro.ts:163 AI_RULES.md not rolled back if writeNitroConfigIfMissing throws
🟑 MEDIUM src/pro/.../enable_nitro.ts:182 Rollback does not clean up server/routes/api/ directory on failure
🟑 MEDIUM src/components/chat/DyadEnableNitro.tsx:5 Card is static β€” no pending/finished state unlike other action cards
🟑 MEDIUM src/prompts/system_prompt.ts:340 Build-mode nudge uses internal jargon "local-agent" mode
🟑 MEDIUM src/ipc/handlers/app_handlers.ts:612 Complex inline async flow needs extraction
🟒 Low Priority Notes (6 items)
  • Vite config filename list duplicated β€” src/pro/.../enable_nitro.ts:38 β€” same list exists in framework_utils.ts, vercel_handlers.ts, app_upgrade_handlers.ts
  • Module script regex only matches type-before-src order β€” src/ipc/utils/preview_readiness.ts:1 β€” if HTML outputs <script src="..." type="module">, the regex misses it (low risk since Vite controls the output)
  • Installing vite alongside nitro unexplained β€” src/pro/.../enable_nitro.ts:184 β€” vite is already a dependency in Vite apps; adding it may change the pinned version
  • Duplicate URL match could throw unhandled β€” src/ipc/handlers/app_handlers.ts:618 β€” if existing pending promise rejected, await existingPending throws in event handler
  • waitForPreviewModules not passed to Docker mode β€” src/ipc/handlers/app_handlers.ts β€” Docker path may not receive this flag
  • Duplicated visitor logic in AST visitors β€” src/pro/.../nitro_vite_config.ts:109 β€” visitProperty and visitObjectProperty have identical bodies
🚫 Dropped False Positives (4 items)
  • Developer-facing language in card β€” Dropped: Dyad users ARE developers; "secrets and database clients" is appropriate for the audience
  • No ARIA attributes on card β€” Dropped: Follows same pattern as all other DyadCard components; being consistent is correct
  • Hardcoded 11px font-size β€” Dropped: Matches existing DyadBadge pattern used throughout the codebase
  • Module-level Map needs comment β€” Dropped: pendingPreviewProxyStarts with Promise values used for deduplication is self-explanatory in context

Generated by Dyadbot multi-agent code review

@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@dyad-assistant

Copy link
Copy Markdown
Contributor

πŸ” Dyadbot Code Review Summary

Verdict: πŸ€” NOT SURE - Potential issues

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟑 MEDIUM src/pro/.../enable_nitro.ts:137 executeAddDependency may move vite from devDependencies to dependencies
🟑 MEDIUM src/ipc/handlers/app_handlers.ts:610 Unhandled promise rejection when dedup proxy start rejects
🟑 MEDIUM src/prompts/system_prompt.ts:337 BUILD_SERVER_LAYER_NUDGE fires even when Nitro is already enabled
🟑 MEDIUM src/prompts/local_agent_prompt.ts:197 "When to call" rules stated 3Γ— across prompt, tool description, and build nudge
🟒 Low Priority Notes (6 items)
  • ctx.nitroEnabled not updated after DB write β€” src/pro/.../enable_nitro.ts:106 β€” Within the same agent turn, a second call to enable_nitro would re-run executeAddDependency unnecessarily since ctx.nitroEnabled isn't mutated after the DB write
  • Card doesn't surface the tool's reason argument β€” src/components/chat/DyadEnableNitro.tsx:5 β€” buildXml emits <dyad-enable-nitro /> without passing the reason; card always shows generic text
  • Card body mixes informational and instructional tone β€” src/components/chat/DyadEnableNitro.tsx:14 β€” "Secrets and database clients must stay on the server" reads as a mandate rather than a benefit
  • Path filters in service worker now unreachable β€” worker/dyad-sw.js:45 β€” The request.destination guard makes several Vite/Next.js path-based filters dead code (downstream of already-flagged destination guard)
  • DB update outside try/catch β€” src/pro/.../enable_nitro.ts:157 β€” If the DB write fails, filesystem changes persist; retry is mostly idempotent but executeAddDependency re-runs install
  • defaultConsent: "always" bypasses package install consent β€” src/pro/.../enable_nitro.ts:97 β€” add_dependency uses "ask" for package installs, but enable_nitro uses "always", silently installing packages
🚫 Dropped False Positives (6 items)
  • Truthy check on messageId could be 0 β€” Dropped: messageId is auto-increment starting at 1; 0 is impossible in practice
  • No ARIA attributes on card β€” Dropped: Follows same pattern as all other DyadCard components; already considered and dropped in prior review
  • Success message addressed to AI, not user β€” Dropped: Return value is for the AI agent by design; user sees the buildXml card, not the return string
  • Redundant runtime guard duplicates isEnabled β€” Dropped: Belt-and-suspenders defensive check is fine; not a code health issue
  • API route conventions documented in tool desc + AI_RULES.md β€” Dropped: Intentional split per design β€” setup steps in tool desc (one-time), conventions in AI_RULES.md (ongoing)
  • Module-level dedup Map lacks comment β€” Dropped: Already covered by existing review comment about complex inline async flow

Generated by Dyadbot multi-agent code review

dyad-assistant[bot]

This comment was marked as resolved.

@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@azizmejri1

Copy link
Copy Markdown
Collaborator Author

Claude Code Review Summary

PR Confidence: 4/5

All unresolved review threads from trusted authors have been addressed with code changes and resolved; tests, lint, and type-check pass locally.

Unresolved Threads

No unresolved threads

Resolved Threads

Issue Rationale Link
executeAddDependency moves vite from devDependencies to dependencies (2 duplicate threads from gemini-code-assist and dyad-assistant) Dropped "vite" from the packages array in enable_nitro.ts β€” scaffold already lists vite in devDependencies, no reason to reinstall. gemini / dyad
request.destination filter in dyad-sw.js overly broad β€” drops monitoring for images/CSS/fonts Narrowed the guard to destination === "script" || destination === "worker" so only the Nitro+Vite MIME conflict cases are skipped; images/fonts/CSS are reported again. Per Principle #4: Transparent Over Magical, network observability should not be silently dropped. link
AI_RULES.md not rolled back if writeNitroConfigIfMissing throws Moved writeNitroConfigIfMissing inside the try block so the existing catch-based rollback covers it. link
Rollback does not clean up server/routes/api/ directory on failure Probe server/ existence before mkdir; if we created it, remove recursively in the catch block. link
DyadEnableNitro card is static β€” no pending/finished state Added an optional state prop, wired it through the markdown parser via getState({ isStreaming, inProgress }), and render a spinner/check via DyadStateIndicator. Per Principle #4: Transparent Over Magical and Principle #6: Delightful, action cards should surface in-progress state rather than pretend the work is already done. link
Build-mode nudge uses internal jargon "local-agent" mode Changed to "Agent mode (top of the chat)" so it matches the user-visible label. link
BUILD_SERVER_LAYER_NUDGE fires unconditionally β€” even when Nitro is already enabled Added optional nitroEnabled to constructSystemPrompt/getSystemPromptForChatMode; when true, the build prompt now uses a variant without the nudge. Threaded through both call sites (chat_stream_handlers.ts, token_count_handlers.ts). link
"When to call" rules duplicated 3Γ— across tool description, SERVER_LAYER_BLOCK, and build nudge Slimmed SERVER_LAYER_BLOCK to defer to the tool description as the authoritative source, so the LLM cannot receive contradictory bullet lists if the criteria drift. link
Unhandled promise rejection when dedup proxy start rejects Replied explaining the dedup code (pendingPreviewProxyStarts map) was reverted in commit 80be2c6, so the concern is no longer applicable. link
Product Principle Suggestions

No suggestions


Generated by Claude Code

@dyad-assistant

Copy link
Copy Markdown
Contributor

πŸ” Dyadbot Code Review Summary

Verdict: πŸ€” NOT SURE - Potential issues

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟑 MEDIUM enable_nitro.ts:154 Rollback operations not wrapped in try-catch β€” original error can be swallowed
🟑 MEDIUM enable_nitro.ts:170 DB update outside try-catch β€” filesystem changes committed but DB left inconsistent on failure
🟑 MEDIUM DyadEnableNitro.tsx:30 Body text unconditional on state β€” "API routes can now live under…" shown even when aborted/pending
🟒 Low Priority Notes (0 new items)

All LOW-severity findings were either already covered by existing review comments or were dropped as false positives during validation.

🚫 Dropped False Positives (12 items)
  • Rollback deletes entire server/ with pre-existing content β€” Dropped: Correctly guarded by serverDirCreated flag; pre-existing dirs are not removed
  • SERVER_LAYER_BLOCK included for non-Vite apps β€” Dropped: The text itself handles this case ("If the tool is absent from your toolset, a server layer is not applicable")
  • SW skips script destination broadly β€” Dropped: Intentional for Nitro+Vite compatibility; already covered by existing review comment
  • Dead code _AGENT_MODE_SYSTEM_PROMPT β€” Dropped: Intentionally kept as reference with explicit comment and underscore prefix (lines 474-475)
  • ctx.nitroEnabled stale after DB update β€” Dropped: Duplicate of DB-update issue; low practical impact since all operations are idempotent
  • Very long ENABLE_NITRO_DESCRIPTION β€” Dropped: Long descriptions are standard practice for AI tool definitions
  • Unnecessary message lookup ternary β€” Dropped: Minor style preference, not a defect
  • SERVER_LAYER_BLOCK consistency with basic mode β€” Dropped: Duplicate of non-Vite inclusion issue
  • Build-mode nudge multi-step redirect friction β€” Dropped: Product design decision; already discussed in existing PR comments
  • No ARIA label on card β€” Dropped: Informational chat card, not an interactive element requiring explicit ARIA
  • Inline code snippet styling β€” Dropped: Minor styling nitpick
  • Premature helper text during pending β€” Dropped: Merged with the unconditional body text issue above

Generated by Dyadbot multi-agent code review

dyad-assistant[bot]

This comment was marked as resolved.

@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@azizmejri1 azizmejri1 removed the needs-human:review-issue ai agent flagged an issue that requires human review label Apr 23, 2026
@github-actions github-actions Bot added the needs-human:review-issue ai agent flagged an issue that requires human review label Apr 23, 2026
@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@azizmejri1 azizmejri1 removed the needs-human:review-issue ai agent flagged an issue that requires human review label Apr 29, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@dyad-assistant

Copy link
Copy Markdown
Contributor

πŸ” Dyadbot Code Review Summary

Verdict: βœ… YES - Ready to merge

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟑 MEDIUM src/neon_admin/neon_context.ts:393 getNeonClientCode missing vite-nitro branch β€” server-side warning absent
🟒 Low Priority Notes (0 items)

No low-priority issues found after deduplication with existing comments.

🚫 Dropped False Positives (13 items)
  • appendNitroRules outside try-catch β€” Dropped: If it fails, nothing else has run; no cleanup needed. The cascading order (rules β†’ config β†’ dir β†’ install) is intentionally correct.
  • Prompt duplication (SERVER_LAYER_BLOCK / ENABLE_NITRO_DESCRIPTION / BUILD_SERVER_LAYER_NUDGE) β€” Dropped: Already flagged by existing PR comment at local_agent_prompt.ts:200 ("When to call rules stated 3Γ—").
  • detectFrameworkType sync FS calls on chat stream β€” Dropped: Consistent with existing patterns (readAiRules does the same). fs.existsSync on local files is <1ms per call.
  • Config file list duplication in framework_utils.ts β€” Dropped: Only 2 uses of a 3-element array; extracting a helper would be premature abstraction.
  • TOCTOU in server dir check / writeNitroConfigIfMissing β€” Dropped: Theoretical race in a single-caller scenario. The agent tool runs sequentially.
  • Separator logic edge case in ai_rules_patcher.ts β€” Dropped: Purely cosmetic, produces correct output in all cases.
  • Vite config suppresses Next.js detection β€” Dropped: Edge case for projects with both Vite config AND next dep but no Next.js config β€” extremely unlikely.
  • DyadEnableNitro hardcoded path β€” Dropped: server/routes/api/ is a fundamental convention consistently used across tool, AI rules, and card.
  • Build-mode nudge wayfinding β€” Dropped: Already partially covered by existing "jargon" comment on the nudge.
  • Build-mode nudge "I can't" framing β€” Dropped: Style preference; the direct framing is intentionally clear.
  • Script/worker fetch skip scope β€” Dropped: Already flagged as "overly broad" in existing comments.
  • Accessibility β€” no ARIA labels on card β€” Dropped: Consistent with all other existing card components in the codebase.
  • React import in DyadEnableNitro β€” Dropped: Consistent with existing codebase pattern across all similar components.

Generated by Dyadbot multi-agent code review

*/
export function getNeonClientCode(
frameworkType: "nextjs" | "vite" | "other" | null,
frameworkType: AppFrameworkType | null,

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.

🟑 MEDIUM | missing-branch

getNeonClientCode missing vite-nitro branch β€” server-side warning absent

Widening to AppFrameworkType means "vite-nitro" now silently falls through to the generic fallback (line 408+) which lacks the // IMPORTANT: Only use this in server-side code warning that "nextjs" gets.

For a Neon-connected Vite+Nitro app, the AI will get Neon client code that uses process.env.DATABASE_URL without guidance that it must go in a Nitro server route (server/routes/api/), potentially leading the model to place database imports in client-side React components where process.env.DATABASE_URL is unavailable.

Note: The PR plan defers Neon-specific integration to a follow-up, so this could be addressed there. But the type widening here opens the gap now.

πŸ’‘ Suggestion: At minimum, update the comment on line 408 to mention "vite-nitro". Ideally, add "vite-nitro" to the "nextjs" branch so it gets the server-side-only warning too.

@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@dyad-assistant

Copy link
Copy Markdown
Contributor

πŸ” Dyadbot Code Review Summary

Verdict: βœ… YES - Ready to merge

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟑 MEDIUM src/components/chat/DyadEnableNitro.tsx:32 No body copy on aborted state β€” user has no actionable next step
🟒 Low Priority Notes (4 items)
  • Ask-mode prompt silently drops [[SERVER_LAYER]] replacement β€” src/prompts/local_agent_prompt.ts:319 β€” Correct behavior (ask mode shouldn't nudge) but relies on the absence of a placeholder rather than an explicit exclusion, making it fragile
  • Standalone nitro.config without vite config classified as "other" β€” src/ipc/utils/framework_utils.ts:46 β€” Edge case: a project with nitro.config.ts but no vite.config.* falls through to "other" since isVite is never set
  • Completed-state help text lacks forward-looking call to action β€” src/components/chat/DyadEnableNitro.tsx:35 β€” After successful setup, the card says what happened but doesn't prompt the user to take the logical next step (e.g., "Ask me to create your first API route")
  • Build-mode nudge implies automatic behavior after switching β€” src/prompts/system_prompt.ts:341 β€” "I'll set up the backend and generate the route for you in the same turn" may lead users to switch to Agent mode and wait, without realizing they need to re-send their message
🚫 Dropped False Positives (12 items)
  • AI_RULES.md rollback fires when wasAppended=false β€” Dropped: Restoring the backup writes the same bytes back β€” harmless no-op in this synchronous tool execution
  • Rollback misses server/routes/api/ when server/ pre-existed β€” Dropped: Already commented on by chatgpt-codex-connector[bot]
  • isEnabled doesn't guard against Neon-connected apps β€” Dropped: Neon+Nitro is an intentional supported combination (Nitro enables server-side DATABASE_URL access for Neon)
  • wasAppended field never used by callers β€” Dropped: Used in test assertions; clean interface design for future consumers
  • serverDirCreated inner try/catch misleading β€” Dropped: Pattern is correct and consistent with writeNitroConfigIfMissing in the same file
  • getNeonClientCode has no vite-nitro branch β€” Dropped: Already commented by dyad-assistant
  • Separator logic overly clever β€” Dropped: Three cases (null, trailing newline, no trailing newline) are clear enough
  • buildXml non-self-closing tag pair β€” Dropped: Consistent with codebase convention; parser requires open+close pairs
  • Consent preview unbounded LLM text β€” Dropped: Already commented by dyad-assistant
  • Build-mode nudge hardcodes UI location β€” Dropped: Already commented by dyad-assistant
  • HTML comment markers in AI_RULES.md β€” Dropped: Already commented and responded as intentional
  • Duplicate ask-mode silent drop β€” Dropped: Merged with the confirmed LOW finding

Generated by Dyadbot multi-agent code review
"

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

Multi-agent review: 1 issue found

<DyadStateIndicator state={state} abortedLabel="Did not finish" />
)}
</DyadCardHeader>
{!isPending && !isAborted && (

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.

🟑 MEDIUM | error-states

No body copy on aborted state β€” user has no actionable next step

When the Nitro setup is aborted mid-run, the card shows only the headline β€œNitro server layer setup aborted” and a β€œDid not finish” indicator. The user has no idea whether partial changes were made, whether they should retry, or what went wrong.

Since Nitro setup touches the filesystem (writes a config, installs a package), a partial failure could leave the project in an inconsistent state β€” the rollback logic handles this internally, but the user has no visibility.

πŸ’‘ Suggestion: Add a short aborted-state body with guidance like β€œSetup did not complete. Re-send your request to try again.”

@github-actions github-actions Bot added the needs-human:review-issue ai agent flagged an issue that requires human review label Apr 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

❌ Some tests failed

OS Passed Failed Flaky Skipped
🍎 macOS 264 27 5 6

Summary: 264 passed, 27 failed, 5 flaky, 6 skipped

Failed Tests

🍎 macOS

Show all 27 failures
  • capacitor.spec.ts > capacitor upgrade and sync works
    • Error: expect(string).toMatchSnapshot(expected) failed
  • chat_tabs.spec.ts > tabs appear after navigating between chats
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • chat_tabs.spec.ts > closing a tab removes it and selects adjacent tab
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • chat_tabs.spec.ts > right-click context menu: Close tabs to the right
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • copy_app.spec.ts > copy app with history
    • Error: expect(string).toMatchSnapshot(expected) failed
  • copy_app.spec.ts > copy app without history
    • Error: expect(string).toMatchSnapshot(expected) failed
  • custom_apps_folder.spec.ts > new apps are stored in the user's custom folder
    • Error: expect(received).toBe(expected) // Object.is equality
  • engine.spec.ts > send message to engine
    • Error: expect(string).toMatchSnapshot(expected) failed
  • engine.spec.ts > send message to engine - openai gpt-5
    • Error: expect(string).toMatchSnapshot(expected) failed
  • engine.spec.ts > send message to engine - anthropic claude sonnet 4
    • Error: expect(string).toMatchSnapshot(expected) failed
  • engine.spec.ts > smart auto should send message to engine
    • Error: expect(string).toMatchSnapshot(expected) failed
  • engine.spec.ts > regular auto should send message to engine
    • Error: expect(string).toMatchSnapshot(expected) failed
  • local_agent_advanced.spec.ts > local-agent - mention apps
    • Error: expect(string).toMatchSnapshot(expected) failed
  • local_agent_auto.spec.ts > local-agent - auto model
    • Error: expect(string).toMatchSnapshot(expected) failed
  • local_agent_basic.spec.ts > local-agent - dump request
    • Error: expect(string).toMatchSnapshot(expected) failed
  • mention_app.spec.ts > mention app (with pro)
    • Error: expect(string).toMatchSnapshot(expected) failed
  • per_chat_input.spec.ts > chat input is preserved when switching between chats
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • per_chat_input.spec.ts > closing a chat tab clears its stored input
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • per_chat_input.spec.ts > input preserved when switching back and forth multiple times
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • select_component.spec.ts > upgrade app to select component
    • Error: expect(string).toMatchSnapshot(expected) failed
  • setup_flow.spec.ts > Setup Flow > ai provider setup flow
    • Error: expect(locator).toBeVisible() failed
  • smart_context_balanced.spec.ts > smart context balanced - simple
    • Error: expect(string).toMatchSnapshot(expected) failed
  • smart_context_deep.spec.ts > smart context deep - read write read
    • Error: expect(string).toMatchSnapshot(expected) failed
  • smart_context_deep.spec.ts > smart context deep - mention app should fallback to balanced
    • Error: expect(string).toMatchSnapshot(expected) failed
  • thinking_budget.spec.ts > thinking budget
    • Error: expect(string).toMatchSnapshot(expected) failed
  • turbo_edits_v2.spec.ts > turbo edits v2 - search-replace dump
    • Error: expect(string).toMatchSnapshot(expected) failed
  • turbo_edits_v2.spec.ts > turbo edits v2 - search-replace fallback
    • Error: expect(string).toMatchSnapshot(expected) failed

πŸ“‹ Re-run Failing Tests (macOS)

Copy and paste to re-run all failing spec files locally:

npm run e2e \
  e2e-tests/capacitor.spec.ts \
  e2e-tests/chat_tabs.spec.ts \
  e2e-tests/copy_app.spec.ts \
  e2e-tests/custom_apps_folder.spec.ts \
  e2e-tests/engine.spec.ts \
  e2e-tests/local_agent_advanced.spec.ts \
  e2e-tests/local_agent_auto.spec.ts \
  e2e-tests/local_agent_basic.spec.ts \
  e2e-tests/mention_app.spec.ts \
  e2e-tests/per_chat_input.spec.ts \
  e2e-tests/select_component.spec.ts \
  e2e-tests/setup_flow.spec.ts \
  e2e-tests/smart_context_balanced.spec.ts \
  e2e-tests/smart_context_deep.spec.ts \
  e2e-tests/thinking_budget.spec.ts \
  e2e-tests/turbo_edits_v2.spec.ts

⚠️ Flaky Tests

🍎 macOS

  • chat_tabs.spec.ts > right-click context menu: Close other tabs (passed after 1 retry)
  • cloud_sandbox.spec.ts > cloud sandbox undo restores the remote snapshot (passed after 1 retry)
  • fix_error.spec.ts > fix error with AI (passed after 1 retry)
  • security_review.spec.ts > security review - edit and use knowledge (passed after 1 retry)
  • setup_flow.spec.ts > Setup Flow > setup banner shows correct state when node.js is installed (passed after 1 retry)

πŸ“Š View full report

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wwwillchen

Copy link
Copy Markdown
Collaborator

@BugBot run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54ccc12f45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +107 to +110
const result = await installPackages({
packages: ["nitro"],
appPath: ctx.appPath,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Install Nitro as a development dependency

enable_nitro currently installs nitro without dev: true, so package managers persist it under dependencies instead of devDependencies. In this repo, Vite/tooling packages are treated as dev-time tooling, and adding Nitro to production deps can unnecessarily inflate packaged app size and production install footprint for every project that enables this tool. Since this commit added explicit dev plumbing in installPackages/buildAddDependencyCommand, this call site should use it to avoid persisting Nitro in runtime dependencies.

Useful? React with πŸ‘Β / πŸ‘Ž.

@dyad-assistant

Copy link
Copy Markdown
Contributor

πŸ” Dyadbot Code Review Summary

Verdict: βœ… YES - Ready to merge

Reviewed by 3 independent agents: Correctness Expert, Code Health Expert, UX Wizard.

Issues Summary

Severity File Issue
🟒 LOW src/ipc/utils/socket_firewall.test.ts Missing npm+sfw+dev:true test case
🟒 Low Priority Notes (1 item)
  • Missing npm + socket-firewall test case for dev dependency - src/ipc/utils/socket_firewall.test.ts:134 β€” The new dev-dependency test matrix covers 3/4 combinations (pnpm/no-sfw, npm/no-sfw, pnpm/sfw) but omits the npm+sfw combination with dev: true. The original non-dev matrix covers all four. Add: ["npm", true, { command: "npx", args: ["--prefer-offline", "--yes", "sfw@2.0.4", "npm", "install", "--legacy-peer-deps", "--save-dev", "nitro"] }]
🚫 Dropped False Positives (16 items)
  • Failed installPackages leaves package.json/lockfile unrolled-back β€” Dropped: Package managers handle their own rollback on failure. This is a pre-existing limitation of executeAddDependency, not new to this PR.
  • E2E fixture Vite 7 vs scaffold Vite 8 mismatch β€” Dropped: Already discussed in PR thread; tagger upgrade needed first. Known tracked issue.
  • Rollback order needs comment β€” Dropped: "Prepare backup then try/catch" is a standard pattern; code is clear enough.
  • Confusing two-try-block pattern for server dir β€” Dropped: Pattern is consistent with writeNitroConfigIfMissing in the same file.
  • "When to call" rules duplicated β€” Dropped: Already commented on by previous reviewers.
  • BUILD_SERVER_LAYER_NUDGE dead-ends free-tier users β€” Dropped: Already commented on by previous reviewers.
  • Missing vite-nitro branch in getNeonClientCode β€” Dropped: Already commented on by previous reviewers.
  • Hardcoded config may drift β€” Dropped: Already commented on by previous reviewers.
  • Templates tightly coupled across files β€” Dropped: Templates serve different purposes (LLM instructions vs generated files); coupling is inherent.
  • Nudge assumes user knows where Agent mode is β€” Dropped: Already addressed; updated to "(near the chat input, next to the message box)".
  • No body copy for aborted state β€” Dropped: Already commented on by previous reviewers.
  • defaultConsent "always" despite heavy modifications β€” Dropped: Deliberate design choice. Tool is designed to auto-run as part of the LLM workflow.
  • SERVER_LAYER_BLOCK references tool name β€” Dropped: LLM system prompt instruction, not user-facing text. LLM needs exact tool name.
  • Completed state only mentions API routes β€” Dropped: Text is appropriately concise and actionable.
  • Service worker script/worker drops affect observability β€” Dropped: Already extensively commented on by previous reviewers.
  • Neon env var pattern wrong for vite-nitro β€” Dropped: Already covered by existing comment; process.env does work in Nitro server routes.

Generated by Dyadbot multi-agent code review

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

❌ Some tests failed

OS Passed Failed Flaky Skipped
🍎 macOS 286 5 8 6

Summary: 286 passed, 5 failed, 8 flaky, 6 skipped

Failed Tests

🍎 macOS

  • chat_tabs.spec.ts > closing a tab removes it and selects adjacent tab
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • chat_tabs.spec.ts > right-click context menu: Close tabs to the right
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • custom_apps_folder.spec.ts > new apps are stored in the user's custom folder
    • Error: expect(received).toBe(expected) // Object.is equality
  • per_chat_input.spec.ts > input preserved when switching back and forth multiple times
    • Error: Timeout 30000ms exceeded while waiting on the predicate
  • setup_flow.spec.ts > Setup Flow > ai provider setup flow
    • Error: expect(locator).toBeVisible() failed

πŸ“‹ Re-run Failing Tests (macOS)

Copy and paste to re-run all failing spec files locally:

npm run e2e \
  e2e-tests/chat_tabs.spec.ts \
  e2e-tests/custom_apps_folder.spec.ts \
  e2e-tests/per_chat_input.spec.ts \
  e2e-tests/setup_flow.spec.ts

⚠️ Flaky Tests

🍎 macOS

  • chat_tabs.spec.ts > tabs appear after navigating between chats (passed after 1 retry)
  • chat_tabs.spec.ts > clicking a tab switches to that chat (passed after 1 retry)
  • chat_tabs.spec.ts > right-click context menu: Close other tabs (passed after 1 retry)
  • chat_tabs.spec.ts > only shows tabs for chats opened in current session (passed after 1 retry)
  • cloud_sandbox.spec.ts > cloud sandbox undo restores the remote snapshot (passed after 1 retry)
  • local_agent_basic.spec.ts > local-agent - questionnaire flow (passed after 1 retry)
  • per_chat_input.spec.ts > closing a chat tab clears its stored input (passed after 1 retry)
  • setup_flow.spec.ts > Setup Flow > setup banner shows correct state when node.js is installed (passed after 1 retry)

πŸ“Š View full report

@azizmejri1 azizmejri1 merged commit 89f95ff into dyad-sh:main Apr 30, 2026
10 of 13 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

❌ Some tests failed

OS Passed Failed Flaky Skipped
🍎 macOS 434 4 5 140
πŸͺŸ Windows 435 10 6 140

Summary: 869 passed, 14 failed, 11 flaky, 280 skipped

Failed Tests

🍎 macOS

  • queued_message.spec.ts > editing queued message restores attachments and selected components
    • Error: expect(locator).toBeVisible() failed
  • queued_message.spec.ts > canceling queued message edit clears restored components
    • Error: expect(locator).toBeVisible() failed
  • setup_flow.spec.ts > Setup Flow > ai provider setup flow
    • Error: expect(locator).toBeVisible() failed
  • visual_editing.spec.ts > swap image via URL
    • TimeoutError: locator.click: Timeout 30000ms exceeded.

πŸͺŸ Windows

  • chat_input.spec.ts > send button disabled during pending proposal
    • Error: expect(locator).toBeVisible() failed
  • chat_tabs.spec.ts > right-click context menu: Close other tabs
    • Error: expect(locator).toBeVisible() failed
  • edit_code.spec.ts > edit code edits the right file during rapid switches
    • Error: expect(received).toEqual(expected) // deep equality
  • git_collaboration.spec.ts > Git Collaboration > should create, switch, rename, merge, and delete branches
    • Error: expect(locator).toMatchAriaSnapshot(expected) failed
  • github.spec.ts > create and sync to new repo
    • Error: expect(locator).toHaveClass(expected) failed
  • github.spec.ts > create and sync to new repo - custom branch
    • TimeoutError: locator.click: Timeout 30000ms exceeded.
  • github.spec.ts > create and sync to existing repo
    • Error: expect(locator).toMatchAriaSnapshot(expected) failed
  • github.spec.ts > create and sync to existing repo - custom branch
    • Error: expect(locator).toMatchAriaSnapshot(expected) failed
  • setup_flow.spec.ts > Setup Flow > node.js install flow
    • TimeoutError: locator.dispatchEvent: Timeout 30000ms exceeded.
  • setup_flow.spec.ts > Setup Flow > ai provider setup flow
    • Error: expect(locator).toBeVisible() failed

πŸ“‹ Re-run Failing Tests (macOS)

Copy and paste to re-run all failing spec files locally:

npm run e2e \
  e2e-tests/queued_message.spec.ts \
  e2e-tests/setup_flow.spec.ts \
  e2e-tests/visual_editing.spec.ts

⚠️ Flaky Tests

🍎 macOS

  • chat_input.spec.ts > send button disabled during pending proposal - reject (passed after 2 retries)
  • engine.spec.ts > regular auto should send message to engine (passed after 1 retry)
  • fix_error.spec.ts > fix error with AI (passed after 1 retry)
  • setup_flow.spec.ts > Setup Flow > setup banner shows correct state when node.js is installed (passed after 1 retry)
  • socket_firewall.spec.ts > build mode - blocked unsafe npm package shows the real socket verdict and preserves app files (passed after 2 retries)

πŸͺŸ Windows

  • chat_input.spec.ts > send button disabled during pending proposal - reject (passed after 1 retry)
  • chat_tabs.spec.ts > closing a tab removes it and selects adjacent tab (passed after 2 retries)
  • github.spec.ts > should connect to GitHub using device flow (passed after 2 retries)
  • github.spec.ts > github clear integration settings (passed after 2 retries)
  • reject.spec.ts > reject (passed after 1 retry)
  • setup_flow.spec.ts > Setup Flow > setup banner shows correct state when node.js is installed (passed after 1 retry)

πŸ“Š View full report

@azizmejri1

Copy link
Copy Markdown
Collaborator Author

@azizmejri1 i forgot to include this in my previous review, but I don't think we should enable this for users who have already enabled supabase, especially if they're already using edge functions. I think it'll confuse the AI whether to use supabase edge functions vs. nitro.

I think for now, we should just do this if there's no supabase project associated with the dyad app.

in the future, we could condition this so that we check if there's any supabase edge functions (potentially, users may want nitro + supabase, but this feels a little speculative right now, and i think the react+vite+nitro+neon stack is clearer right now)

HI @wwwillchen , should we still show supabase in add_integration when a nitro server layer was already added to the app or maybe just warn the user that choosing supabase may confuse the AI whether to use supabase edge functions vs. nitro?

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

Labels

needs-human:review-issue ai agent flagged an issue that requires human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants