You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are in debug mode. Your primary objective is to systematically identify, analyze, and resolve bugs in the developer's application. Follow this structured debugging process:
10
+
11
+
## Debugging process
12
+
13
+
• **Gather context**: Read error messages/stack traces, examine recent changes, identify expected vs actual behavior. If the issue is a GitHub issue link, use 'get_issue' and 'get_issue_comments' tools to fetch the issue and comments.
14
+
• **Root cause analysis**: Trace execution path, check for common issues, use search tools to understand component interactions
• **Verify thoroughly**: Run tests to confirm fix, check for regressions, test edge cases
17
+
• **Document**: Summarize what was fixed, explain root cause, suggest preventive measures. Do not document this in the repo itself, only in the chat history and commit messages.
18
+
19
+
## Local server setup
20
+
21
+
You MUST check task output readiness before debugging, testing, or declaring work complete.
22
+
23
+
- Start the app: Run the "Development" compound task (which runs both frontend and backend tasks)
24
+
- Check readiness from task output (both must be ready):
25
+
- Frontend (task: "Frontend: npm run dev"): look for the Vite URL line. Either of these indicates ready:
26
+
- "Local: http://127.0.0.1:..." or "➜ Local: http://127.0.0.1:..."
27
+
- Backend (task: "Backend: quart run"): wait for Hypercorn to bind. Ready when you see:
28
+
- "INFO:hypercorn.error:Running on http://127.0.0.1:50505" (port may vary if changed)
29
+
- If either readiness line does not appear, the server is not ready. Investigate and fix errors shown in the corresponding task terminal before proceeding.
30
+
- Hot reload behavior:
31
+
- Frontend: Vite provides HMR; changes in the frontend are picked up automatically without restarting the task.
32
+
- Backend: Quart is started with --reload; Python changes trigger an automatic restart.
33
+
- If watchers seem stuck or output stops updating, stop the tasks and run the "Development" task again.
34
+
- To interact with the application, use the Playwright MCP server
35
+
- To run the Python backend pytest tests, use the "run tests" tool
36
+
- To run the Playwright E2E tests of the whole app (with a mocked backend), run `pytest tests/e2e.py --tracing=retain-on-failure`.
*[Using VS Code "Run and Debug"](#using-vs-code-run-and-debug)
8
10
*[Using a local OpenAI-compatible API](#using-a-local-openai-compatible-api)
9
11
*[Using Ollama server](#using-ollama-server)
@@ -64,6 +66,56 @@ Navigate to the URL shown in the terminal (in this case, `http://localhost:5173/
64
66
65
67
Then, whenever you make changes to frontend files, the changes will be automatically reloaded, without any browser refresh needed.
66
68
69
+
Alternatively, you can start both servers with hot reloading by using the VS Code "Development" task. See [Using VS Code "Development" task](#using-vs-code-development-task).
70
+
71
+
## Using VS Code "Development" task
72
+
73
+
If you prefer VS Code tasks for hot reloading both servers at once, use the "Development" task defined in `.vscode/tasks.json`.
74
+
75
+
How to run it:
76
+
77
+
* Run Build Task (Shift+Cmd+B) to start the default build task, which is "Development".
78
+
* Or open the Command Palette (Shift+Cmd+P) and run: "Tasks: Run Task" -> "Development".
79
+
80
+
What it does:
81
+
82
+
* Starts two background tasks in dedicated panels:
83
+
* "Frontend: npm run dev" from `app/frontend` (Vite HMR for instant frontend updates)
84
+
* "Backend: quart run" from `app/backend` (Quart with `--reload` for backend auto-restarts)
85
+
86
+
Readiness indicators:
87
+
88
+
* Frontend is ready when Vite prints a Local URL, for example: `Local: http://localhost:5173/`.
89
+
* Backend is ready when Hypercorn reports: `Running on http://127.0.0.1:50505` (port may vary).
90
+
91
+
Tips:
92
+
93
+
* To stop both, run: "Tasks: Terminate Task" and pick the running tasks.
94
+
* If watchers stall, terminate and run "Development" again.
95
+
* Frontend changes apply via HMR; backend Python changes auto-reload. No manual restart needed.
96
+
97
+
## Using Copilot Chat Debug Mode
98
+
99
+
You can use GitHub Copilot Chat with a custom "debug" mode to streamline troubleshooting in this repo.
100
+
101
+
Prerequisites:
102
+
103
+
* VS Code 1.101+ (custom chat modes are in preview)
104
+
* Access to GitHub Copilot and Copilot Chat
105
+
* Playwright MCP server and GitHub MCP server (optional)
106
+
107
+
To learn more about the chat modes feature, read [VS Code docs for Chat modes](https://code.visualstudio.com/docs/copilot/chat/chat-modes).
108
+
109
+
To use the debug mode:
110
+
111
+
* Open the Chat view.
112
+
* Use the chat mode dropdown at the top of the Chat view to select the "debug" mode.
113
+
* Start chatting in that mode; the instructions and tools from the repo file will be applied automatically.
114
+
* The mode will use the tasks from .vscode/tasks.json to run the frontend and backend server, and should be able to read any errors in the output.
115
+
* The mode may also use tools from the Playwright MCP server and GitHub MCP server, if those servers are installed in your VS Code.
116
+
117
+
Notably, this mode will not actually use a breakpoint-based debugger. Read on to learn how to use breakpoints while debugging the Python code.
118
+
67
119
## Using VS Code "Run and Debug"
68
120
69
121
This project includes configurations defined in `.vscode/launch.json` that allow you to run and debug the app directly from VS Code:
0 commit comments