DEV Community

Cover image for Your agent paused for human approval. You only saved the chat log.
Dhrubojyoti Gangopadhyay
Dhrubojyoti Gangopadhyay

Posted on

Your agent paused for human approval. You only saved the chat log.

Your agent paused for human approval. You only saved the chat log.

Most teams build human-in-the-loop workflows by persisting conversation messages to SQLite, Postgres, or Redis and assuming any replacement worker can pick up the thread after the human replies.

On 24 November 2026, openai/openai-agents-python shipped v1.0.0-alpha.2 (alongside stable v0.26.0 the same day). The release notes and updated docs/sessions/index.md spell out what an agent runtime actually has to record when unfinished work pauses for a human—and why saving chat history alone breaks under worker replacement.


Why chat history alone breaks a human handoff

When an agent hits an approval gate and yields control, four things exist in memory that a plain message log does not capture:

  1. The pending interruption identity and payload (which exact tool call and arguments are awaiting approval).
  2. The execution policy and hooks that authorized the run when the pause happened.
  3. The workspace or external-effect preconditions (file hashes, permissions, or in-flight job IDs).
  4. The checkpoint schema version across rolling deployments.

If a worker restarts—or a different Kubernetes pod handles the webhook when the human clicks Approve 20 minutes later—missing any of those four turns resume into either a stuck approval or a duplicate side effect.


Five rules from v1.0.0-alpha.2 and v0.26.0

1. Persist history and pending approvals in one atomic compare-and-replace write

In v1.0.0-alpha.2, ResumableSession stores conversation history and pending approvals together under one session ID via ResumableSessionStore. Notice the store contract from docs/sessions/index.md:

from agents import Agent, ResumableSession, RunConfig, Runner

# Worker 1: create and run until an approval interruption pauses execution
session = await ResumableSession.create(store)
result = await Runner.run(
    agent, "Prepare release notes and apply patch.", session=session, run_config=config
)

# Worker 2 (after human reviews interruption): resume with atomic store checks
session = await ResumableSession.resume(store, session.session_id)
if session.is_paused:
    state = await session.load_state(agent)
    for req in state.get_interruptions():
        state.approve(req)  # or state.reject(req)
    # Loaded state remembers the session; recreate RunConfig on the new worker
    resumed = await Runner.run(agent, state, run_config=config)
Enter fullscreen mode Exit fullscreen mode

Your store must implement conditional replacement (await store.save(session_id, value, expected=previous)), returning True only after the write commits and False if the record changed underneath it. Only one writer should own a session at a time.

2. Reconstruct the full execution contract on the replacement worker

The v1.0.0-alpha.2 upgrade notes are explicit: loading RunState does not carry your live callbacks across processes. On the replacement worker you must recreate RunConfig with the matching model provider, tool declarations, authorization policy, hooks, and redactor:

"Missing required SDK tools or hooks leave approvals pending."

3. Verify workspace state before resuming local file/command approvals

For native workspace tools (exec_command or apply_patch), v1.0.0-alpha.2 requires restoring the exact workspace path, permissions, and required hooks:

"Affected files must match their saved state."

If a user or background job modified the file while the approval sat in a queue, blindly applying an old patch corrupts the workspace.

4. Save an idempotent job ID before dispatch—not after

If the worker dies after calling an external service but before the checkpoint commits (ResumableSessionError.reason == "active"), retrying blindly causes double execution. The SDK's resumable_jobs pattern records (job_id, tenant, session_id, requested_action) in shared storage before calling submit_job:

# 1. Persist intent + deterministic job_id before dispatch
await job_registry.save_intent(
    job_id=job_id,
    tenant=tenant_id,
    session_id=session.session_id,
    action="generate_sales_report",
)

# 2. Submit with tool_use_behavior={"stop_at_tool_names": ["submit_job"]}
# 3. On crash recovery (reason == "active"), query job_registry / service by job_id
#    rather than dispatching a second job.
Enter fullscreen mode Exit fullscreen mode

As the release notes warn verbatim:

"After failure or worker loss, inspect the checkpoint and workspace. Reconcile partial edits and other external effects before retrying. Recovery cannot restart terminated commands or recover alpha.1 approvals that ended the model call."

5. Upgrade checkpoint readers before writers

v1.0.0-alpha.2 reads alpha.1 RunState schema 1.22 and always writes schema 1.24 (with protected ResumableSession checkpoints bumped to version 2). alpha.1 workers cannot read 1.24 snapshots—so deploying writers before readers strands active human-in-the-loop sessions mid-flight.

Alongside v1.0.0-alpha.2, stable v0.26.0 (also released 24 November 2026) tightened two adjacent handoff boundaries: preserving handoff redaction inside Session history (6f45b21), and requiring explicit application approval via named image attachments (image_attachments={"diagram": "/app/diagram.png"}) in codex_tool (#6171) instead of letting models pass raw filesystem paths.


Honest limitation & primary sources

Applied AI Series — Day 40 (Part 15).

Top comments (0)