Configure observability for multi-agent behavior
Unlock the complete study guide.
Bundled into the existing Developing in Agentic AI Systems premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- What observability means once more than one agent is working
- Produce artifacts a reviewer can actually use
- Keep artifacts long enough for them to be evidence
- Record handoffs with the events the platform already fires
- Log every tool execution in a form your collector can parse
- Correlate worker traces on a shared SDK stream
- Reconstruct a session from VS Code's own records
- Read run and task logs from the command line
- Identify which task and revision a CLI record belongs to
- Say what a worker must hand back
- Exam reasoning: choosing the surface the question is asking for
| The question in front of you | The surface that answers it | What it actually contains | The tempting wrong pick |
|---|---|---|---|
| Which file did one named worker produce? | actions/download-artifact with name set | That one artifact, extracted to the workspace | Omitting name, which pulls the whole run into per-artifact directories |
| What did every worker in the run produce? | actions/download-artifact with name omitted | Every artifact, one directory per artifact name | Adding a download step per worker, which changes whenever the set of worker jobs does |
| Which worker ran, and what did it conclude? | The subagentStop hook payload | agentId, agentName, transcriptPath, sessionId and the full final response | A sessionEnd or agentStop handler, which fires for the session or the coordinator's turn |
| Which worker was dispatched? | The subagentStart hook payload | sessionId, timestamp, transcriptPath and agentName, before the worker runs | Expecting the worker's answer, which does not exist yet at dispatch |
| What did the agent actually see and call? | The VS Code Chat Debug view | Raw system prompt, user prompt, attached context and tool payloads | Reading the conversational summary, which is the agent's account of itself — or reaching for an editor view when the run was a cloud agent task, whose own session log is the record |
| What did the session contain? | Copy All when the record must show thinking steps and tool calls; Chat: Export Chat when prompts and responses must be stored as JSON | Copy All: prompts, responses, thinking steps and tool calls (Markdown); Chat: Export Chat: prompts and responses (JSON) — the documented contents of each | Copy Final Response, which keeps only the closing section |
| Why did one job of an agent workflow fail? | gh run view with --log-failed, plus --job | The failed steps' part of the run log, narrowed to one job | The full run log, where every other job's steps bury the failing ones |
| Which execution failed, before the reruns? | gh run view with --attempt | That numbered attempt of the same run identifier | The default view, which reads the latest attempt |
| Which of four concurrent SDK workers does this subagent.started, completed or failed event belong to? | toolCallId on the SDK subagent.* events | One worker execution, start paired with completed or failed | agentName, which several workers of one agent share |
| Why is a review package missing? | expires_at on the artifact REST record, then the run itself | The scheduled deletion date; deleting the run removes all of its artifacts | The configured retention setting, which describes policy, not this artifact |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
References
- Store and share data with workflow artifacts
- Downloading workflow artifacts
- Removing workflow artifacts
- REST API endpoints for GitHub Actions artifacts
- Customize agent workflows with hooks
- GitHub Copilot hooks reference
- Custom agents and sub-agent events in the Copilot SDK
- Fleet mode in the Copilot SDK
- Sessions and handoff
- Manage agent sessions
- Debug chat interactions
- Subagents in Visual Studio Code
- gh agent-task view
- gh run view
- gh agent-task list