Feature Request: Session Export and Replay for Agent Debugging
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- java, typescript
- Domain
- developer-experience, testing
Research direction
Start by reviewing the Copilot SDK's existing session handling and the proposed loadSession/replay API shown in the issue. Establish how exported messages, tool calls, MCP interactions, metadata, and model configuration should be represented, then define completion around exporting a session and replaying it for debugging or testing.
Written by the indexing model from the issue text.
Description
Title
Feature Request: Session Export and Replay for Agent Debugging
Description
Problem
When building agents with the Copilot SDK, debugging complex multi-turn conversations can be difficult.
Developers often encounter situations where:
- An agent behaves unexpectedly after several turns.
- A tool invocation produces an incorrect result.
- Context accumulation affects later responses.
- Bugs only appear after a specific sequence of interactions.
Currently, reproducing these issues typically requires manually recreating the entire conversation flow.
Proposed Solution
Add session export and replay capabilities to the Copilot SDK.
Session Export
Allow developers to export a session including:
- User messages
- Assistant messages
- Tool calls
- Tool results
- MCP interactions
- Session metadata
- Model configuration
Example:
{
"sessionId": "...",
"messages": [...],
"toolCalls": [...],
"metadata": {...}
}
Session Replay
Provide APIs to replay exported sessions for debugging and testing.
Example:
const session = await sdk.loadSession("./session.json");
await session.replay();
Optional Features
- Replay until a specific turn
- Step-by-step execution
- Compare outputs across SDK versions
- Compare outputs across models
- Deterministic replay mode
Use Cases
Agent Development
Reproduce user-reported failures without requiring users to recreate conversations.
Regression Testing
Verify that SDK upgrades do not change agent behavior unexpectedly.
Tool Debugging
Inspect exactly how tool calls and results affected agent decisions.
Benchmarking
Compare responses across different models using the same session history.
Benefits
- Easier debugging
- Better reproducibility
- Improved regression testing
- Faster issue triage
- Better developer experience for agent builders
Alternatives Considered
- Manual logging of messages
- Custom session serialization
- Third-party observability platforms
These approaches require significant additional implementation and are not standardized across SDK users.
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 130
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot-sdk
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2760 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/copilot-sdk#2759 ·
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
github/copilot-sdk#2758 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2709 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
github/copilot-sdk#2673 ·
All issues in github/copilot-sdk
Similar issues
-
certification
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Openbug ecr
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Needs: Triage Type: Feature request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AntennaPod/AntennaPod#8794 ·
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficulty 2/5 1-3 hours Newbie friendliness 75/100