Skip to content

Continue a paused run that needs a session on its own request (0.261.482) - #1978

Merged
Paul Lizer (paullizer) merged 1 commit into
microsoft:Developmentfrom
paullizer:claude/session-bound-wait-continuation
Nov 23, 2026
Merged

Paul Lizer (paullizer) merged 1 commit into
microsoft:Developmentfrom
paullizer:claude/session-bound-wait-continuation

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Problem

In the 0.261.477 and 0.261.478 test runs, prompts failed after a pause with context_unavailable or result_unavailable, reason external_identity_session_unavailable.

  • The run paused (waiting) on a pending spreadsheet computation and its request ended.
  • The background scheduler resumed it 15 to 30 seconds later.
  • A result that names an external source (agent, action, memory, web) is authorized against the signed-in session on every read. The scheduler has no session, so that resume could only fail.
  • The next attempt of a failed run is started by a hook bound to the request, which a scheduler failure never reaches.

Change

  • Marker: a run saved as waiting records continuation_requires_session, decided from result lineage only (OrchestrationResults.lineage_names_external_source). No content is read and nothing is authorized. A lineage that cannot be read counts as needing a session.
  • Scheduler: _process_run defers a marked run (session_required) instead of claiming it. It still closes a marked run at its deadline.
  • Request worker: _continue_waiting_run continues the request's own paused run with the request's identity, using the same claim and saved-wait checkpoints the scheduler uses. It retries while the pending work is not ready (pause grows from 5 to 30 seconds) and stops when the run is no longer paused, is cancelled, or passes its deadline.
  • A failure after the pause now ends on that worker, so it reaches the existing next-attempt hook.

The session requirement itself is unchanged. Paused runs that need no session, and waits for credentials or user input, behave as before.

Not in this PR

  • A signed-in continue route for the browser. If the worker is lost during a pause, the run is closed at its deadline. Recorded as open item 28 in ORCHESTRATION_REACTIVE_LOOP_PROPOSAL.md.
  • The continuation uses the identity captured when the run started.

Testing

  • New tests in test_orchestration_external_results.py, test_orchestration_harness_scheduler.py and test_orchestration_harness_routes.py cover the lineage check with no session, the marker on a real paused run, the scheduler deferral and timeout, and the hook's claim, identity, pauses and stop conditions.
  • The hook test uses stand-ins for the claim and the execution; the path is not tested end to end.
  • test_orchestration_harness_scheduler.py has 12 failures, the same count as on Development before this change.
  • Cosmos boundary check: 0 review gaps after renewing 24 review entries (one owner, HarnessExecution._finalize, changed in body; it gained one saved field and no storage call).
  • Not run against a deployed application.

Docs: docs/explanation/fixes/PAUSED_RUN_SESSION_CONTINUATION_FIX.md.

🤖 Generated with Claude Code

…482)

A run paused on a pending spreadsheet computation was resumed by the
scheduler, which has no session. A result that names an external source
is authorized against the session on every read, so that resume could
only fail, and the failure never reached the hook that starts the next
attempt.

- A run saved as waiting records whether its results need a session,
  decided from result lineage only.
- The scheduler leaves a marked run alone and still closes it at its
  deadline.
- The request that started the run continues it on its own worker with
  the request's identity, then follows a failed run as before.

The session requirement is unchanged. A browser continue route for a
worker lost during the pause is recorded as open item 28, not built.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@paullizer
Paul Lizer (paullizer) merged commit 3d69fa7 into microsoft:Development Nov 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant