Skip to content

Fix SSE notification routing and stale session cleanup#186

Merged
lynnswap merged 5 commits into
mainfrom
codex/fix-sse-notification-routing
Jul 17, 2026
Merged

Fix SSE notification routing and stale session cleanup#186
lynnswap merged 5 commits into
mainfrom
codex/fix-sse-notification-routing

Conversation

@lynnswap

Copy link
Copy Markdown
Owner

Purpose

Prevent SSE notification buffer overflows caused by progress notifications being fanned out to unrelated or abandoned sessions. The warning represented real notification eviction, although stale-session fan-out amplified it.

Changes

  • Route notifications/progress only to the client session that owns the active operation.
  • Track HTTP request and SSE activity and expire inactive client transport sessions after a five-minute grace period.
  • Exclude internal runtime sessions and active requests or SSE streams from expiry.
  • Keep request activity active until the HTTP response write completes.
  • Move overflow accounting to the delivery store and rate-limit per-session warnings while reporting cumulative and delta drop counts and the actual evicted notification methods.
  • Document the routing, expiry, and recovery behavior and add regression coverage.

User impact

Active clients receive progress only for their own operations, abandoned sessions no longer accumulate indefinitely, and overflow warnings now contain enough information to distinguish real client backpressure from stale-session amplification.

Testing

  • swift test --no-parallel -Xswiftc -strict-concurrency=minimal — 981 tests in 64 suites passed
  • env XCODE_MCP_RUN_PROCESS_TESTS=1 swift test --no-parallel --filter XcodeMCPProcessRuntimeTests -Xswiftc -strict-concurrency=minimal — 24 tests passed
  • env XCODE_MCP_RUN_PROCESS_TESTS=1 swift test --no-parallel --filter ProxyStdioAdapterTests -Xswiftc -strict-concurrency=minimal — 13 tests passed
  • git diff --check
  • Codex self-review completed with no actionable findings

lynnswap added 2 commits July 17, 2026 01:02
Route operation progress to its owning session and expire inactive client sessions. Improve overflow accounting so dropped notifications remain observable without warning amplification.
Verify the process catalog owned by the control plane instead of the transient activation attempt phase, which can legitimately be cleared or replaced after catalog publication.
@lynnswap
lynnswap marked this pull request as ready for review July 16, 2026 23:56
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lynnswap

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a03656feff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/XcodeMCPProxyRuntime/Session/Session/SessionRegistry.swift
Comment thread Sources/XcodeMCPProxyRuntime/Session/Runtime/ProxyRuntimeAPI.swift

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 401645f183

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lynnswap
lynnswap merged commit 681945e into main Jul 17, 2026
9 checks passed
@lynnswap
lynnswap deleted the codex/fix-sse-notification-routing branch July 17, 2026 04:58
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