Unverified 提交 30b5c0d0 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Replace thinking with native Gemini thinking summaries (#400)

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.
上级 3a6ab12b
...@@ -11,15 +11,29 @@ testSkipIfWindows("send message to engine", async ({ po }) => { ...@@ -11,15 +11,29 @@ testSkipIfWindows("send message to engine", async ({ po }) => {
await po.snapshotMessages({ replaceDumpPath: true }); await po.snapshotMessages({ replaceDumpPath: true });
}); });
testSkipIfWindows("send message to gateway", async ({ po }) => { testSkipIfWindows("send message to engine - openai gpt-4.1", async ({ po }) => {
await po.setUpDyadPro(); await po.setUpDyadPro();
await po.selectModel({ provider: "Google", model: "Gemini 2.5 Flash" }); // By default, it's using auto which points to Flash 2.5 and doesn't
await po.sendPrompt("[dump] tc=gateway-simple"); // use engine.
await po.selectModel({ provider: "OpenAI", model: "GPT 4.1" });
await po.sendPrompt("[dump] tc=turbo-edits");
await po.snapshotServerDump("request"); await po.snapshotServerDump("request");
await po.snapshotMessages({ replaceDumpPath: true });
}); });
testSkipIfWindows(
"send message to engine - anthropic claude sonnet 4",
async ({ po }) => {
await po.setUpDyadPro();
// By default, it's using auto which points to Flash 2.5 and doesn't
// use engine.
await po.selectModel({ provider: "Anthropic", model: "Claude 4 Sonnet" });
await po.sendPrompt("[dump] tc=turbo-edits");
await po.snapshotServerDump("request");
},
);
// auto (defaults to Gemini 2.5 Flash) // auto (defaults to Gemini 2.5 Flash)
testSkipIfWindows("auto should send message to gateway", async ({ po }) => { testSkipIfWindows("auto should send message to gateway", async ({ po }) => {
await po.setUpDyadPro(); await po.setUpDyadPro();
......
import { testSkipIfWindows } from "./helpers/test_helper";
testSkipIfWindows("gemini 2.5 flash", async ({ po }) => {
// Note: we do not need to disable pro modes because 2.5 flash doesn't
// use engine.
await po.setUpDyadPro();
await po.selectModel({ provider: "Google", model: "Gemini 2.5 Flash" });
await po.sendPrompt("[dump] tc=gateway-simple");
await po.snapshotServerDump("request");
await po.snapshotMessages({ replaceDumpPath: true });
});
testSkipIfWindows("claude 4 sonnet", async ({ po }) => {
await po.setUpDyadPro();
// Disable the pro modes so it routes to gateway.
const proModesDialog = await po.openProModesDialog({
location: "home-chat-input-container",
});
await proModesDialog.toggleTurboEdits();
await proModesDialog.toggleSmartContext();
await proModesDialog.close();
await po.selectModel({ provider: "Anthropic", model: "Claude 4 Sonnet" });
await po.sendPrompt("[dump] tc=gateway-simple");
await po.snapshotServerDump("request");
});
...@@ -139,10 +139,14 @@ export class PageObject { ...@@ -139,10 +139,14 @@ export class PageObject {
}); });
} }
async openProModesDialog(): Promise<ProModesDialog> { async openProModesDialog({
location = "chat-input-container",
}: {
location?: "chat-input-container" | "home-chat-input-container";
} = {}): Promise<ProModesDialog> {
const proButton = this.page const proButton = this.page
// Assumes you're on the chat page. // Assumes you're on the chat page.
.getByTestId("chat-input-container") .getByTestId(location)
.getByRole("button", { name: "Pro", exact: true }); .getByRole("button", { name: "Pro", exact: true });
await proButton.click(); await proButton.click();
return new ProModesDialog(this.page, async () => { return new ProModesDialog(this.page, async () => {
...@@ -396,7 +400,7 @@ export class PageObject { ...@@ -396,7 +400,7 @@ export class PageObject {
async selectModel({ provider, model }: { provider: string; model: string }) { async selectModel({ provider, model }: { provider: string; model: string }) {
await this.page.getByRole("button", { name: "Model: Auto" }).click(); await this.page.getByRole("button", { name: "Model: Auto" }).click();
await this.page.getByText(provider).click(); await this.page.getByText(provider).click();
await this.page.getByText(model).click(); await this.page.getByText(model, { exact: true }).click();
} }
async selectTestModel() { async selectTestModel() {
......
- paragraph: basic - paragraph: basic
- 'button "Thinking `<dyad-write>`: I''ll think about the problem and write a bug report. <dyad-write> <dyad-write path=\"file1.txt\"> Fake dyad write </dyad-write>"':
- img
- img
- paragraph:
- code: "`<dyad-write>`"
- text: ": I'll think about the problem and write a bug report."
- paragraph: <dyad-write>
- paragraph: <dyad-write path="file1.txt"> Fake dyad write </dyad-write>
- img - img
- text: file1.txt - text: file1.txt
- img - img
......
- paragraph: basic - paragraph: basic
- 'button "Thinking `<dyad-write>`: I''ll think about the problem and write a bug report. <dyad-write> <dyad-write path=\"file1.txt\"> Fake dyad write </dyad-write>"':
- img
- img
- paragraph:
- code: "`<dyad-write>`"
- text: ": I'll think about the problem and write a bug report."
- paragraph: <dyad-write>
- paragraph: <dyad-write path="file1.txt"> Fake dyad write </dyad-write>
- img - img
- text: file1.txt - text: file1.txt
- img - img
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# AI_RULES.md # AI_RULES.md
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
} }
], ],
"stream": true, "stream": true,
"thinking": {
"type": "enabled",
"include_thoughts": true
},
"dyad_options": { "dyad_options": {
"files": [ "files": [
{ {
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
} }
], ],
"stream": true, "stream": true,
"thinking": {
"type": "enabled",
"include_thoughts": true
},
"dyad_options": { "dyad_options": {
"files": [ "files": [
{ {
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# AI_RULES.md # AI_RULES.md
......
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
} }
], ],
"stream": true, "stream": true,
"thinking": {
"type": "enabled",
"include_thoughts": true
},
"dyad_options": { "dyad_options": {
"files": [ "files": [
{ {
......
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
} }
], ],
"stream": true, "stream": true,
"thinking": {
"type": "enabled",
"include_thoughts": true
},
"dyad_options": { "dyad_options": {
"files": [ "files": [
{ {
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# Tech Stack # Tech Stack
- You are building a React application. - You are building a React application.
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# Tech Stack # Tech Stack
- You are building a React application. - You are building a React application.
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# Tech Stack # Tech Stack
- You are building a React application. - You are building a React application.
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# Tech Stack # Tech Stack
- You are building a React application. - You are building a React application.
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# Tech Stack # Tech Stack
- You are building a React application. - You are building a React application.
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
"model": "gemini/gemini-2.5-flash-preview-05-20", "model": "gemini/gemini-2.5-flash-preview-05-20",
"max_tokens": 8000, "max_tokens": 8000,
"temperature": 0, "temperature": 0,
"thinking": {
"type": "enabled",
"include_thoughts": true
},
"messages": [ "messages": [
{ {
"role": "system", "role": "system",
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
} }
], ],
"stream": true, "stream": true,
"thinking": {
"type": "enabled",
"include_thoughts": true
},
"dyad_options": { "dyad_options": {
"files": [ "files": [
{ {
......
{ {
"body": { "body": {
"model": "gemini/gemini-2.5-flash-preview-05-20", "model": "anthropic/claude-sonnet-4-20250514",
"max_tokens": 65535, "max_tokens": 16000,
"temperature": 0, "temperature": 0,
"messages": [ "messages": [
{ {
......
- paragraph: /Generate an AI_RULES\.md file for this app\. Describe the tech stack in 5-\d+ bullet points and describe clear rules about what libraries to use for what\./ - paragraph: /Generate an AI_RULES\.md file for this app\. Describe the tech stack in 5-\d+ bullet points and describe clear rules about what libraries to use for what\./
- 'button "Thinking `<dyad-write>`: I''ll think about the problem and write a bug report. <dyad-write> <dyad-write path=\"file1.txt\"> Fake dyad write </dyad-write>"':
- img
- img
- paragraph:
- code: "`<dyad-write>`"
- text: ": I'll think about the problem and write a bug report."
- paragraph: <dyad-write>
- paragraph: <dyad-write path="file1.txt"> Fake dyad write </dyad-write>
- img - img
- text: file1.txt - text: file1.txt
- img - img
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
[[beginning of AI_RULES.md]] [[beginning of AI_RULES.md]]
There's already AI rules... There's already AI rules...
[[end of AI_RULES.md]] [[end of AI_RULES.md]]
......
- paragraph: hi - paragraph: hi
- 'button "Thinking `<dyad-write>`: I''ll think about the problem and write a bug report. <dyad-write> <dyad-write path=\"file1.txt\"> Fake dyad write </dyad-write>"':
- img
- img
- paragraph:
- code: "`<dyad-write>`"
- text: ": I'll think about the problem and write a bug report."
- paragraph: <dyad-write>
- paragraph: <dyad-write path="file1.txt"> Fake dyad write </dyad-write>
- img - img
- text: file1.txt - text: file1.txt
- img - img
......
- paragraph: hi - paragraph: hi
- 'button "Thinking `<dyad-write>`: I''ll think about the problem and write a bug report. <dyad-write> <dyad-write path=\"file1.txt\"> Fake dyad write </dyad-write>"':
- img
- img
- paragraph:
- code: "`<dyad-write>`"
- text: ": I'll think about the problem and write a bug report."
- paragraph: <dyad-write>
- paragraph: <dyad-write path="file1.txt"> Fake dyad write </dyad-write>
- img - img
- text: file1.txt - text: file1.txt
- img - img
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# Tech Stack # Tech Stack
- You are building a React application. - You are building a React application.
......
...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -282,58 +282,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
# Thinking Process
Before responding to user requests, ALWAYS use <think></think> tags to carefully plan your approach. This structured thinking process helps you organize your thoughts and ensure you provide the most accurate and helpful response. Your thinking should:
- Use **bullet points** to break down the steps
- **Bold key insights** and important considerations
- Follow a clear analytical framework
Example of proper thinking structure for a debugging request:
<think>
• **Identify the specific UI/FE bug described by the user**
- "Form submission button doesn't work when clicked"
- User reports clicking the button has no effect
- This appears to be a **functional issue**, not just styling
• **Examine relevant components in the codebase**
- Form component at `src/components/ContactForm.jsx`
- Button component at `src/components/Button.jsx`
- Form submission logic in `src/utils/formHandlers.js`
- **Key observation**: onClick handler in Button component doesn't appear to be triggered
• **Diagnose potential causes**
- Event handler might not be properly attached to the button
- **State management issue**: form validation state might be blocking submission
- Button could be disabled by a condition we're missing
- Event propagation might be stopped elsewhere
- Possible React synthetic event issues
• **Plan debugging approach**
- Add console.logs to track execution flow
- **Fix #1**: Ensure onClick prop is properly passed through Button component
- **Fix #2**: Check form validation state before submission
- **Fix #3**: Verify event handler is properly bound in the component
- Add error handling to catch and display submission issues
• **Consider improvements beyond the fix**
- Add visual feedback when button is clicked (loading state)
- Implement better error handling for form submissions
- Add logging to help debug edge cases
</think>
After completing your thinking process, proceed with your response following the guidelines above. Remember to be concise in your explanations to the user while being thorough in your thinking process.
This structured thinking ensures you:
1. Don't miss important aspects of the request
2. Consider all relevant factors before making changes
3. Deliver more accurate and helpful responses
4. Maintain a consistent approach to problem-solving
# AI Development Rules # AI Development Rules
This document outlines the technology stack and specific library usage guidelines for this Next.js application. Adhering to these rules will help maintain consistency, improve collaboration, and ensure the AI assistant can effectively understand and modify the codebase. This document outlines the technology stack and specific library usage guidelines for this Next.js application. Adhering to these rules will help maintain consistency, improve collaboration, and ensure the AI assistant can effectively understand and modify the codebase.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ai-sdk/anthropic": "^1.2.8", "@ai-sdk/anthropic": "^1.2.8",
"@ai-sdk/google": "^1.2.10", "@ai-sdk/google": "^1.2.19",
"@ai-sdk/openai": "^1.3.7", "@ai-sdk/openai": "^1.3.7",
"@ai-sdk/openai-compatible": "^0.2.13", "@ai-sdk/openai-compatible": "^0.2.13",
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
...@@ -135,13 +135,13 @@ ...@@ -135,13 +135,13 @@
} }
}, },
"node_modules/@ai-sdk/google": { "node_modules/@ai-sdk/google": {
"version": "1.2.14", "version": "1.2.19",
"resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-1.2.14.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/google/-/google-1.2.19.tgz",
"integrity": "sha512-r3FSyyWl0KVjUlKn5o+vMl+Nk8Z/mV6xrqW+49g7fMoRVr/wkRxJZtHorrdDGRreCJubZyAk8ziSQSLpgv2H6w==", "integrity": "sha512-Xgl6eftIRQ4srUdCzxM112JuewVMij5q4JLcNmHcB68Bxn9dpr3MVUSPlJwmameuiQuISIA8lMB+iRiRbFsaqA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "1.1.3", "@ai-sdk/provider": "1.1.3",
"@ai-sdk/provider-utils": "2.2.7" "@ai-sdk/provider-utils": "2.2.8"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"
...@@ -150,6 +150,23 @@ ...@@ -150,6 +150,23 @@
"zod": "^3.0.0" "zod": "^3.0.0"
} }
}, },
"node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-2.2.8.tgz",
"integrity": "sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==",
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "1.1.3",
"nanoid": "^3.3.8",
"secure-json-parse": "^2.7.0"
},
"engines": {
"node": ">=18"
},
"peerDependencies": {
"zod": "^3.23.8"
}
},
"node_modules/@ai-sdk/openai": { "node_modules/@ai-sdk/openai": {
"version": "1.3.21", "version": "1.3.21",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-1.3.21.tgz", "resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-1.3.21.tgz",
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
}, },
"dependencies": { "dependencies": {
"@ai-sdk/anthropic": "^1.2.8", "@ai-sdk/anthropic": "^1.2.8",
"@ai-sdk/google": "^1.2.10", "@ai-sdk/google": "^1.2.19",
"@ai-sdk/openai": "^1.3.7", "@ai-sdk/openai": "^1.3.7",
"@ai-sdk/openai-compatible": "^0.2.13", "@ai-sdk/openai-compatible": "^0.2.13",
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
......
...@@ -33,6 +33,9 @@ import { readFile, writeFile, unlink } from "fs/promises"; ...@@ -33,6 +33,9 @@ import { readFile, writeFile, unlink } from "fs/promises";
import { getMaxTokens } from "../utils/token_utils"; import { getMaxTokens } from "../utils/token_utils";
import { MAX_CHAT_TURNS_IN_CONTEXT } from "@/constants/settings_constants"; import { MAX_CHAT_TURNS_IN_CONTEXT } from "@/constants/settings_constants";
import { validateChatContext } from "../utils/context_paths_utils"; import { validateChatContext } from "../utils/context_paths_utils";
import { GoogleGenerativeAIProviderOptions } from "@ai-sdk/google";
import { getExtraProviderOptions } from "../utils/thinking_utils";
const logger = log.scope("chat_stream_handlers"); const logger = log.scope("chat_stream_handlers");
...@@ -443,17 +446,31 @@ This conversation includes one or more image attachments. When the user uploads ...@@ -443,17 +446,31 @@ This conversation includes one or more image attachments. When the user uploads
} }
// When calling streamText, the messages need to be properly formatted for mixed content // When calling streamText, the messages need to be properly formatted for mixed content
const { textStream } = streamText({ const { fullStream } = streamText({
maxTokens: await getMaxTokens(settings.selectedModel), maxTokens: await getMaxTokens(settings.selectedModel),
temperature: 0, temperature: 0,
maxRetries: 2, maxRetries: 2,
model: modelClient.model, model: modelClient.model,
providerOptions: {
"dyad-gateway": getExtraProviderOptions(
modelClient.builtinProviderId,
),
google: {
thinkingConfig: {
includeThoughts: true,
},
} satisfies GoogleGenerativeAIProviderOptions,
},
system: systemPrompt, system: systemPrompt,
messages: chatMessages.filter((m) => m.content), messages: chatMessages.filter((m) => m.content),
onError: (error: any) => { onError: (error: any) => {
logger.error("Error streaming text:", error); logger.error("Error streaming text:", error);
const message = let errorMessage = (error as any)?.error?.message;
(error as any)?.error?.message || JSON.stringify(error); const responseBody = error?.error?.responseBody;
if (errorMessage && responseBody) {
errorMessage += "\n\nDetails: " + responseBody;
}
const message = errorMessage || JSON.stringify(error);
event.sender.send( event.sender.send(
"chat:response:error", "chat:response:error",
`Sorry, there was an error from the AI: ${message}`, `Sorry, there was an error from the AI: ${message}`,
...@@ -465,10 +482,38 @@ This conversation includes one or more image attachments. When the user uploads ...@@ -465,10 +482,38 @@ This conversation includes one or more image attachments. When the user uploads
}); });
// Process the stream as before // Process the stream as before
let inThinkingBlock = false;
try { try {
for await (const textPart of textStream) { for await (const part of fullStream) {
fullResponse += textPart; let chunk = "";
fullResponse = cleanThinkingByEscapingDyadTags(fullResponse); if (part.type === "text-delta") {
if (inThinkingBlock) {
chunk = "</think>";
inThinkingBlock = false;
}
chunk += part.textDelta;
} else if (part.type === "reasoning") {
if (!inThinkingBlock) {
chunk = "<think>";
inThinkingBlock = true;
}
// Escape dyad tags in reasoning content
// We are replacing the opening tag with a look-alike character
// to avoid issues where thinking content includes dyad tags
// and are mishandled by:
// 1. FE markdown parser
// 2. Main process response processor
chunk += part.textDelta
.replace(/<dyad/g, "<dyad")
.replace(/<\/dyad/g, "</dyad");
}
if (!chunk) {
continue;
}
fullResponse += chunk;
if ( if (
fullResponse.includes("$$SUPABASE_CLIENT_CODE$$") && fullResponse.includes("$$SUPABASE_CLIENT_CODE$$") &&
updatedChat.app?.supabaseProjectId updatedChat.app?.supabaseProjectId
......
...@@ -6,6 +6,10 @@ import { ...@@ -6,6 +6,10 @@ import {
import type { LanguageModelProvider, LanguageModel } from "@/ipc/ipc_types"; import type { LanguageModelProvider, LanguageModel } from "@/ipc/ipc_types";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
export const PROVIDERS_THAT_SUPPORT_THINKING: (keyof typeof MODEL_OPTIONS)[] = [
"google",
];
export interface ModelOption { export interface ModelOption {
name: string; name: string;
displayName: string; displayName: string;
......
...@@ -116,6 +116,7 @@ export async function getModelClient( ...@@ -116,6 +116,7 @@ export async function getModelClient(
? createDyadEngine({ ? createDyadEngine({
apiKey: dyadApiKey, apiKey: dyadApiKey,
baseURL: dyadEngineUrl ?? "https://engine.dyad.sh/v1", baseURL: dyadEngineUrl ?? "https://engine.dyad.sh/v1",
originalProviderId: model.provider,
dyadOptions: { dyadOptions: {
enableLazyEdits: settings.enableProLazyEditsMode, enableLazyEdits: settings.enableProLazyEditsMode,
enableSmartFilesContext: settings.enableProSmartFilesContextMode, enableSmartFilesContext: settings.enableProSmartFilesContextMode,
...@@ -150,7 +151,7 @@ export async function getModelClient( ...@@ -150,7 +151,7 @@ export async function getModelClient(
} }
: undefined, : undefined,
), ),
builtinProviderId: "auto", builtinProviderId: model.provider,
}; };
return { return {
......
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
import { OpenAICompatibleChatSettings } from "@ai-sdk/openai-compatible"; import { OpenAICompatibleChatSettings } from "@ai-sdk/openai-compatible";
import log from "electron-log"; import log from "electron-log";
import { getExtraProviderOptions } from "./thinking_utils";
const logger = log.scope("llm_engine_provider"); const logger = log.scope("llm_engine_provider");
...@@ -42,6 +43,7 @@ or to provide a custom fetch implementation for e.g. testing. ...@@ -42,6 +43,7 @@ or to provide a custom fetch implementation for e.g. testing.
*/ */
fetch?: FetchFunction; fetch?: FetchFunction;
originalProviderId: string;
dyadOptions: { dyadOptions: {
enableLazyEdits?: boolean; enableLazyEdits?: boolean;
enableSmartFilesContext?: boolean; enableSmartFilesContext?: boolean;
...@@ -113,8 +115,7 @@ export function createDyadEngine( ...@@ -113,8 +115,7 @@ export function createDyadEngine(
defaultObjectGenerationMode: defaultObjectGenerationMode:
"tool" as LanguageModelV1ObjectGenerationMode, "tool" as LanguageModelV1ObjectGenerationMode,
// Custom fetch implementation that adds files to the request // Custom fetch implementation that adds files to the request
fetch: files?.length fetch: (input: RequestInfo | URL, init?: RequestInit) => {
? (input: RequestInfo | URL, init?: RequestInit) => {
// Use default fetch if no init or body // Use default fetch if no init or body
if (!init || !init.body || typeof init.body !== "string") { if (!init || !init.body || typeof init.body !== "string") {
return (options.fetch || fetch)(input, init); return (options.fetch || fetch)(input, init);
...@@ -122,7 +123,10 @@ export function createDyadEngine( ...@@ -122,7 +123,10 @@ export function createDyadEngine(
try { try {
// Parse the request body to manipulate it // Parse the request body to manipulate it
const parsedBody = JSON.parse(init.body); const parsedBody = {
...JSON.parse(init.body),
...getExtraProviderOptions(options.originalProviderId),
};
// Add files to the request if they exist // Add files to the request if they exist
if (files?.length) { if (files?.length) {
...@@ -147,8 +151,7 @@ export function createDyadEngine( ...@@ -147,8 +151,7 @@ export function createDyadEngine(
// If parsing fails, use original request // If parsing fails, use original request
return (options.fetch || fetch)(input, init); return (options.fetch || fetch)(input, init);
} }
} },
: options.fetch,
}; };
return new OpenAICompatibleChatLanguageModel(modelId, restSettings, config); return new OpenAICompatibleChatLanguageModel(modelId, restSettings, config);
......
import { PROVIDERS_THAT_SUPPORT_THINKING } from "../shared/language_model_helpers";
export function getExtraProviderOptions(
providerId: string | undefined,
): Record<string, any> {
if (!providerId) {
return {};
}
if (PROVIDERS_THAT_SUPPORT_THINKING.includes(providerId)) {
return {
thinking: {
type: "enabled",
include_thoughts: true,
},
};
}
return {};
}
...@@ -338,8 +338,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code. ...@@ -338,8 +338,6 @@ Do not hesitate to extensively use console logs to follow the flow of the code.
DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed. DO NOT OVERENGINEER THE CODE. You take great pride in keeping things simple and elegant. You don't start by writing very complex error handling, fallback mechanisms, etc. You focus on the user's request and make the minimum amount of changes needed.
DON'T DO MORE THAN WHAT THE USER ASKS FOR. DON'T DO MORE THAN WHAT THE USER ASKS FOR.
${THINKING_PROMPT}
[[AI_RULES]] [[AI_RULES]]
Directory names MUST be all lower-case (src/pages, src/components, etc.). File names may use mixed-case if you like. Directory names MUST be all lower-case (src/pages, src/components, etc.). File names may use mixed-case if you like.
......
...@@ -35,17 +35,6 @@ export function createStreamChunk( ...@@ -35,17 +35,6 @@ export function createStreamChunk(
} }
export const CANNED_MESSAGE = ` export const CANNED_MESSAGE = `
<think>
\`<dyad-write>\`:
I'll think about the problem and write a bug report.
<dyad-write>
<dyad-write path="file1.txt">
Fake dyad write
</dyad-write>
</think>
<dyad-write path="file1.txt"> <dyad-write path="file1.txt">
A file (2) A file (2)
</dyad-write> </dyad-write>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论