This file tells you EXACTLY what to do right now.
✅ Configuration Files Created:
.zed/settings.json- Python language server & formatter settings.zed/tasks.json- 20+ debugging & development tasks
✅ Documentation Created:
DEBUG_GUIDE.md- Complete 769-line guide with 10 examplesZED_DEBUGGER_QUICKREF.md- 2-minute quick reference cardSENTINEL_DEBUGGING.md- Sentinel project-specific debugging guidedebug_example.py- 10 interactive debugging examples to run- This file you're reading now
✅ Ready to Debug:
- Python debugger (DAP) - Built-in to Zed
- Breakpoints - Click on line numbers
- Step through code - F10, F11 shortcuts
- Inspect variables - Variables panel
- Execute expressions - Console panel
cd ~/DaatScience/Sentinel
# Activate virtual environment
source .venv/bin/activate
# Install debugger tools (if needed)
pip install debugpy
# Verify
python -c "import debugpy; print('✓ Ready to debug!')"# Open the project in Zed
zed .- Open
main.py - Click on line number
2(the line withprint("Hello from sentinel!")) - A red dot appears - that's your breakpoint!
- Press F5 (or use
Ctrl+Shift+T→ "Debug: Run Current File") - The debugger will pause at your breakpoint
- You should see the Variables panel appear at the bottom
- Your code paused! 🎉
- Press F10 to step to the next line
- Press F10 again to finish
- Press F5 to continue
- See how easy that was? 🎊
F5 Start Debugger / Continue
F9 Toggle Breakpoint
F10 Step Over (execute line, don't enter functions)
F11 Step Into (enter function to debug inside)
Shift+F11 Step Out (exit current function)
Ctrl+Shift+D Show/Hide Debugger Panel
Ctrl+Shift+T Open Tasks Menu
-
ZED_DEBUGGER_QUICKREF.md (2 minutes)
- Quick reference card
- Essential shortcuts
- Common scenarios
-
DEBUG_GUIDE.md (20 minutes)
- Comprehensive guide
- All features explained
- Troubleshooting
-
SENTINEL_DEBUGGING.md (15 minutes)
- Sentinel project-specific
- Agent debugging
- FastAPI debugging
- LLM debugging
# This runs 10 debugging examples
python debug_example.py
# When it starts, press F5 to debug
# Then use F10 to step through each example
# Each example teaches a different debugging technique# Method 1: Direct run with debugger
python debug_response_agent.py
# Then press F5
# Method 2: Using Zed tasks
# Press Ctrl+Shift+T → "Debug: Run Agent Debug Script"python debug_llm_setup.py
# Press F5 to debug# In Zed: Ctrl+Shift+T → "Debug: FastAPI with Auto-reload"
# Wait for "Uvicorn running on http://0.0.0.0:8000"
# In another terminal:
curl http://localhost:8000/health
# Debugger will pause at your breakpoints# In Zed: Ctrl+Shift+T → "Test: Run Current Test File"
# Or: Ctrl+Shift+T → "Test: Run All Tests"Variables Panel (Bottom right)
- Shows all local variables
- Click ▶ to expand nested objects
- Hover over any variable in code to see value
Console Panel (Bottom)
- Type Python code to evaluate
- Examples:
my_variable # Print value len(my_list) # Call function x + y # Math my_dict["key"] # Access dict
Call Stack Panel (Bottom)
- Shows function call hierarchy
- Click any frame to jump to that code
- Understand how you got here
Watch Expressions (Bottom)
- Click + to add expression
- Examples:
len(items) x * 2 data["key"]
- Expression updates as you step
1. Understand the problem
"What should happen? What actually happens?"
2. Find where it fails
"Which line causes the issue?"
3. Set breakpoint there
Click on line number → red dot
4. Start debugger
Press F5
5. Inspect variables
Hover over, check Variables panel
6. Step through code
F10 to step line by line
7. Find the bug
Which variable is wrong?
8. Fix it
Edit the code
9. Test it
Run again without debugger
- Read this file (you're doing it!)
- Activated virtual environment:
source .venv/bin/activate - Installed debugpy:
pip install debugpy - Opened Zed:
zed . - Set a breakpoint: Click on line number (red dot appears)
- Started debugger: Press F5
- Saw Variables panel: Should appear at bottom
- Stepped through code: Press F10
If all checked ✓, you're ready to debug!
| Problem | Solution |
|---|---|
| Breakpoint not hit | Verify correct Python: which python (should show .venv/bin/python) |
| Debugger won't start | Install: pip install debugpy |
| Can't see variables | Make sure debugger is paused at breakpoint (look for Variables panel) |
| Print statements don't show | Use logger instead: logger.debug("msg") |
| Stuck in infinite loop | Press Ctrl+C to stop, then fix code |
If you need more details:
- Quick reference? → Read
ZED_DEBUGGER_QUICKREF.md - Complete guide? → Read
DEBUG_GUIDE.md - Sentinel-specific? → Read
SENTINEL_DEBUGGING.md - Want examples? → Run
python debug_example.py
- Open terminal
- Run:
cd ~/DaatScience/Sentinel && zed . - Click on a line number to set breakpoint
- Press F5 to start debugging
- Use F10 to step through
- Inspect variables in the Variables panel
- Press F5 to continue
You've got this! Happy debugging! 🎉
- Breakpoints stay when you close Zed (Zed remembers them)
- You can set conditions on breakpoints (right-click → Edit Breakpoint)
- Stepping with F10 is faster than F11 (doesn't enter functions)
- Use console to quickly test expressions
- Use watch expressions to monitor specific values
- Quick answer? → Check
ZED_DEBUGGER_QUICKREF.md - Don't understand? → Read the section in
DEBUG_GUIDE.md - Want examples? → See
debug_example.py - Project specific? → Check
SENTINEL_DEBUGGING.md - Still stuck? → Read Troubleshooting section above
You're all set! Press F5 and start debugging! 🚀