Skip to content

[Bug]: t3_thread_read reports completed while background work still holds the thread #36609

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Start a thread whose agent launches a background subagent that holds completion.
  2. Let the root turn finish while that child remains pending.
  3. Read the parent through t3_thread_read (also used by peer agents and CLI thread show).
  4. Compare the returned status with t3_thread_list and the sidebar.

Deterministic service repro: in the existing readThread preserves caller access case in apps/server/src/mcp/OrchestratorMcpService.activity.test.ts, complete the root run while leaving the pending subagent in the shell, then assert that readThread(...).thread.status is waiting. Run pnpm exec vp test run apps/server/src/mcp/OrchestratorMcpService.activity.test.ts -t 'preserves caller access'.

Expected behavior

The thread reads as waiting while completion-holding background work remains. An active root retains priority; unawaited commands and monitors do not hold completion, and failed roots remain visible as failed.

Actual behavior

The read reports completed even though the pending child remains visible in pendingBackgroundTasks. Listing and the sidebar correctly show waiting. This can mislead an orchestrating agent into treating unfinished work as complete; no data loss was observed.

Impact

Minor bug or occasional failure

Version or commit

Reproduced on pingdotgg/main at 35d01dc. Independently confirmed by Claude Opus 5.5 at d2bdd58.

Environment

Linux; public MCP service test with deterministic run and background-task fixtures. Provider-independent status calculation.

Logs or stack traces

Expected: "waiting"
Received: "completed"

Workaround

Inspect pendingBackgroundTasks or use t3_thread_list while background work remains.

Found by the maintainer bughunt (GPT 6.1 Sol), independently verified by Claude Opus 5.5. Related merged PR #34674 corrected listing only; thread read remained outside its scope. Live paired MCP calls against one isolated thread have not been captured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions