Fixes#1364
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Refreshes the Supabase prompt’s login state example to use the latest
onAuthStateChange event handling and unsubscribe pattern.
>
> - **Prompts**:
> - **Supabase system prompt (`src/prompts/supabase_prompt.ts`)**:
> - Revise login state management example to use
`supabase.auth.onAuthStateChange` with explicit events:
`INITIAL_SESSION`, `SIGNED_IN`, `SIGNED_OUT`, `PASSWORD_RECOVERY`,
`TOKEN_REFRESHED`, `USER_UPDATED`.
> - Update unsubscribe usage to `data.subscription.unsubscribe()` and
remove outdated async/getSession snippet.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
239d20769a02d102d168126f973a6cb4bf6d9e48. 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. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds support for free OpenRouter models and a new “Free (OpenRouter)”
auto option that fails over across free models for reliability. Improves
setup flow and UI with provider cards, a “Free” price badge, and an
OpenRouter setup prompt in chat.
- **New Features**
- Added OpenRouter free models: Qwen3 Coder (free), DeepSeek v3 (free),
DeepSeek v3.1 (free), marked with dollarSigns=0 and a “Free” badge.
- New auto model: “Free (OpenRouter)” that uses a fallback client to
cycle through free models with smart retry on transient errors.
- New SetupProviderCard component and updated SetupBanner with dedicated
Google and OpenRouter setup cards.
- Chat shows an OpenRouter setup prompt when “Free (OpenRouter)” is
selected and OpenRouter isn’t configured.
- New PriceBadge component in ModelPicker to display “Free” or price
tier.
- E2E: added setup flow test and option to show the setup screen in
tests.
- Model updates: added DeepSeek v3.1, updated Kimi K2 to kimi-k2-0905,
migrated providers to LanguageModelV2.
<!-- End of auto-generated description by cubic. -->
The prompt text says:
> - Use TypeScript.
But in the examples there are .jsx files.
I got errors sometimes (in my fork with other changes too) that JSX got
generated instead of TSX. This seems to have fixed it for me.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Updated system prompt examples to use .tsx/.ts instead of .jsx/.js,
matching the “Use TypeScript” instruction. This prevents JSX drift and
reduces cases where generated code uses JSX instead of TSX.
<!-- End of auto-generated description by cubic. -->
fixes#1010
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Disable automatic JWT verification for Supabase Edge Functions and
update prompts/templates to require and demonstrate manual auth
handling. Fixes#1010.
- **Bug Fixes**
- Set verify_jwt: false in function deployment.
- Updated Supabase prompt with an Authentication section and guidance to
manually verify tokens.
- Adjusted the hello function template to check the Authorization header
and return 401 when missing.
<!-- 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 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.