Skip to content

fix(client): Await the in-flight stdio session after a cancelled connect waiter - #5545

Closed
mikamikasuki wants to merge 1 commit into
PrefectHQ:mainfrom
mikamikasuki:fix/fmc-0025-stdio-cancelled-connect-reuse
Closed

mikamikasuki wants to merge 1 commit into
PrefectHQ:mainfrom
mikamikasuki:fix/fmc-0025-stdio-cancelled-connect-reuse

Conversation

@mikamikasuki

Copy link
Copy Markdown
Contributor

Description

Retain the in-flight ClientSession future on StdioTransport so a later connect_session() caller can await startup after the original waiter is cancelled. Clear it on disconnect and preserve the existing ready-session connect() behavior.

Closes #

Contribution type

  • Bug fix (simple, well-scoped fix for a clearly broken behavior)
  • Documentation improvement
  • Enhancement

Checklist

  • This PR addresses an existing issue (or fixes a self-evident bug)
  • I have read CONTRIBUTING.md
  • I have added tests that cover my changes
  • I have run uv run prek run --all-files and all checks pass
  • I have self-reviewed my changes
  • If I used an LLM, it followed the repo's contributing conventions (not generic output)

Retain the in-flight ClientSession future on StdioTransport so a later caller can await a connection whose first connect_session waiter was cancelled. Reset the future during disconnect and preserve the existing return behavior for ready keep-alive sessions.

🤖 Generated with OpenAI Codex
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

This pull request was closed because it needs a valid issue link. Please update this PR rather than opening a new one.

Per CONTRIBUTING.md, an external PR must reference an issue that's assigned to its author. To get there:

  1. Find or open an issue describing the change — if you open it, you have first claim on it.
  2. Add Fixes #<issue>, Closes #<issue>, or Resolves #<issue> to this PR's description — edit it in place, don't open a new PR.

Once you're assigned and the link is present, this check is re-run automatically. Previously gate-closed PRs also reopen — no further action needed.

Maintainers: reopen this PR or remove the missing-issue-link label to bypass this check.

@github-actions github-actions Bot closed this Oct 6, 2026
@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. client Related to the FastMCP client SDK or client-side functionality. labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. client Related to the FastMCP client SDK or client-side functionality. missing-issue-link

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant