<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds a context-limit banner with one-click “summarize into new chat,”
refactors token counting with react-query, and persists per-message max
token usage.
>
> - **Chat UX**
> - **Context limit banner** (`ContextLimitBanner.tsx`,
`MessagesList.tsx`): shows when within 40k tokens of `contextWindow`,
with tooltip and action to summarize into a new chat.
> - **Summarize flow**: extracted to `useSummarizeInNewChat` and used in
chat input and banner; new summarize system prompt
(`summarize_chat_system_prompt.ts`).
> - **Token usage & counting**
> - **Persist max tokens used per assistant message**: DB migration
(`messages.max_tokens_used`), schema updates, and saving usage during
streaming (`chat_stream_handlers.ts`).
> - **Token counting refactor** (`useCountTokens.ts`): react-query with
debounce; returns `estimatedTotalTokens` and `actualMaxTokens`;
invalidated on model change and stream end; `TokenBar` updated.
> - **Surfacing usage**: tooltip on latest assistant message shows total
tokens (`ChatMessage.tsx`).
> - **Model/config tweaks**
> - Set `auto` model `contextWindow` to `200_000`
(`language_model_constants.ts`).
> - Improve chat auto-scroll dependency (`ChatPanel.tsx`).
> - Fix app path validation regex (`app_handlers.ts`).
> - **Testing & dev server**
> - E2E tests for banner and summarize
(`e2e-tests/context_limit_banner.spec.ts` + fixtures/snapshot).
> - Fake LLM server streams usage to simulate high token scenarios
(`testing/fake-llm-server/*`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2ae16a14d50699cc772407426419192c2fdf2ec3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a “Summarize into new chat” trigger and a context limit banner to
help keep conversations focused and avoid hitting model limits. Also
tracks and surfaces actual token usage per assistant message, with a
token counting refactor for reliability.
- **New Features**
- Summarize into new chat from the input or banner; improved system
prompt with clear output format.
- Context limit banner shows when within 40k tokens of the model’s
context window and offers a one-click summarize action.
- Tooltip on the latest assistant message shows total tokens used.
- **Refactors**
- Token counting now uses react-query and returns estimatedTotalTokens
and actualMaxTokens; counts are invalidated on model change and when
streaming settles.
- Persist per-message max_tokens_used in the messages table; backend
aggregates model usage during streaming and saves it.
- Adjusted default “Auto” model contextWindow to 200k for more realistic
limits.
- Improved chat scrolling while streaming; fixed app path validation
regex.
<sup>Written for commit 2ae16a14d50699cc772407426419192c2fdf2ec3.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
closes#1688
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Add a “Fix All Errors” button to the chat that collects all error
messages and sends a single request to resolve them. This helps users
fix multiple errors in one step.
- New Features
- Parse dyad-output type=error messages and track count/last index in
DyadMarkdownParser.
- Show FixAllErrorsButton after the last error when there are 2+ errors,
not streaming, and chatId is present.
- Button streams a prompt listing all errors, shows a loading state, and
displays the error count.
<sup>Written for commit b9762955d3b9cecd3b00c9efb478ce599f60e32d.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Default Smart Files context to deep and align UI and stream handler
logic so any non-balanced option uses deep when Pro mode is enabled.
>
> - **Smart Context behavior**
> - UI (`src/components/ProModeSelector.tsx`): default
`getCurrentValue()` to `"deep"` when Pro Smart Files mode is enabled
without an explicit option.
> - Engine (`src/ipc/handlers/chat_stream_handlers.ts`):
`isDeepContextEnabled` now requires `enableProSmartFilesContextMode` and
treats any option other than `"balanced"` as deep; `smartContextMode`
set accordingly and `versioned_files` used when deep.
> - **Snapshots**
> - Update e2e snapshots to reflect `smart_context_mode: "deep"` and new
`dyad_options.versioned_files` structure.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7426890467d60b671a7a9712f7544a35ed922981. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Default smart files context to deep and align the UI and stream handler
so anything not “balanced” uses deep when Pro Smart Files mode is on.
This prevents mismatches and makes deep context the default.
- **Bug Fixes**
- ProModeSelector: default to deep when no option is set.
- chat_stream_handlers: isDeepContextEnabled requires Pro Smart Files
mode and treats non-“balanced” as deep; smartContextMode set to deep
accordingly.
- Engine payload: use versioned_files; update e2e snapshots.
<sup>Written for commit 7426890467d60b671a7a9712f7544a35ed922981.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds commit-aware deep context by computing hasExternalChanges (via
latest assistant commit vs current repo + dirty check) and propagating
commitHash through messages/provider options.
>
> - **Deep Smart Context**:
> - Add `hasExternalChanges` to `VersionedFiles`; compute by comparing
latest assistant `commitHash` with `getCurrentCommitHash` and checking
`isGitStatusClean`.
> - Make `sourceCommitHash` nullable; add `commitHash` in
`DyadEngineProviderOptions` and use it when scanning history.
> - **Chat Handling**:
> - Include `commitHash` in `messageHistory` and pass through
`providerOptions['dyad-engine']`.
> - **Git Utilities**:
> - New `isGitStatusClean(path)` supporting native git and
isomorphic-git.
> - **Tests/Snapshots**:
> - Mock `getCurrentCommitHash` and `isGitStatusClean`; update snapshot
to include `hasExternalChanges`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ad92d9dd5ead941de822e8da59c8819e4db8b775. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Detects external code changes in deep context by comparing the latest
assistant commit with the current repo state. Exposes a
hasExternalChanges flag so the engine can adapt responses when the
workspace diverges.
- **New Features**
- Added hasExternalChanges to VersionedFiles.
- Computes by comparing the latest assistant commitHash with
getCurrentCommitHash and checking isGitStatusClean.
- Passes commitHash through chat messages and dyad-engine
providerOptions; sourceCommitHash is now nullable.
- Defaults to true if detection fails (with a warning).
<sup>Written for commit 6ebb0b125c9a3421b4e5673870b204c9cb279265.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
…ported in deep context
Fixes https://github.com/dyad-sh/dyad/issues/1715
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Deep context now only applies with no app mentions; otherwise we
fallback to balanced and pass the effective mode to the engine, with
updated history limits and new e2e coverage.
>
> - **Smart Context behavior**:
> - Deep mode activates only when no `@app:` mentions are present;
otherwise uses `balanced`.
> - Max chat turns set to 201 only for deep-without-mentions; otherwise
use configured limit.
> - **Engine integration**:
> - Send effective smart context mode via `dyadSmartContextMode` and map
to `dyad_options.smart_context_mode` in `llm_engine_provider`.
> - Add `SmartContextMode` schema (`balanced|conservative|deep`) and use
it in settings/types.
> - Remove static `smartContextMode` from engine options; use
per-request mode instead.
> - **Tests**:
> - Add e2e test `smart context deep - mention app should fallback to
balanced` with snapshot asserting `smart_context_mode: "balanced"` and
mentioned app files.
> - **Misc**:
> - Tighten app path validation regex in `rename-app` handler.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5aada2bd246e297d7b35e36738f75c8531b897ae. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fallback to balanced smart context when an app is mentioned in deep
mode, since deep doesn’t support mentioned apps. This keeps context
limits correct and updates engine config, with new e2e coverage.
- **Bug Fixes**
- Deep mode only applies when no apps are mentioned; otherwise we use
balanced.
- Max chat turns: 201 only for deep without mentions; otherwise use
configured limit.
- Plumb smart context mode via dyadSmartContextMode to the engine; add
SmartContextMode schema.
- Add e2e test to verify fallback in deep mode when an app is mentioned.
<sup>Written for commit 5aada2bd246e297d7b35e36738f75c8531b897ae.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds an animated placeholder with rotating prompt suggestions to the
home chat input to guide users. Also introduces a small hook for the
typing effect and updates the e2e selector to handle dynamic text.
- **New Features**
- HomeChatInput shows "Ask Dyad to build" with cycling suggestions
(ecommerce store, information page, landing page).
- New useTypingPlaceholder hook for type/delete animation with
configurable speeds and pause.
- E2E test locator updated to match aria-placeholder by prefix to
support dynamic content.
<sup>Written for commit 6b8133ec9441f60909493cad3b43315348aed2d5.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
The diff appears large due to Prettier formatting, but actual code
changes are minimal.
- Made header sticky with proper flex layout
- Added responsive text sizes (`text-xs sm:text-sm`)
- Improved text wrapping (`break-words overflow-wrap-anywhere`)
- Made tab labels responsive (shorter for small screen)
- Added `flex-shrink-0` to prevent icon/button squishing
- Stack footer buttons vertically on small screen
closes#1746
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Made the Import App dialog responsive on small screens. Improves
readability and prevents controls from squishing.
- **Bug Fixes**
- Added a sticky header so the title/description stay visible while
scrolling.
- Made text and tab labels responsive, with better word wrapping to
avoid overflow.
- Prevented icon/button compression and stacked footer buttons
vertically on mobile.
- Updated e2e test by removing the AI_RULES snapshot to match the new
UI.
<sup>Written for commit 1025631018964aea37689ab2196e0169755e3739.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds multi-component selection in the preview and sends all selected
components to chat for targeted edits. Updates overlays, UI, and IPC to
support arrays, smarter context focusing, and cross-platform path
normalization.
- **New Features**
- Select multiple components in the iframe; selection mode stays active
until you deactivate it.
- Show a scrollable list of selections with remove buttons and a Clear
all; remove from the list or click an overlay in the preview to
deselect. Sending clears all overlays.
- Separate hover vs selected overlays with labels on hover; overlays
persist after deactivation and re-position on layout changes/resizes.
- Chat input and streaming now send selectedComponents; server builds
per-component snippets and focuses their files in smart context.
- **Migration**
- Replace selectedComponentPreviewAtom with
selectedComponentsPreviewAtom (ComponentSelection[]).
- ChatStreamParams now uses selectedComponents; migrate any
single-selection usages.
- previewIframeRefAtom added for clearing overlays from the parent.
<sup>Written for commit da0d64cc9e9f83fbf4b975278f6c869f0d3a8c7d.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
See #1692
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds multi-select with a "Fix X Issues" bulk action to Security Review
(severity-sorted, with animated header button), clears selections on
refresh, and improves streaming error logs; includes e2e coverage.
>
> - **Security Review UI
(`src/components/preview_panel/SecurityPanel.tsx`)**:
> - **Multi-select & Bulk Fix**:
> - Add per-row checkboxes and a "Select all" checkbox in
`FindingsTable`; sort by severity; ARIA labels.
> - Track `selectedFindings`; clear on new data; header shows animated
"Fix X Issues" button (`Wrench` icon) that creates one chat with a
combined prompt for selected issues.
> - **Fix Single Issue**: Preserve existing per-row "Fix Issue" flow
with loading states.
> - **Tests**:
> - Add e2e test `security review - multi-select and fix issues` and
snapshots for selection table and combined prompt.
> - **IPC (`src/ipc/ipc_client.ts`)**:
> - Enhance error logging (`console.error`) in `streamMessage` paths;
simplify `cancelChatStream` (remove stale cleanup).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
08b9f92814e2a676d0a8de1badf7dc79cd82a14a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Add multi-select to the Security Review so you can select issues and fix
them in one go. Improves error handling in chat streaming and adds an
e2e test for the new flow.
- New Features
- Checkboxes per finding and a “Select all” checkbox, with
severity-sorted rows.
- Header shows an animated “Fix X Issues” button when items are
selected; creates one chat with a combined prompt; clears selection
after.
- New e2e test: multi-select and bulk fix.
- Bug Fixes
- Clear selections when new review results load.
- Better error logging in IpcClient for streaming failures; simplify
cancelChatStream to avoid false errors.
<sup>Written for commit 08b9f92814e2a676d0a8de1badf7dc79cd82a14a.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
Example:
open
"dyad://add-prompt?data=eyJ0aXRsZSI6IlRlc3QgUHJvbXB0IiwiZGVzY3JpcHRpb24iOiJBIHRlc3QgcHJvbXB0IGZyb20gZGVlcCBsaW5rIiwiY29udGVudCI6IlRoaXMgaXMgdGhlIGNvbnRlbnQgb2YgdGhlIHByb21wdC4ifQ%3D%3D"
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds dyad://add-prompt deep link that navigates to Library and opens a
prefilled Create Prompt dialog from base64 JSON.
>
> - **Deep Link Handling**
> - Parse `dyad://add-prompt?data=<base64-json>` in `src/main.ts`;
validate with `AddPromptDataSchema` and send `deep-link-received` with
payload.
> - Extend `DeepLinkContext` to navigate to `/library` on `add-prompt`.
> - **Library/Dialogs**
> - Add controlled open state and `prefillData` support to
`CreateOrEditPromptDialog` and `CreatePromptDialog`
(`src/components/CreatePromptDialog.tsx`).
> - In `src/pages/library.tsx`, listen for `add-prompt` deep link,
prefill form, open dialog, and clear deep-link state.
> - **Schemas**
> - Define `AddPromptDataSchema`, `AddPromptPayload`, and
`AddPromptDeepLinkData` in `src/ipc/deep_link_data.ts` and include in
`DeepLinkData` union.
> - **E2E Tests**
> - Add Playwright test `e2e-tests/add_prompt_deep_link.spec.ts` and
ARIA snapshot to verify deep link opens prefilled dialog and saves
prompt.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1ddb12306cfca195682c8a1b719f60093b858d54. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
I implemented file referencing feature mentioned in issue #1591
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds support for referencing app files in chat using @file:<path>. The
input now autocompletes files, and the backend validates and surfaces
referenced files in the chat context as read-only.
- **New Features**
- Chat input autocompletes @ mentions for apps, prompts, and files.
- Recognizes @file:<path> and converts it to a structured mention on
submit.
- Backend parses @file mentions, checks file existence, and adds a
“Referenced Files” section to the system message.
- New get-app-files IPC handler and useAppFiles hook to load file paths
for the selected app (appFilesAtom added).
- e2e test for mentioning a file and capturing server dump.
<!-- End of auto-generated description by cubic. -->
@princeaden1 can you take a look at why this test is flaking often
later? for now, i think we can just skip it since it's not a super
critical feature (users can always edit the file using the regular code
panel)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
12de571a1a5d2f9c6c98e90ae19fd67a3fb2e6b5. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Fixes#672
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Add selectable problem rows with Select all/Clear all and Fix N
selected, and update tests to cover selection behavior.
>
> - **UI (Problems panel)**:
> - Add checkbox selection for each problem row (`ProblemItem`) with row
click-to-toggle, `data-testid="problem-row"`, and accessibility
attributes.
> - Introduce selection state in `_Problems` with auto-select-all on
report load; provide Select all / Clear all controls.
> - Change Fix button to operate on selected problems only, showing
dynamic label `Fix N problem(s)` and disabled when none selected.
> - Wire `RecheckButton` to clear selection before rechecking; minor
hover style tweaks; add `Checkbox` component.
> - **E2E Tests**:
> - New test: selecting specific problems and fixing only selected; add
snapshots for prompt content.
> - Update manual edit tests (React/Vite, Next.js) to assert Fix button
enabled/disabled and counts; remove old ARIA snapshots.
> - Minor import addition for `Timeout` and related expectations.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8324e26f9d2d265e7e0d1f1b7538e2a8db40f674. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Add ability to manually configure Node.js path for users who have
Node.js
installed but not in their system PATH.
Features:
- Browse and select custom Node.js installation folder
- Visual status indicator showing Node.js version or "Not found"
- Reset to system default PATH option
- Manual configuration option in setup banner
- Real-time Node.js status checking
closes#1050
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds manual Node.js path configuration so the app works even when Node
isn’t on PATH, fulfilling #1050. Users can browse to their install,
reset to default, and see real-time status in Settings and during setup.
- New Features
- Settings: NodePathSelector to browse a Node.js folder, show
version/“Not found” status, and reset to system PATH (persists
customNodePath).
- Setup banner: manual config flow with a folder picker if Node is
already installed.
- IPC: select-node-folder, set-node-path, get-node-path; reloads env and
prepends custom path to PATH.
- Real-time Node.js status check with visual indicator (CheckCircle on
valid).
- E2E tests for browse, reset, and valid-status display.
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Refines the setup banner UI (copy, layout, and badges), updates
SetupProviderCard to support a chip and typed subtitle, and adjusts e2e
to new OpenRouter button label.
>
> - **UI/Setup Banner (`src/components/SetupBanner.tsx`)**:
> - Rename step title to `2. Setup AI Access` and update helper copy.
> - Layout: show `google` and `openrouter` cards side-by-side; increase
title font sizes.
> - Add badges: `chip={Free}` on Google/OpenRouter; `chip={Recommended}`
on Dyad Pro.
> - Simplify Dyad Pro `subtitle` to a string; remove `GlobeIcon` usage.
> - "Other providers" card: tweak heading size and copy (remove
`OpenRouter`).
> - `OpenRouterSetupBanner`: use `chip` for "Free models available"
instead of `subtitle`.
> - **Component API (`src/components/SetupProviderCard.tsx`)**:
> - Add optional `chip` prop and render top-right badge.
> - Change `subtitle` type to `string`; adjust styles (relative
container, font sizes).
> - **E2E (`e2e-tests/setup.spec.ts`)**:
> - Update button selector to `Setup OpenRouter API Key` (remove
`Free`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
991807b2edd4baa7a8ec7f4d47f867ba058ebf36. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
- Move edit and delete actions from hidden popover to visible buttons
- Restructure card layout: status badge and action buttons at top, title
below
<img width="1029" height="414" alt="image"
src="https://github.com/user-attachments/assets/60497f87-254e-4f4d-9f8c-ea73b8f2526e"
/>
closes#1358
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Made edit and delete always visible on custom provider cards and
restructured the card layout for clearer actions and status. Improves
discoverability and aligns with #1358.
- **Refactors**
- Replaced popover menu with visible Edit and Delete icon buttons
(data-testid: edit-custom-provider, delete-custom-provider).
- Moved status badge and actions to the top; title now sits below;
badges don’t wrap.
- Updated e2e tests to use new buttons and adjusted selectors for the
updated heading.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds Supabase database branch selection per app, with a new schema field
and UI to choose a branch after connecting a project. Resets branch when
changing or disconnecting the project to keep state consistent.
- **New Features**
- Added apps.supabase_branch_id column.
- Branch dropdown in SupabaseConnector shown after a project is
connected; selection persists and triggers app refresh.
- New state and hooks: supabaseBranchesAtom, loadBranches(projectId),
setAppBranch(branchId).
- IPC endpoints: supabase:list-branches and supabase:set-app-branch;
setting/unsetting project also clears the branch.
- **Migration**
- Apply drizzle migration 0013_supabase_branch.sql to add the
supabase_branch_id column (defaults to null).
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds Supabase database branch selection per app, including parent
project tracking, new IPC endpoints, UI dropdown, and an accompanying DB
migration with e2e tests.
>
> - **Database**:
> - Add `apps.supabase_parent_project_id` via migration
`drizzle/0015_complete_old_lace.sql`; snapshot and journal updated.
> - **IPC/Main**:
> - New `supabase:list-branches` handler and management client
`listSupabaseBranches` (real API + test stubs).
> - Update `supabase:set-app-project` to accept `{ projectId,
parentProjectId?, appId }`; unset clears both IDs.
> - `get-app` resolves `supabaseProjectName` using
`supabase_parent_project_id` when present.
> - **Types & Client**:
> - Add `SupabaseBranch`, `SetSupabaseAppProjectParams`, and
`App.supabaseParentProjectId`; expose `listSupabaseBranches` and updated
`setSupabaseAppProject` in `ipc_client` and preload whitelist.
> - **UI/Hooks**:
> - Supabase UI: branch dropdown in `SupabaseConnector` with
`loadBranches`, selection persists via updated `setAppProject`.
> - State: add `supabaseBranchesAtom`; `useSupabase` gets `branches`,
`loadBranches`, new param shape for `setAppProject`.
> - TokenBar/ChatInput: add `data-testid` for token bar and toggle.
> - **Supabase Context (tests)**:
> - Test build returns large context for `test-branch-project-id` to
validate branch selection.
> - **E2E Tests**:
> - Add `supabase_branch.spec.ts` and snapshot verifying branch
selection affects token usage.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
33054278db8396b4371ed6e8224105cb5684b7ac. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Always route Dyad Pro through the Dyad engine (no gateway), simplify
logging/flags, and remove DYAD_GATEWAY usage and staging gateway script.
>
> - **Engine/Model client (`src/ipc/utils/get_model_client.ts`)**:
> - Always use `createDyadEngine` when Dyad Pro is enabled; remove
gateway fallback and `DYAD_GATEWAY_URL` usage.
> - Simplify logs to engine-only; drop conditional gateway/engine
logging.
> - Always set `isEngineEnabled: true`; pass `{ files }` to the provider
unconditionally; strip `:free` from model names.
> - **Scripts (`package.json`)**:
> - Remove `staging:gateway` script.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5fdbbb703c47de4623ceeb82e6678ace34dc268e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Summary
Adds the ability to import GitHub repositories directly into Dyad from
the home screen, complementing the existing local folder import feature.
- GitHub Import Modal: New modal accessible from home screen via "Import
from Github" button with two Import methods
- Select project from GitHub repositories list
- Clone from any GitHub URL
- Advanced Options: Optional custom install/start commands (defaults to
project's package.json scripts)
- Auto AI_RULES Generation: Automatically generates AI_RULES.md if not
present in imported repo
closes#1424
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a GitHub import flow from the home screen so users can clone repos
via their list or any URL, with optional install/start commands and
automatic AI_RULES.md generation. Addresses Linear #1424 by enabling
seamless project setup from GitHub.
- **New Features**
- Import modal with two tabs: Your Repositories and From URL.
- Advanced options for install/start commands with validation; defaults
used when both are empty.
- After cloning, navigate to chat and auto-generate AI_RULES.md if
missing.
- New IPC handler github:clone-repo-from-url with token auth support,
plus IpcClient method and preload channel.
- E2E tests cover modal open, auth, import via URL/repo list, and
advanced options.
- **Dependencies**
- Added @radix-ui/react-tabs for the modal tab UI.
<!-- End of auto-generated description by cubic. -->
This PR implements favorite apps feature and addresses issue #827
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a favorite apps feature with a star toggle in the sidebar.
Favorites are grouped separately and persisted, with optimistic UI
updates and e2e tests.
- **New Features**
- Added isFavorite to the apps schema and an IPC handler
(add-to-favorite) to toggle and persist the state.
- Updated AppList to show “Favorite apps” and “Other apps” sections.
- Introduced AppItem component with a star button; uses
useAddAppToFavorite for optimistic updates and toasts.
- Added Playwright tests to verify favoriting and unfavoriting.
- **Migration**
- Run DB migrations to add the apps.is_favorite column (defaults to 0).
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Send mentioned apps (names + files) to the engine through
dyad_options, omit inline other-apps prefix when engine is enabled, and
adjust e2e to snapshot request payload.
>
> - **Engine/Backend**:
> - Pass mentioned apps to engine via
`providerOptions['dyad-engine'].dyadMentionedApps` and forward as
`dyad_options.mentioned_apps` in `llm_engine_provider`.
> - Gate inline other-apps context: only include `otherCodebasePrefix`
when `isEngineEnabled` is false.
> - Enhance `extractMentionedAppsCodebases` to return `files` alongside
`codebaseInfo`.
> - **Tests**:
> - e2e: change `mention app (with pro)` snapshot to
`snapshotServerDump("request")` and update snapshot to assert request
payload contents.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7ddddf6c16c53cd36b4c7e4ec6a57da0616d1bb0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
# Changes
- Update Azure configuration components to manage API key and resource
name settings.
- Improve visibility of conThis pull request introduces a redesigned
Azure provider settings UI and refactors the logic for configuring Azure
OpenAI credentials, both in the frontend and supporting hooks. The main
changes focus on making the Azure configuration experience clearer and
more robust by supporting both environment variable and saved settings,
improving status indicators, and updating the logic for determining
provider readiness.
**Azure Provider UI and Logic Improvements**
* Added a new `AzureConfiguration` component that provides a dedicated
form for entering and saving Azure resource name and API key, with clear
status indicators and error handling. The UI now explains precedence
between saved settings and environment variables, and guides users
through configuration.
(`src/components/settings/AzureConfiguration.tsx`)
* Updated the main provider settings page and API key configuration
logic to pass Azure-specific settings and update functions to the new
component, ensuring seamless integration and correct state management.
(`src/components/settings/ApiKeyConfiguration.tsx`,
`src/components/settings/ProviderSettingsPage.tsx`)
[[1]](diffhunk://#diff-2104fb487cda3768cc5777889100e882f51e7fb3e13abe3cc89cf8ed1444300aR35)
[[2]](diffhunk://#diff-2104fb487cda3768cc5777889100e882f51e7fb3e13abe3cc89cf8ed1444300aR51-R61)
[[3]](diffhunk://#diff-9140e707ebb56ffed3272b4661ea1e6d8388ee604a8535c58e8a1564d280057cR297)
* Refactored the logic for determining whether Azure is configured to
check both saved settings and environment variables, ensuring accurate
status display and enabling fallback to environment variables if no
settings are saved. (`src/components/settings/ProviderSettingsPage.tsx`,
`src/hooks/useLanguageModelProviders.ts`)
[[1]](diffhunk://#diff-9140e707ebb56ffed3272b4661ea1e6d8388ee604a8535c58e8a1564d280057cL72-R99)
[[2]](diffhunk://#diff-9ac9e279a0cda34a0bc519348d5474b2e355b0828a678495be3af1e8984b5be5R35-R48)
* Updated the Azure provider E2E test to verify the new UI elements,
status indicators, and guidance, ensuring the test matches the new
configuration flow and messaging.
(`e2e-tests/azure_provider_settings.spec.ts`)
**Supporting Type and Import Updates**
* Added and updated type imports for `AzureProviderSetting` and
`VertexProviderSetting` where needed to support the new logic and UI.
(`src/components/settings/ProviderSettingsPage.tsx`,
`src/hooks/useLanguageModelProviders.ts`,
`src/ipc/utils/get_model_client.ts`)
[[1]](diffhunk://#diff-9140e707ebb56ffed3272b4661ea1e6d8388ee604a8535c58e8a1564d280057cL14-R14)
[[2]](diffhunk://#diff-9ac9e279a0cda34a0bc519348d5474b2e355b0828a678495be3af1e8984b5be5L5-R5)
[[3]](diffhunk://#diff-3cd526c6c10413c1387bfef450e48b880ba6f54865e96046044586ff4192bcceR15)
* Changed Azure model client import to use `createAzure` for consistency
and future extensibility. (`src/ipc/utils/get_model_client.ts`)
[Copilot is generating a summary...]figuration status and error handling
in the UI.
- Refactor environment variable checks to prioritize saved settings.
- Add support for Azure provider settings in the schema.
- Modify tests to reflect changes in Azure configuration requirements.
# Changes in short
- **Azure settings panel**
- Replaced with a full form that:
- Persists API key and resource name
- Surfaces save state
- Keeps the environment-variable helper
- *(src/components/settings/AzureConfiguration.tsx:23-214)*
- **Settings stack workflow**
- Threaded the new Azure workflow:
- Config shim now passes `updateSettings`
- Provider status checks prefer saved Azure values before env vars
- *(src/components/settings/ApiKeyConfiguration.tsx:40-55,
src/components/settings/ProviderSettingsPage.tsx:60-105)*
- **Provider detection**
- Azure treated like other saved credentials by:
- Looking for both stored fields, or
- The pair of env vars
- *(src/hooks/useLanguageModelProviders.ts:5-57)*
- **Back-end model creation**
- Reads saved Azure credentials (falling back to env vars)
- Builds the client via `createAzure`
- *(src/ipc/utils/get_model_client.ts:316-369)*
- **Provider schema support**
- Extended so Azure can store its resource name alongside the secret
- *(src/lib/schemas.ts:82-109)*
- **E2E tests**
- Updated Azure Playwright spec to cover the new UI
- *(e2e-tests/azure_provider_settings.spec.ts:4-50)*
Issues resolved: #1275
Fixes#1405
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds GPT-5 Codex (OpenAI and Azure) and Claude 4.5 Sonnet to the model
options to enable newer coding models and larger contexts. Also
increases Claude 4 Sonnet max output tokens to 32k.
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds GPT‑5 Codex (OpenAI/Azure) and Claude 4.5 Sonnet, and increases
Claude 4 Sonnet max output tokens to 32k across providers and tests.
>
> - **Models**:
> - **OpenAI**: add `gpt-5-codex` (400k context, default temp 1).
> - **Anthropic**:
> - add `claude-sonnet-4-5-20250929` (1M context, `maxOutputTokens:
32_000`).
> - update `claude-sonnet-4-20250514` `maxOutputTokens` from `16_000` to
`32_000`.
> - **Azure**: add `gpt-5-codex` (400k context, `maxOutputTokens:
128_000`).
> - **Bedrock**:
> - add `us.anthropic.claude-sonnet-4-5-20250929-v1:0` (1M context,
`maxOutputTokens: 32_000`).
> - update `us.anthropic.claude-sonnet-4-20250514-v1:0`
`maxOutputTokens` to `32_000`.
> - **E2E tests**:
> - Update snapshots to reflect `max_tokens` increased to `32000` for
`anthropic/claude-sonnet-4-20250514` in engine and gateway tests.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
73298d2da0c833468f957bb436f1e33400307483. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Fixes#912
This PR implements disabling send button while approval is pending and
addresses issue #912
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Disable the chat send button while a proposal is awaiting approval, and
re-enable it after approve or reject. Prevents accidental messages
during pending changes. Addresses issue #912.
- **New Features**
- Track pending changes with isChangesPending based on the last
assistant message’s approvalState.
- Disable the send button when a proposal is pending (in addition to the
existing empty input check).
- Re-enable after approve/reject by refreshing the proposal and
messages.
- Added Playwright e2e tests for both approve and reject flows.
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Disable the chat send button when a code proposal is pending approval
and re-enable after approve/reject; add e2e coverage and update MCP
flow.
>
> - **Frontend**
> - `ChatInput.tsx`: Read `messages` from `chatMessagesAtom` and derive
`disableSendButton` when the last assistant message (matching
`proposal.messageId`) has no `approvalState` and `proposal.type ===
"code-proposal"`.
> - Apply `disableSendButton` to the send button’s `disabled` condition
(in addition to empty input/attachments).
> - Ensure proposal/messages refresh after approve/reject.
> - **Tests**
> - Add Playwright tests `e2e-tests/chat_input.spec.ts` to verify send
button disabled during pending proposal and re-enabled after approve or
reject.
> - Update `e2e-tests/mcp.spec.ts` to click "Approve" after granting
consent.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b9b47bd6f547449cc5cf1d39a00e4e7fb5de1bcd. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Will Chen <willchen90@gmail.com>
## Summary
Adds AI response copy functionality to chat messages that preserves
formatting and converts Dyad-specific tags to clean, readable markdown.
## Changes
- **New `useCopyToClipboard` hook**: Parses Dyad tags and converts them
to professional markdown format
- **Updated `ChatMessage` component**: Positions copy button on left
side of approval status
- **Dyad tag conversion**: Transforms custom tags to readable format:
- `<dyad-write>` → `### File: path/to/file.js` + code block
- `<dyad-edit>` → `### Edit: path/to/file.js` + code block
- `<dyad-execute-sql>` → `### Execute SQL` + ```sql block
- `<think>` → `### Thinking` + content
## Features
- ✅ Automatic programming language detection from file extensions
- ✅ Professional markdown formatting with proper headings and code
blocks
- ✅ Tooltip showing "Copied" confirmation
- ✅ Reuses existing DyadMarkdownParser logic for consistency
closes (#1290)
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a Copy button to assistant messages that copies a clean Markdown
version of the response by converting Dyad tags and preserving code
blocks. Improves shareability and removes Dyad-only markup; addresses
Linear #1290.
- **New Features**
- Added useCopyToClipboard hook that parses Dyad tags to Markdown,
auto-detects code language, and cleans spacing.
- Updated ChatMessage to show a Copy button (with Copy/Copied tooltip)
to the left of approval status; disabled while streaming.
- Tag conversions: think → "### Thinking"; dyad-write/edit → "###
File/Edit: path" + fenced code; dyad-execute-sql → "### Execute SQL" +
sql block; other Dyad tags map to concise headings; chat-summary/command
are omitted.
- Added e2e tests for clipboard copy, Dyad tag stripping/formatting, and
tooltip states.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixes MCP handoff by detecting an edit-code tool call and stopping
generation. Simplifies the title bar credit tooltip; also blocks dyad-*
tags in the system prompt and updates tests.
- **Bug Fixes**
- Stop generation on edit-code via hasToolCall; add a no-op edit-code
tool to signal handoff.
- Combine tool-call stop with existing step limit for reliability.
- Forbid <dyad-*> tags in the system prompt to prevent misuse.
- Remove credit usage/reset details from the title bar tooltip; keep the
delay note.
- Update e2e snapshot to reflect the new prompt rule.
<!-- End of auto-generated description by cubic. -->
This PR implements app search feature and addresses the issue #1182.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a fast app search with a command-style dialog so users can find
apps by name or chat content and jump to them quickly. Implements the
search experience requested in #1182.
- New Features
- Search dialog (Ctrl+K or “Search Apps” button) with result snippets
from matching chat titles/messages.
- Searches across app names, chat titles, and message content;
case-insensitive; supports partial matches; empty query lists all apps.
- Selecting a result navigates to the app and closes the dialog.
- New IPC endpoint search-app with Zod-validated results, debounced
React Query hook, and preload allowlist update.
- Added E2E tests for dialog open/close, shortcuts, matching behavior,
empty state, and navigation.
<!-- End of auto-generated description by cubic. -->
## 🚀 Feature: Inline Code Editor
This PR adds a comprehensive inline code editing experience to the
DyadWrite component.
### ✨ What's New
- **Inline Monaco Editor**: Edit code directly within the component
using Monaco Editor
- **Cancel/Revert**: Cancel changes and revert to original code state
- **Language Detection**: Automatic syntax highlighting based on file
extensions
- **Theme Support**: Proper dark/light mode theming integration
https://github.com/user-attachments/assets/c44ab622-6b86-403c-904d-3f327f9719e8
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds an inline Monaco-based code editor to DyadWrite so users can edit
code blocks in place, then save or cancel changes. Saves stream edits
back to the chat as a dyad-edit block.
- **New Features**
- Inline editor with Edit, Save, and Cancel; preserves original code and
auto-expands when editing.
- Language detection from file extension and dark/light theme support.
- Save streams edits via useStreamChat as <dyad-edit
path="...">...</dyad-edit> tied to the selected chat.
- Non-edit view still uses CodeHighlight; visibility toggle and
in-progress state respected.
- **Refactors**
- ChatMessage now uses DyadMarkdownParser instead of
VanillaMarkdownParser.
<!-- End of auto-generated description by cubic. -->
## Summary
Adds the ability to edit existing custom AI providers through the
settings UI.
## Changes Made
- **UI Changes:**
- Added "Edit Provider" button to custom provider dropdown menu
- Modified `CreateCustomProviderDialog` to support edit mode
- **Backend Changes:**
- Implemented `editCustomLanguageModelProvider` handler in
`language_model_handlers.ts`
- Added corresponding IPC client method
- Database transaction ensures atomicity when updating provider and
associated models
- **Testing:**
- Added comprehensive e2e test covering edit functionality
- Tests verify form pre-population, field updates, and UI persistence
https://github.com/user-attachments/assets/e8c8600e-4fb7-4816-be95-993ede1224d4
## Closes
Fixes#1232 and #1171
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds edit support for custom language model providers in Settings. Users
can update provider ID, name, API base URL, and API key env var, with
safe backend updates that also retarget associated models if the ID
changes.
- New Features
- Added “Edit Provider” option in the custom provider menu.
- Dialog supports edit mode with pre-filled fields, unified loading
state, and update button text.
- New IPC handler to edit providers with validation and a transaction;
updates linked models when IDs change.
- IPC client and preload channel updated; React hook exposes
editProvider mutation with cache invalidation.
- Added e2e test covering the full edit flow.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Scoped Azure e2e test env setup to prevent leaking variables across
tests. Added testWithConfigSkipIfWindows and moved Azure env vars into a
per-test preLaunchHook; the Azure test now skips on Windows.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added OpenRouter as a first-class option in the setup banner and
introduced a reusable provider card component. This streamlines provider
selection and adds E2E coverage for the setup flow.
- **New Features**
- Added SetupProviderCard and used it for Google and OpenRouter in
SetupBanner.
- Clicking Google or OpenRouter routes to the correct provider settings
and logs PostHog events.
- Kept “Other providers” link to Settings.
- Added setup.spec.ts E2E test to verify Google, OpenRouter, and Other
navigation; introduced test config flag showSetupScreen to control the
OPENAI_API_KEY shortcut.
<!-- End of auto-generated description by cubic. -->
Based on https://github.com/dyad-sh/dyad/pull/1116
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a fast chat search dialog (Command Palette) to find and jump
between chats. Open via the sidebar button or Ctrl/Cmd+K, with title and
message text search plus inline snippets.
- New Features
- Command palette using cmdk with keyboard shortcut (Ctrl/Cmd+K).
- Searches within the selected app across chat titles and message
content via a new IPC route (search-chats).
- Debounced queries (150ms) with React Query; results de-duplicated and
sorted by newest.
- Snippet preview with highlighted matches and custom ranking; selecting
a result navigates and closes the dialog.
- Search button added to ChatList; basic e2e tests added (currently
skipped).
- Dependencies
- Added cmdk@1.1.1.
- Bumped @radix-ui/react-dialog to ^1.1.15 and updated Dialog to support
an optional close button.
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by: Evans Obeng <iamevansobeng@outlook.com>
Co-authored-by: Evans Obeng <60653146+iamevansobeng@users.noreply.github.com>
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Set “balanced” as the default smart context mode. Users now get balanced
when Smart Files Context is enabled and no mode is set; “conservative”
must be explicitly selected.
- **Refactors**
- Default fallback to balanced in UI and engine (proSmartContextOption
undefined -> "balanced").
- ProModeSelector saves "conservative" explicitly; selector reads
undefined as balanced.
- Updated schema and types to allow "balanced" | "conservative".
- Engine payload now includes smart_context_mode with "balanced" by
default; e2e tests and snapshots updated.
- **Migration**
- No action needed. Existing users without an explicit mode will use
balanced by default; selecting conservative persists.
<!-- End of auto-generated description by cubic. -->
1. Show less common AI providers (secondary) in submenu
2. Show $ signs for rough cost guide
3. Show "Pro" for supported AI providers with Pro is enabled
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Improves the Model Picker UX by grouping less-used providers under an
“Other AI providers” submenu and adding clear cost and Pro indicators.
This makes picking models faster and more informative.
- **New Features**
- Grouped secondary providers under “Other AI providers” using a new
provider.secondary flag (Azure marked secondary).
- Added rough cost hints: models can set dollarSigns and the UI shows a
“$” badge accordingly.
- Shows a “Pro” badge on supported cloud providers when Pro is enabled;
added a “Custom” badge for custom providers.
- Extended types: LanguageModelProvider.secondary and
LanguageModel.dollarSigns; populated values across OpenAI, Anthropic,
Google, and OpenRouter.
<!-- End of auto-generated description by cubic. -->
This allows almost all the iframe sandbox tokens
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#sandbox
except notably for allow-top-navigation*
Note: allow-same-origin should be OK because the main window is under
the `file://` origin while the iframe window is served on
`localhost:####`
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Enable sandboxing on the preview iframe to isolate preview content while
preserving needed capabilities (allow-same-origin, scripts, forms,
popups, modals, orientation/pointer lock, presentation, downloads).
Top-level navigation remains disallowed; allow-same-origin is safe
because the app is file:// and the iframe runs on localhost.
<!-- End of auto-generated description by cubic. -->
Fixes#710
This PR implements comprehensive Azure OpenAI integration for Dyad,
enabling users to leverage Azure
OpenAI models through proper environment variable configuration. The
implementation adds Azure as a
supported provider with full integration into the existing language
model architecture, including support
for GPT-5 models. Key features include environment-based
configuration using `AZURE_API_KEY` and `AZURE_RESOURCE_NAME`,
specialized UI components that provide clear
setup instructions and status indicators, and seamless integration with
Dyad's existing provider system.
The Azure provider leverages the @ai-sdk/azure package (v1.3.25) for
compatibility with the current
TypeScript language model interfaces.
The implementation includes robust error handling for missing
configuration, comprehensive test coverage
with 9 new unit tests covering critical functionality like model client
creation and error scenarios, and
an E2E test for the Azure-specific settings UI.
<img width="1510" height="908" alt="Screenshot 2025-08-18 at 9 14 32 PM"
src="https://github.com/user-attachments/assets/04aa99e1-1590-4bb0-86c9-a67b97bc7500"
/>
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Will Chen <willchen90@gmail.com>
Fixes#1037
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Enable JSON file support in codebase scanning so common configs and data
(e.g., package.json, vercel.json, translations) are included. Adds .json
to the allowed extensions and removes special-casing for
package.json/vercel.json.
<!-- End of auto-generated description by cubic. -->
Fixes#554#1049
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Stop mutating package.json when reading files. readFileWithCache now
returns raw content so all fields are preserved (e.g., packageManager).
Fixes#554 and #1049.
- **Bug Fixes**
- Removed package.json "cleaning" logic and the cleanContent helper.
- Return and cache unmodified file content from both fs and
virtualFileSystem.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Parameterized the system prompt and tokenized it in e2e dumps to make
snapshots smaller and stable. No runtime behavior changes; future prompt
edits won’t churn tests.
- **Refactors**
- Exported BUILD_SYSTEM_PREFIX and BUILD_SYSTEM_POSTFIX from
system_prompt.ts.
- Updated test_helper to replace the full prompt with
${BUILD_SYSTEM_PREFIX}/${BUILD_SYSTEM_POSTFIX} tokens in message dumps.
- Regenerated e2e snapshots to use tokens, reducing ~270 lines per
snapshot.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds Smart Context v3 with selectable modes (Off, Conservative,
Balanced) and surfaces token savings in chat. Also improves token
estimation by counting per-file tokens when Smart Context is enabled.
- **New Features**
- Smart Context selector in Pro settings with three options.
Conservative is the default when enabled without an explicit choice.
- New setting: proSmartContextOption ("balanced"); undefined implies
Conservative.
- Engine now receives enable_smart_files_context and smart_context_mode.
- Chat shows a DyadTokenSavings card when the message contains
token-savings?original-tokens=...&smart-context-tokens=..., with percent
saved and a tooltip for exact tokens.
- Token estimation uses extracted file contents for accuracy when Pro +
Smart Context is on; otherwise falls back to formatted codebase output.
<!-- End of auto-generated description by cubic. -->