Skip to content
Guides
AGH RuntimeGuides

Debug a Failed or Stuck Session

Diagnose AGH sessions by checking daemon health, session status, event history, repair output, and stored runtime files.

Audience
Operators running durable agent work
Focus
Guides guidance shaped for scanability, day-two clarity, and operator context.

This guide gets you from "the session is not behaving" to evidence you can act on. It starts with runtime health, then narrows to one session and its durable event trail.

1. Confirm the daemon is reachable

agh daemon status

For machine-readable output:

agh daemon status -o json

What happened: AGH checked the background daemon through the local runtime control path. If this fails, debug the daemon before debugging the session.

Useful follow-up pages:

2. Check global runtime health

agh observe health -o json

Look for unhealthy subsystems before focusing on the agent process. Memory indexing, event storage, or daemon connectivity problems can make a session look broken even when the provider process is not the root cause.

3. Inspect the session status

agh session status sess_1234 -o json

Check:

  • session state
  • agent name and workspace
  • stop reason
  • current prompt state
  • created and updated timestamps

What happened: the daemon returned the current session record, not a reconstructed transcript. Use this to learn what AGH thinks the session is doing right now.

4. Read the durable event stream

agh session events sess_1234

Follow live events when the session is still active:

agh session events sess_1234 --follow

What happened: AGH read the append-only session event database. This is the best evidence for prompt submission, permission requests, provider messages, tool calls, errors, and stop behavior.

5. Reconstruct the conversation history

agh session history sess_1234

Use history when you need to understand the user-visible turn sequence. Use events when you need operational detail.

6. Run repair when the transcript is interrupted

agh session repair sess_1234

What happened: AGH inspected the session transcript and reported whether it can repair interrupted state. Repair is for damaged or interrupted transcript state, not a substitute for daemon health checks.

7. Resume only after the state is understood

agh session resume sess_1234

If the provider reports that its original session resource no longer exists, AGH may need to classify the resume failure and fall back according to the implemented session resume rules. Read Resume and Replay before treating resume as a data-loss problem.

Common symptoms

SymptomFirst checkThen read
agh session prompt hangsagh session events --followEvent Streaming
Session is stopped unexpectedlyagh session status -o jsonSession Lifecycle
Web UI is staleagh daemon status and agh observe healthWeb UI
Resume failsagh session history and agh session repairResume and Replay
Agent cannot see project contextagh workspace info <name>Workspace Resolver
Memory is missingagh memory health -o jsonMemory System

Evidence to collect before filing a bug

Collect output from:

agh daemon status -o json
agh observe health -o json
agh session status sess_1234 -o json
agh session events sess_1234
agh session history sess_1234

Do not include raw secrets, provider API keys, OAuth tokens, or claim tokens in bug reports. AGH redacts sensitive runtime fields, but copied terminal context may still include local environment details.

Next steps

On this page