1) Live Debugging a Single Service
Use when: You’re running one service locally and need quick answers from live logs. Steps- Run under OnCall:
oncall npm run dev(or any command). - Watch the Logs pane; when an error appears, ask in chat: “What’s causing this error?”
- AI uses recent logs and may call:
tail_logs(n)for the latest linesget_recent_errors(n)to surface error linesgrep_logs(pattern, before, after)to pull contextread_file(path, line, before, after)ifcode_available: true
- Apply the suggested fix; keep chatting without restarting.
2) Cross‑Service / Cluster Debugging
Use when: Multiple services (frontend, backend, workers) share a projectid.
Steps
- Start cluster:
oncall cluster(separate terminal). - Start each service with the same
idinoncall.yaml:oncall <command>. - Ask from any service: “Why are API requests failing?”
- AI fetches cluster architecture and can:
- Pull logs from any service (
tail_logs,grep_logs,get_recent_errors) - Read code where
code_available: true - Correlate issues across services (e.g., frontend 500s → backend DB timeouts).
- Pull logs from any service (
3) Production Log‑Only Investigation
Use when: You must not expose code (code_available: false) but can share logs.
Steps
- Run with log streaming (e.g.,
oncall tail -f /var/log/app.log). - Ask: “What are the most common errors in the last hour?”
- AI sticks to log tools:
get_recent_errors(n)to surface errorsgrep_logs(pattern, before, after)to find patterns (e.g., timeouts)read_logs(page)/tail_logs(n)for history or latest context.
4) Debugging from Stack Traces (Code + Logs)
Use when: You have a stack trace and need code context. Steps- Paste/point to the error in chat: “Error at src/api/users.js:45”.
- AI may call:
read_file(path, line, before, after)for surrounding codegrep_search(term, filters…)to find related definitions/usages- Log tools to validate runtime context
- AI proposes the minimal fix, referencing the inspected code.
5) Searching Logs for Patterns and Recent Failures
Use when: You need to spot patterns or isolate fresh failures. Toolsgrep_logs(pattern, before, after): find all matches with context (e.g.,timeout,ECONNREFUSED).get_recent_errors(n): quickly list the latest error‑like lines.tail_logs(n): grab the freshest output after a change or deploy.read_logs(page): page through history in 50‑line chunks.
6) Continuous Monitoring Check‑Ins
Use when: A long‑running process is up and you want periodic health reads. Steps- Keep the process running under OnCall (e.g.,
oncall docker-compose up). - Periodically ask: “Any issues I should know about?”
- AI will scan with
get_recent_errors,grep_logs, andtail_logsto summarize emerging issues.
7) Build / Deploy Troubleshooting
Use when: Builds or scripts fail and you need quick diagnosis. Steps- Run the build under OnCall (e.g.,
oncall npm run build). - Ask: “Why did the build fail?”
- AI inspects recent logs, lists the errors, and (if allowed) reads offending files (
read_file) or searches code (grep_search) to propose fixes.
8) Database / Migration Issues
Use when: Migrations or DB interactions fail. Steps- Run migration under OnCall (e.g.,
oncall npm run migrate). - Ask: “What’s wrong with this migration?”
- AI uses
grep_logs("FOREIGN KEY", …),get_recent_errors, and targetedread_fileon migration scripts (ifcode_available: true) to pinpoint ordering or constraint issues.
9) Performance Signals from Logs
Use when: You suspect slow endpoints or queries. Steps- Ask: “Any performance issues?”
- AI scans logs for slow patterns (e.g., via
grep_logs(">2000ms", before, after)or keywords like “slow query”). - AI summarizes hotspots and suggests next checks; if code access is allowed, it can inspect relevant code paths.
10) Multi‑Language Stack Debugging
Use when: Services in different languages share the same projectid.
Steps
- Ensure each service has
oncall.yamlwith the sharedid. - Ask cross‑stack questions (e.g., “API returning wrong data format”).
- AI can read code in each service (where permitted) and correlate logs to find language‑boundary issues.
Tips
- Keep
logs_available/code_availablealigned to environment (prod vs dev). - Use the same project
idto unify services; a uniquewindow_ididentifies each service instance. - Remember shortcuts:
Tab(focus),Ctrl+D(view cycle),Ctrl+R(reset chat),Ctrl+L(clear logs),Ctrl+K(clear chat).