Skip to content

fix: restore formatter fallback during server replacement - #144

Merged
Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
fix/formatter-fallback-during-restart
Nov 12, 2026
Merged

Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
fix/formatter-fallback-during-restart

Conversation

@edvilme

Copy link
Copy Markdown
Contributor

Fixes #139.

Summary

Restore the formatter fallback after the old client's stop settles and while replacement startup is pending, without adding it while the old client is still healthy.

  • Add an optional synchronous onOldClientStopped notification to restartServer, called before replacement creation only when the old client is Stopped after its stop attempt settles.
  • Restore the context-owned fallback through that notification only while the context is undisposed. Keep the existing healthy-replacement removal boundary, disposal guards, retry semantics, status behavior, and continue-on-stop-error behavior.
  • Update the existing lifecycle characterization and add focused failure/disposal regressions using real createToolContext + restartServer orchestration, the shared client mock, and explicit deferred stop/start barriers. No shared mock changes.

The supported languageclient 8.1.0 implementation emits public Stopped when shutdown begins, before disposing feature registrations. Waiting for stop to settle avoids relying on that premature state event or keeping stale client/status listeners alive.

Validation

Runtime: Node 24.17.0 / npm 11.13.0.

  • Reproduced the gap before the production fix: three regression failures, each observing one fallback registration instead of the expected second registration while replacement startup was held.
  • Focused lifecycle tests: 47 passed.
  • Full TypeScript suite: 160 passed.
  • TypeScript build: passed.
  • Production lint and changed-test ESLint: passed with existing warnings.
  • git diff --check: passed.
  • Changed-file Prettier check still reports formatting issues in all three changed files; each file also fails on the exact baseline. Unrelated formatting was left unchanged.

Live VS Code formatter-picker behavior was not verified in an extension host. These tests establish lifecycle/provider ownership, not visible picker behavior.

Restore the fallback after the old client's stop settles and before
replacement startup, without registering beside a healthy old client.
Preserve disposal guards and cover stop errors, failed startup, and stale
client events with real restart orchestration and deferred barriers.

Fixes #139

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85ef72cc-9e26-4bc4-b1c3-55256d9bef91
@rchiodo

Rich Chiodo (rchiodo) commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@rchiodo

Copy link
Copy Markdown
Contributor

Reviewed commit: 14d2e3c47c601beab7ea50055885aa661ad46be1

Result: 🔴 could-not-verify

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Podman machine &#x27;pyrx-automation&#x27; is not running.

Test runs: none recorded.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 12, 2026
@edvilme Eduardo Villalpando Mello (edvilme) added the debt Code Cleanup, Refactorings and Repo health. Not feature related label Nov 12, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) merged commit 459caa5 into main Nov 12, 2026
18 of 20 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the fix/formatter-fallback-during-restart branch November 12, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code Cleanup, Refactorings and Repo health. Not feature related review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lifecycle] Investigate missing formatter fallback during replacement

2 participants