Skip to main content

Conversation Resume

Test file: rossoctl/tests/e2e/openshell/test_06_conversation_resume.py Tests: 5 | Pass: 0 | Skip: 5 (Kind, fresh cluster)

What This Tests

Validates that conversation state survives pod restarts and PVC-backed session resume works correctly. This is the A2A equivalent of the OpenShell proposal's "session reconnect" requirement.

Architecture Under Test

Test Matrix

Testweather_agentadk_agentclaude_sdk_agentweather_supervisedos_generic
Restart: multiturn across restart⏭️ destructive⏭️ destructive⏭️ destructive⏭️ destructive
PVC resume: write/delete/recreate/read

Skip reasons:

  • destructive — Test kills port-forward and scales deployment to 0; requires OPENSHELL_DESTRUCTIVE_TESTS=true
  • context lost — Agents respond after restart but lose in-memory context (TODO: PVC-backed session store)
  • — Test not applicable for this agent type

Test Details

test_restart__agent__multiturn_across_restart (parametrized: 3 A2A agents)

  • What: Turn 1 → scale 0 → scale 1 → Turn 2: does context survive?
  • Asserts:
    • Turn 1 succeeds and returns contextId
    • Agent restarts successfully
    • Turn 2 succeeds (with or without context preservation)
  • Debug points: contextId values, restart timing, port-forward reconnect
  • Agent coverage: weather_agent, adk_agent, claude_sdk_agent
  • Skip condition:
    • OPENSHELL_DESTRUCTIVE_TESTS != true (kills active port-forwards)
    • Agent is stateless (no contextId)
    • Agent returns but context lost (in-memory only)
    • TODO: PVC-backed session checkpoint + Rossoctl backend restore

test_restart__weather_supervised__kubectl_exec

  • What: Supervised agent: restart test via kubectl exec
  • Asserts:
    • Scale 0 succeeds
    • Scale 1 succeeds
    • Pod ready after restart
  • Debug points: Deployment readyReplicas, scale timing
  • Agent coverage: weather_supervised
  • Skip condition:
    • OPENSHELL_DESTRUCTIVE_TESTS != true
    • A2A context test skipped (netns blocks port-forward)
    • TODO: ExecSandbox gRPC for session persistence testing

test_resume__generic_sandbox__write_delete_recreate_read

  • What: Generic sandbox: write to PVC, delete sandbox, recreate, verify data
  • Asserts:
    • PVC created
    • Sandbox pod writes data to /workspace/session.txt
    • Data readable in first pod
    • Sandbox deleted (pod terminated)
    • Sandbox recreated with same PVC
    • Data readable in second pod (after recreate)
  • Debug points: PVC name, pod names, file contents, timing
  • Agent coverage: openshell_generic (base sandbox image)
  • Skip condition:
    • OPENSHELL_DESTRUCTIVE_TESTS != true
    • Base image pull timeout (60s limit)

Destructive Test Protection

These tests are destructive (kill pods, break port-forwards) and are disabled by default:

# Enable destructive tests
export OPENSHELL_DESTRUCTIVE_TESTS=true

# Run only conversation resume tests
uv run pytest rossoctl/tests/e2e/openshell/test_06_conversation_resume.py -v

Why disabled by default:

  • Kills active kubectl port-forward processes
  • Disrupts other tests running in parallel
  • Requires cluster cleanup between runs
  • Long test duration (30-60s per test due to rollout waits)

Current State vs Future State

CapabilityCurrent StateFuture StateBlocker
A2A agents respond after restart✅ PASS✅ PASSNone
Context preserved after restart⏭️ SKIP (lost)✅ PASSPVC-backed checkpointer + Rossoctl backend
PVC data persists✅ PASS✅ PASSNone (works today for builtin sandboxes)
Supervised agent multi-turn⏭️ SKIP (netns)✅ PASSExecSandbox gRPC adapter

Session Store Architecture (Future)

When PVC-backed session store is implemented:

PVC Cleanup Helper

Tests use a cleanup helper to prevent PVC leaks:

def _cleanup_sandbox(name: str, pvc: str, ns: str = AGENT_NS):
kubectl delete sandbox {name} -n {ns} --wait=false
# Force delete any stuck pods
for pod in matching_pods:
kubectl delete pod {pod} --force --grace-period=0
# Delete PVC (only after pods terminated)
kubectl delete pvc {pvc} -n {ns} --wait=false

Future Expansion

Agent TypeWhen AddedWhat's Needed
openshell_claudePhase 2PVC /workspace/.claude/ with session history
openshell_opencodePhase 2PVC /workspace/ with conversation logs
Custom A2A agentsPhase 2Rossoctl backend session store (PostgreSQL + checkpointer)
Supervised agentsPhase 2ExecSandbox gRPC + backend session store

Common Failure Modes

SymptomCauseFix
Port-forward killedDestructive test side-effectRerun with OPENSHELL_DESTRUCTIVE_TESTS=false
PVC stuck in TerminatingPod still boundForce delete pod first, then PVC
Pod not recreatedRollout timeoutIncrease timeout to 150s
Context lost after restartIn-memory onlyImplement PVC-backed checkpointer