Runbooks
Use these short runbooks for common operational failures.
Runbook: Broken Shell Integration
- Regenerate shell config snippet:
bash
thegent shell-init zsh- Ensure your shell startup file loads it.
- Reinstall shims:
bash
thegent install-shims
thegent doctorRunbook: Credential/Auth Failure
- Re-run setup:
bash
thegent setup- Re-test with explicit provider:
bash
thegent run "health check" --provider codex --debugRunbook: Stuck Background Sessions
- Inspect sessions:
bash
thegent ps- Stop problematic session:
bash
thegent stop <session_id>- Restart with a narrower prompt or different provider.
Runbook: MCP Connectivity Failure
- Start MCP server:
bash
thegent serve- Verify client target host/port.
- Remove stale resources safely:
bash
thegent mcp pruneRunbook: Autosync Incident and Recovery
Trigger conditions:
docs/reference/autosync_status.jsonreports"health": "degraded"for 2+ cycles.- Emergency stop sentinel exists or
THGENT_AUTOSYNC_EMERGENCY_STOP=1. - Failure queue grows continuously (
failure_queue_sizeincreasing across runs).
Immediate containment:
- Enable emergency stop:
bash
export THGENT_AUTOSYNC_EMERGENCY_STOP=1- Confirm no new write-capable sync activity (status snapshot should keep
last_error).
Rollback and recovery:
- Capture current state:
bash
thegent sync autopilot-status- Remove/repair bad local changes, then clear emergency stop only after validation:
bash
unset THGENT_AUTOSYNC_EMERGENCY_STOP- Run one controlled cycle:
bash
thegent sync autopilot --onceValidation checkpoints:
last_erroris empty indocs/reference/autosync_status.json.failure_queue_sizeis stable or decreasing.docs/reference/WORK_STREAM.mdreflects expected statuses only.