<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Enhances AI stream error logging to include request ID and detailed
error info in `chat_stream_handlers.ts`.
>
> - **Backend**
> - **Logging**: In `src/ipc/handlers/chat_stream_handlers.ts` `onError`
handler for `streamText` now logs a detailed message including request
ID and `errorMessage`, replacing the previous generic error log.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3519f494e8e400403973f014cede9ff771d5a9ad. 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
Improve error logging in chat text streaming by replacing the generic
log with a structured entry that includes the request ID (when
available), the parsed error message, and the full error object. This
makes failures easier to trace and correlate with backend requests.
<sup>Written for commit 3519f494e8e400403973f014cede9ff771d5a9ad.
Summary will update automatically on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Show the upgrade button only for AI streaming errors by checking a
shared error prefix; introduce and use a shared constant for consistent
error messages.
>
> - **Chat UI**
> - Update `ChatErrorBox.tsx` to display "Upgrade to Dyad Pro" only when
`error` includes `AI_STREAMING_ERROR_MESSAGE_PREFIX` and user is not Pro
(still hides on `TypeError: terminated`).
> - **IPC/Streaming**
> - In `chat_stream_handlers.ts`, prefix emitted streaming errors with
`AI_STREAMING_ERROR_MESSAGE_PREFIX` instead of hardcoded text for
consistency.
> - **Shared**
> - Add `AI_STREAMING_ERROR_MESSAGE_PREFIX` in `src/shared/texts.ts` and
import where needed.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
83b1aa3555a3c1e710ee644f7bfb64cabc0ff5e6. 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
Enable the Dyad Engine to prioritize a user-selected component by
flagging the file as focused and sending codebase files per request.
Keeps full context when the engine is on; falls back to path-scoped
context when it’s off.
- **New Features**
- Mark the selected component file as focused when the engine is
enabled.
- Send codebase files to the engine via dyadFiles, applied to
dyad_options unless disabled.
- Maintain full chatContext with engine; restrict to the selected file
path only when engine is off.
- **Refactors**
- Removed files from getModelClient and provider APIs; file transport
moved into request payload.
- Stream handlers now pass files to model calls and include
dyadDisableFiles/dyadFiles in the request.
- Added focused flag to CodebaseFile.
<!-- End of auto-generated description by cubic. -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Sends codebase files per request to the Dyad Engine, focuses the
selected component when smart context is enabled, and refactors model
client/provider APIs to remove file parameters.
>
> - **Engine integration**:
> - Send codebase files per request via `dyadFiles` in provider options;
propagate through `simpleStreamText` and `dyad-engine` options.
> - Add `isSmartContextEnabled` from `get_model_client` and gate context
behavior accordingly.
> - **Selected component focus**:
> - When smart context is on and a component is selected, mark its file
as `focused` in `CodebaseFile` and avoid broad smart context includes;
allow on-demand reads.
> - When smart context is off, restrict `chatContext` to the selected
file path.
> - **Refactors**:
> - Remove `files` parameter from `getModelClient` and Dyad provider;
move file transport into request body.
> - Update `llm_engine_provider` to read `dyadFiles` from request and
populate `dyad_options.files` unless `dyadDisableFiles`.
> - Extend `CodebaseFile` with optional `focused` flag; thread `files`
through `chat_stream_handlers` calls.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
022b26d0197ab5b5d4f5b589f45bc230de36e0e5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- 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 -->
<!-- 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. -->
… provider)
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Enables 1M-token context for Anthropic Claude 4 Sonnet and marks AWS
Bedrock as a secondary provider. Adds the required Anthropic beta header
and updates model metadata and pricing indicator.
- **New Features**
- Send header anthropic-beta: context-1m-2025-08-07 when using the
Anthropic provider.
- Update Claude 4 Sonnet configs: contextWindow to 1,000,000; add cost
warning; increase pricing tier to 5 (applies to Anthropic and Bedrock
model IDs).
- Set AWS Bedrock as a secondary provider.
<!-- End of auto-generated description by cubic. -->
- [x] Update chat_stream_handlers
- [x] Update token handlers
- [x] Update HomeChatInput
- [x] update lexical chat input: do not allow referencing same app
(current app, or other already selected apps)
- [x] I don't think smart context will work on this...
- [x] Enter doesn't clear...
TODOs:
- [x] Do restart when checkout / restore if there is a DB
- [x] List all branches (branch id, name, date)
- [x] Allow checking out versions with no DB
- [x] safeguard to never delete main branches
- [x] create app hook for neon template
- [x] weird UX with connector on configure panel
- [x] tiny neon logo in connector
- [x] deploy to vercel
- [x] build forgot password page
- [x] what about email setup
- [x] lots of imgix errors
- [x] edit file - db snapshot
- [x] DYAD_DISABLE_DB_PUSH
- [ ] update portal doc
- [x] switch preview branch to be read-only endpoint
- [x] disable supabase sys prompt if neon is enabled
- [ ] https://payloadcms.com/docs/upload/storage-adapters
- [x] need to use main branch...
Phase 2?
- [x] generate DB migrations
Test cases:
- [x] create-ts-errors
- [x] with auto-fix
- [x] without auto-fix
- [x] create-unfixable-ts-errors
- [x] manually edit file & click recheck
- [x] fix all
- [x] delete and rename case
THINGS
- [x] error handling for checkProblems isn't working as expected
- [x] make sure it works for both default templates (add tests)
- [x] fix bad animation
- [x] change file context (prompt/files)
IF everything passes in Windows AND defensive try catch... then enable
by default
- [x] enable auto-fix by default
This uses Gemini's native [thinking
summaries](https://cloud.google.com/vertex-ai/generative-ai/docs/thinking#thought-summaries)
which were recently added to the API.
Why? The grafted thinking would sometimes cause weird issues where the
model, especially Gemini 2.5 Flash, got confused and put dyad tags like
`<dyad-write>` inside the `<think>` tags.
This also improves the UX because you can see the native thoughts rather
than having the Gemini response load for a while without any feedback.
I tried adding Anthropic extended thinking, however it requires temp to
be set at 1, which isn't ideal for Dyad's use case where we need precise
syntax following.
- [x] add e2e test - happy case (make sure it clears selection and next
prompt is empty, and preview is cleared); de-selection case
- [x] shim - old & new file
- [x] upgrade path
- [x] add docs
- [x] add try-catch to parser script
- [x] make it work for next.js
- [x] extract npm package
- [x] make sure plugin doesn't apply in prod
This code was quite complex and hairy and resulted in very opaque errors
(for both free and pro users). There's not much benefit to budget saver
because Google removed 2.5 Pro free quota a while ago (after it
graduated the model from experimental to preview). Dyad Pro users can
still use 2.5 Flash free quota by disabling Dyad Pro by clicking on the
Dyad Pro button at the top.
Whenever Dyad does a commit from a proposal, it will automatically amend
the commit with outside changes (e.g. made outside of Dyad).
This helps avoid a lot of user confusion, e.g.
https://github.com/dyad-sh/dyad/issues/187https://www.reddit.com/r/dyadbuilders/comments/1kjysc0/error_pushing_images/
Edge cases:
If a user adds a file outside of Dyad, and then they hit retry, it will
revert these outside changes, but it's still technically in the version
history, so I think it's OK. This should also be a pretty unusual
situation.
Fixes#164Fixes#187