Skip to content

Orphaned session task-queue: workflow unqueryable after its session ends until manual adv_worktree_resume #303

Description

@JRedeker

Summary

With per-session isolated task queues (isolateAdvWorkerTaskQueues), a change workflow is pinned to the task queue of the session that created it (advance-<projectId>-sess_<ptr>). When that session ends (or its worker exits), no live worker polls that queue, so any tool that must query/signal the workflow fails fast with ServiceError: Failed to query Workflow — even though the workflow itself is healthy and the Temporal server is fine.

Incident evidence (2026-07-23)

  • Change fixDurableProofFallback created in session sess_ZH2cWlqT; workflow Running, healthy (HistoryLength 140, StateTransitionCount 82).
  • After an unrelated session restart, temporal task-queue describe on advance-bdf259aa162ae192af5b18899ccdc653b085528d-sess_ZH2cWlqT showed zero pollers.
  • adv_gate_status / adv_change_show returned ServiceError: Failed to query Workflow (fast, not timeout). adv_change_list still worked (reads server-side search attributes, no worker query).
  • Manual recovery: adv_worktree_resume changeId: fixDurableProofFallback re-hosted it onto the live session; queries then succeeded.

Expected

A live worker should auto-adopt an orphaned session queue whose owning session is gone, so healthy workflows remain queryable/signalable without a manual adv_worktree_resume. Unsafe/ambiguous ownership must remain fail-closed (no cross-session hijack of a queue still served by a live peer).

Status

This is the target behavior of the in-flight change autoAdoptOrphanSessionQueues (Epic hardenTemporalReliability, execution phase, 1/6 tasks done). Filing this issue as a GitHub-visible reproduction + evidence record and to track closure against that change. Not a competing proposal.

Related

  • isolateAdvWorkerTaskQueues (archived) — introduced per-session queues.
  • list-orphan-session-queues.ts, orphan-queue-adopter.ts (source).
  • Companion incident: stale plugin-host generation opaque-timeout (separate issue, same 2026-07-23 session).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions