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

Improve agent system prompt for console.log / debugging handoffs (#2211)

drive-by: rebaseline log snapshot to be more resilient <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Prompt update** > - Refines `development_workflow` step 3 to require asking the user to interact after adding `console.log` statements so logs actually execute. > > **Test snapshots** > - Updates snapshots in `local_agent_basic.spec` and `local_agent_auto.spec` to reflect the new prompt text. > - Makes `local_agent_read_logs.spec` more resilient by matching `/LOGSReading \d+ logs/` instead of a fixed count. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d8191976a120e32f850e47f7b5be8e843684fd6b. 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 Improves the local agent’s debugging handoff by updating the system prompt to ask the user to interact with the app after adding console.log statements, so logs appear only when code paths execute. Rebaselines e2e snapshots and makes the log-reading check resilient to varying log counts. - **Refactors** - Clarified debugging step in the system prompt: after adding logs, request user interaction to trigger execution. - Updated e2e snapshots; replaced fixed “Reading 1 logs” with a regex to handle dynamic counts. <sup>Written for commit d8191976a120e32f850e47f7b5be8e843684fd6b. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
上级 afc36da6
......@@ -57,7 +57,7 @@ You have tools at your disposal to solve the coding task. Follow these rules reg
<development_workflow>
1. **Understand:** Think about the user's request and the relevant codebase context. Use `grep` and `code_search` search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use `read_file` to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to `read_file`.
2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the `update_todos` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
3. **Implement:** Use the available tools (e.g., `edit_file`, `write_file`, ...) to act on the plan, strictly adhering to the project's established conventions. You can debug by adding targeted console.log statements and ask the user to interact with the web application to trace data flow and identify root causes.
3. **Implement:** Use the available tools (e.g., `edit_file`, `write_file`, ...) to act on the plan, strictly adhering to the project's established conventions. When debugging, add targeted console.log statements to trace data flow and identify root causes. **Important:** After adding logs, you must ask the user to interact with the application (e.g., click a button, submit a form, navigate to a page) to trigger the code paths where logs were added—the logs will only be available once that code actually executes.
4. **Verify:** After making code changes, use `run_type_checks` to verify that the changes are correct and read the file contents to ensure the changes are what you intended.
5. **Finalize:** After all verification passes, consider the task complete and briefly summarize the changes you made.
</development_workflow>
......
......@@ -17,7 +17,7 @@
- paragraph: tc=local-agent/read-logs
- paragraph: Let me check the recent console logs to see what's happening in the application.
- img
- text: LOGSReading 1 logs
- text: /LOGSReading \d+ logs/
- img
- paragraph: Now let me filter for only error logs to identify any issues.
- img
......
......@@ -60,7 +60,7 @@ You have tools at your disposal to solve the coding task. Follow these rules reg
<development_workflow>
1. **Understand:** Think about the user's request and the relevant codebase context. Use \`grep\` and \`code_search\` search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use \`read_file\` to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to \`read_file\`.
2. **Plan:** Build a coherent and grounded (based on the understanding in step 1) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the \`update_todos\` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
3. **Implement:** Use the available tools (e.g., \`edit_file\`, \`write_file\`, ...) to act on the plan, strictly adhering to the project's established conventions. You can debug by adding targeted console.log statements and ask the user to interact with the web application to trace data flow and identify root causes.
3. **Implement:** Use the available tools (e.g., \`edit_file\`, \`write_file\`, ...) to act on the plan, strictly adhering to the project's established conventions. When debugging, add targeted console.log statements to trace data flow and identify root causes. **Important:** After adding logs, you must ask the user to interact with the application (e.g., click a button, submit a form, navigate to a page) to trigger the code paths where logs were added—the logs will only be available once that code actually executes.
4. **Verify:** After making code changes, use \`run_type_checks\` to verify that the changes are correct and read the file contents to ensure the changes are what you intended.
5. **Finalize:** After all verification passes, consider the task complete and briefly summarize the changes you made.
</development_workflow>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论