Feature Request: Session Export and Replay for Agent Debugging
- Lenguaje dominante
- Java
- Estrellas
- 10.5k
- Forks
- 1.5k
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 128
Descripción
**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:
```json
{
"sessionId": "...",
"messages": [...],
"toolCalls": [...],
"metadata": {...}
}
```
#### Session Replay
Provide APIs to replay exported sessions for debugging and testing.
Example:
```typescript
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.
Guía de contribución
Línea de trabajo
Comienza revisando la gestión de sesiones existente del Copilot SDK y la API propuesta loadSession/replay mostrada en el issue. Establece cómo deben representarse los mensajes exportados, las llamadas a herramientas, las interacciones con MCP, los metadatos y la configuración del modelo; después, define los criterios de finalización para exportar una sesión y reproducirla con fines de depuración o pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, typescript
- Área
- developer-experience, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100