Skip to content

fix(editor): surface a failed server start in VS Code and keep findings on file reopen - #8343

Merged
EffortlessSteven merged 14 commits into
mainfrom
claude/project-thread-09v3y0
Oct 17, 2026
Merged

EffortlessSteven merged 14 commits into
mainfrom
claude/project-thread-09v3y0

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Closes #8342. Closes #8348.

Two editor friction fixes found by using the extension and LSP as a developer would. They share a branch because this session was limited to one.

1. VS Code, failed server start (#8342)
Before: if the resolved ripr binary died during the LSP handshake, the status bar stayed on "ripr: starting" forever and activation rejected with a generic toast.
After: the status becomes "server is not available" with the reason and a Restart Server next step, a warning with Show Output appears, and activation logs the failure instead of rejecting. The report happens before cleanup so a failed stop() cannot hide it.
Proof: new show_output_action test fails without the fix and passes with it (witnessed); independent reviewer found no blockers.

2. LSP, reopen (#8348)
Before: closing and reopening an unchanged Rust file (or opening a second changed file the last refresh already analyzed) replaced its finding with "paused: save a new file first".
After: a clean open adopts the analyzed identity the committed snapshot already holds for exactly those saved bytes, so the finding stays. A buffer or digest that differs still quarantines.
Proof: live driver repro (reopen published the marker before, nothing after); did_open_matching_disk_bytes_with_stale_committed_snapshot_keeps_refresh gained a no-quarantine assertion that fails without the fix; new adopting_the_committed_digest... unit test; lsp:: lib tests 1011 passed.

Verification notes: VS Code host is not available here, so the TS suites ran under a local vscode stub (command_menus_manifest fails on a stale local base only; main has #8296). cargo xtask precommit result is recorded in a comment before the merge-ready/full-ci labels.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

…pinning on starting (#8342)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven self-assigned this Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 66 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: b604726b-aec5-4b08-bfc3-a854ecdf402d
📥 Commits

Reviewing files that changed from the base of the PR and between 71859f9 and 490740d.

📒 Files selected for processing: 9
  • changelog.d/8342-vscode-handshake-failure-status.md
  • changelog.d/8348-lsp-reopen-keeps-finding.md
  • crates/ripr/src/lsp/backend.rs
  • crates/ripr/src/lsp/state.rs
  • crates/ripr/src/lsp/tests.rs
  • crates/ripr/tests/cli_smoke.rs
  • editors/vscode/src/client.ts
  • editors/vscode/src/extension.ts
  • editors/vscode/test/suite/show_output_action.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…nnot hide it (#8342)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z
@EffortlessSteven EffortlessSteven changed the title fix(vscode): surface a server that dies at the handshake instead of spinning on starting fix(editor): surface a failed server start in VS Code and keep findings on file reopen Oct 17, 2026
Claude and others added 3 commits October 17, 2026 04:25

Copy link
Copy Markdown
Member Author

Local verification on head af2f093a before labeling:

  • cargo xtask precommit: exit 0 (all gates pass, incl. fmt, clippy selection, policy checks, changelog fragments).
  • cargo test -p ripr --lib lsp::: 996 passed, 0 failed. The no-quarantine assertion in did_open_matching_disk_bytes_with_stale_committed_snapshot_keeps_refresh fails without the backend change (witnessed); the new state unit test covers digest mismatch, diverging buffer and matching bytes.
  • VS Code: npx tsc -p ./ clean; show_output_action 2/2 (new test fails without the fix, witnessed), lifecycle_coordinator, workspace_trust_runtime, workspace_trust_transition pass under a local vscode stub (no VS Code host available here). The hosted vscode job runs via full-ci.
  • Independent reviews (fresh Sonnet 5.5 subagents, since CodeRabbit and Gemini are rate-limited): ux(vscode): a server that dies at the handshake leaves the status bar on "starting" and fails activation #8342 half had no blockers, one edge fixed (report before cleanup). ux(lsp): reopening an unchanged file replaces its finding with a "paused: save a new file first" marker #8348 half had no soundness hole; applied: re-serve committed diagnostics on adoption, .rs-only guard, negative diverging-buffer test.
  • Not verified: Windows behavior, a real VS Code host run.

Generated by Claude Code

@EffortlessSteven EffortlessSteven added full-ci Run required, advisory, and release-like CI lanes. merge-ready labels Oct 17, 2026 — with Claude
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 04:42
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot 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.

Verification questions

  • Confirm source-route gap: adoption is gated to extension == "rs" in state.rs and no other did_* route (did_change/did_save/did_close/did_open with new bytes) was inspected for the same stale-committed identity loss; the .rs claim in the changelog may be narrower than reality or the route may be incomplete.
  • Confirm editors/vscode/src/client.ts:741 — When the handshake throws, two notifications fire (warning with Show Output action and status bar serverUnavailable) on top of the extension's activation log line. Confirm with maintainers that this is the intended UX and consider demoting to a single warning to avoid double-toast.
  • Confirm vscode extension surfaces the failed handshake but cannot fix it; the user still sees two toasts (warning + status popup if shown) and a non-rejecting activate, which is a UX regression vs. the previous generic toast unless the warning is intentionally fire-and-forget.
  • Confirm augmented did_open_matching_disk_bytes_..._keeps_refresh only adds one quarantine-absence check; the new unit test carries the meaningful assertions, so the integration proof is thin but not absent.
  • Confirm adoption can only lift NoAnalyzedSavedContent quarantine when the live buffer and saved bytes both equal the committed digest for the relative Rust path.
  • Confirm pR claim truth: changelog.d/8342 asserts status -> serverUnavailable with reason + Restart Server next step + Show Output warning, and activation logs instead of rejecting. client.ts shows the catch writes kind: 'serverUnavailable', nextStep: ...Restart Server..., calls warnWithOutput; extension.ts wraps startServerOnce in try/catch and appends to output rather than rethrowing.
  • Confirm only one pattern (.rs + saved_digest == committed_digest == buffer_digest) was scanned for adoption. A no-match in the sibling route scan is not proof that no other entry point loses the committed identity; a route probe across all did_* entry points is required to claim the fix is complete.
  • Confirm vS Code handshake-failure test relies on a private (status) field via unknown cast; if RiprClientController exposes state differently the assertion fails for unrelated reasons.
  • Confirm rust unit test covers .rs adoption only; non-.rs committed-snapshot adoption is gated to return false before path checks, so the guard is unverified.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • extension.ts activate() try/catch only logs; no test asserts activation no longer rejects.

Parked follow-ups

  • Parked: if any non-.rs file type later grows a producer-captured committed digest source, adopt_committed_identity's extension gate must be relaxed in lockstep; current diff intentionally defers that.

main's cli_smoke check_python_finding_* oracle still expected the wire token
that #8275 removed from the bounded render; port the same alignment #8336 carries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

Copy link
Copy Markdown
Member Author

rust-tests-junit failed on cli_smoke::check_python_finding_with_repair_card_points_at_the_card. It is not this PR's change: the same test fails identically on an unrelated checkout of main (1030218b), because #8275 dropped the (preview_limited) token from the bounded State: line and this oracle still expects it (main's e86ddf81 CI run is red too). #8336 carries the same oracle alignment but is a larger draft, so I ported the one-line test fix here (crates/ripr/tests/cli_smoke.rs): both check_python_finding_* tests pass locally. It no-ops once #8336 or another fix lands.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Independent review (Sonnet 5.5 subagent) of exact head 6c182e15: findings, none blocking, one medium. It was a static read; the reviewer did not run builds or tests.

What holds up:

  • The client.start() catch in client.ts paints serverUnavailable and warns before client.stop(), so a failed stop cannot hide the failure.
  • The startGeneration guard prevents a stale start from overwriting a newer status.
  • The new test in show_output_action.test.ts discriminates: without the catch addition the status stays starting and no warning fires.

Findings:

  1. Medium. The comment and changelog say "the controller already surfaced the failure". That is true only for the client.start() handshake path. Throws from resolveServer() or createLanguageClient() in startOnce sit outside the try. Previously activation rejected and the user saw VS Code's "Activating extension failed" toast. With the new swallow in extension.ts (~L349-356) it becomes a silent output.appendLine. Suggest wrapping the whole startOnce body, or having the activation catch also warn with a Show Output action. At minimum, soften the claim.
  2. Low. The serverUnavailable status label reads "ripr: server missing", which is misleading when the server exists but died at the handshake (statusRender.ts ~L153).
  3. Low. The activation swallow has no test, outputLines is collected but never asserted, and the test reads the private status through a cast.
  4. Low. This PR also carries an unrelated LSP change (ux(lsp): reopening an unchanged file replaces its finding with a "paused: save a new file first" marker #8348) and a cli_smoke follow-up (ux(output): plain-language default verdict (tokens only in human-full/JSON/explain) (#8158 item 4) #8165). In lsp/backend.rs ~L5457 the old comment now sits above the new if block rather than the code it describes. Consider splitting the PR, or state the bundling in the body.

For the author: please address 1 and 4 before merge. Hosted checks, including full-ci, are still running. A red cli_smoke::check_python_finding_with_repair_card_points_at_the_card was already noted here as also failing on main.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

rust-coverage failed on head 6c182e1 after every test passed: llvm-profdata merge rejected a corrupt .profraw ("file header is corrupt", "no profile can be merged"). That is the known intermittent coverage-instrument flake (#4978), not something this diff touches (no tests failed, no lcov was produced). Re-running the failed job once; a second failure will be treated as real.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

windows-advisory failed on 6c182e1 with "incomplete_evidence": the lane reports 65 to 67 failing tests per run on Windows (gap_artifacts shell quoting, cwd_placeholder, custody-root xtask tests, icacls unreadable-subtree, and similar). None are in the files this PR touches (lsp/state.rs, lsp/backend.rs, editors/vscode, one cli_smoke assertion), and the lane's own text says it is advisory and not a required check (#2393). Not this PR's failure and not something I can fix within its scope, so I'm leaving it. The only other non-green check is rust-coverage, which I re-ran once after a corrupt-profraw flake and is still running.


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

Copy link
Copy Markdown
Member Author

After merging main (3dccaf7), rust-tests-junit failed once on chaos_interrupted_runs::managed_producer::managed_exporter_nonzero_exit_rejects_partial_and_preserves_published_packet ("exporter received an unexpected packet path ... .json.tmp"), a Perl managed-exporter test in code this PR does not touch (this diff is only lsp/state.rs, lsp/backend.rs, lsp/tests.rs, editors/vscode, changelogs). It looks like a timing race on a temp file in that test. Re-running the failed job once; if it fails again I will treat it as reproducible and look at it properly.

Earlier on 6c182e1, rust-coverage failed twice with the corrupt-profraw merge error from #4978 (all tests passed both times), and windows-advisory is advisory-only.


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z
…os fixture (#8374 follow-up)

#8374 runs the managed exporter from the checkout root with a root-relative
--out, so the chaos fixture's confinement check rejected every received path.
Join a relative path onto the fixture root before confining it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

Copy link
Copy Markdown
Member Author

The rust-tests-junit and rust-coverage failures on 3dccaf7 are not from this PR: six chaos_interrupted_runs::managed_producer tests fail deterministically on current main since #8374, which now runs the Perl exporter from the checkout root with a root-relative --out. The chaos fixture's confinement check compared that relative path to an absolute cache root and rejected it ("exporter received an unexpected packet path"). I reproduced it locally with cargo test -p ripr --features lang-perl --test chaos_interrupted_runs (6 failed) and ported a small fix into this PR as 445d7df (join a relative received path onto the fixture root before confining it); the same command now passes 15 of 15. No open PR carried this fix. Whoever owns #8374 can drop or keep it; it no-ops once main has an equivalent.


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

Copy link
Copy Markdown
Member Author

Head 445d7df: the Perl chaos tests now pass, and rust-tests-junit then stopped (fail-fast) on cli_smoke::first_pr_check_exits_2_for_a_blocked_packet_but_write_mode_exits_0 ("could not resolve a default base ... shallow clone"). That test arrived with #8380, runs ripr first-pr in a temp dir outside any repo, and passes for me locally on the same tree (1 passed), so I read it as hosted-environment dependent, not caused by this diff (lsp, editors/vscode, one chaos-fixture path). I merged the latest main and pushed so CI re-runs on a fresh head; if this test fails again on the new head I will dig into it instead of assuming.


Generated by Claude Code

…git discovery

The temp root can resolve to a path inside the checkout; on a PR runner the
shallow detached checkout has no default base, so first-pr failed before it
could report the blocked state. Bound git discovery at the root's parent.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

Copy link
Copy Markdown
Member Author

cli_smoke::first_pr_check_exits_2_for_a_blocked_packet_but_write_mode_exits_0 failed again on 2b33c66, so it reproduces on PR runners (main's push runs pass, and it passes locally). My reading, not yet proven on the hosted runner: the test's temp root can land inside the PR's shallow detached checkout, where git discovery finds the checkout and no default base exists, whereas a push run on main has a local main. I bounded git discovery at the temp root's parent with GIT_CEILING_DIRECTORIES for that test only (pushed), which keeps its assertions unchanged. If the next hosted run still fails here I will look at the runner's actual temp path rather than guess again.


Generated by Claude Code

@settings settings Bot removed the merge-ready label Oct 17, 2026

@github-actions github-actions Bot 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.

Confirmed findings

  • editors/vscode/src/extension.ts:346 — startOnce swallows pre-handshake resolveServer/createLanguageClient throws into output.appendLine only; while activation stops rejecting, a user facing 'no language server' gets no status-bar change and no Show Output warning. Consider promoting that catch to either warnWithOutput(...) or wrapping the whole startOnce body so client.start catches resolve/create failure too.
  • crates/ripr/src/lsp/backend.rs:3031 — Lock-poison silently demotes to false: latest_analysis.lock().ok().and_then(...) returns None on poison and the adoption is skipped without propagation. Consistent with the rest of this file's existing poison handling, so not a new lifetime hazard, but worth noting the documents branch uses .is_some_and(...) and also silently no-ops on poison. No action required unless the rest of the file is hardened.
  • crates/ripr/tests/chaos_interrupted_runs.rs:650 — temporary_path now joins a relative marker path onto fixture.root. The cache confinement check still rejects escapes, but a marker file owned by the test process is trusted as-is; ensure upstream caller (#8352) cannot let an attacker-controlled path string reach this function in any production code path.
  • editors/vscode/src/extension.ts:349 — The activation swallow only logs to output. Throws from resolveServer/createLanguageClient in startOnce (outside client.start) become silent failures with no warnWithOutput. Either widen the try to wrap the whole startOnce body or add a warnWithOutput fallback; at minimum soften the changelog claim that 'the controller already surfaced the failure'.

Verification questions

  • Confirm source-route claim (.rs only) is testable but not yet proven end-to-end by an integration test for a non-.rs clean open over matching bytes. Unit test gates the state layer; an integration probe would close the loop.
  • Confirm adopt_committed_identity's return type bool says 'document now clean', but the implementation returns state.quarantine.is_none() after refresh_quarantine; buffer_authority_unknown or saved_digest mismatch returns false early without re-quarantining, so callers cannot distinguish 'adopted and lifted' from 'did nothing because mismatched'.
  • Confirm state unit test exercises both refuse paths (diverging saved digest, diverging buffer) and the accept path, but only on a single .rs extension; non-rs guard is asserted by extension != 'rs' early-return which has no test coverage in this PR.
  • Confirm two non-LSP test repairs (chaos Perl relative --out; cli_smoke GIT_CEILING) are correct fixes for hosted-runner flakes independent of this PR's features but only proved locally by the author; if either regresses on main there is no in-PR witness beyond the author's local pass.
  • Confirm try/catch in client.ts.start() only encloses createLanguageClient().start(); throws from resolveServer() or createLanguageClient() itself in startOnce() land in extension.ts and are swallowed to output.appendLine without a warning or status update.

Refuted

  • A UniCase-style HashMap or HashSet<String> collision around the new adopt_committed_identity(uri, committed_digest, input_identity) keys could allow unrelated files to be adopted under a stale committed digest.; refuted because: uri is a lsp_types::Uri and committed_digest is a producer-captured hex digest from rust_consumed_sources.digest. The saved_digest != committed_digest && buffer_digest != committed_digest guard means even a key collision cannot adopt mismatched bytes; path-extension guard and per-state field-level identity copy further block cross-document adoption. No globbing or wildcard key.
  • The adoption path could silently lift quarantine for a non-.rs file because state.rs only checks extension=='rs' in adopt_committed_identity, but a future refactor could drop the guard and no integration test would catch it because the unit test is the only guard.; refuted because: The unit test adopting_the_committed_digest_lifts_never_analyzed_quarantine_only_for_matching_bytes uses a .rs URI; the guard lives in state.rs and is reviewable. This is a source-route gap (low) rather than a red/green correctness hole.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

vscode failed on 9872dac in multiroot.test ("code actions ... failed: Canceled: Canceled open=chatSessionInput..."), a VS Code extension-host cancellation while the harness requested code actions. 9872dac only changes a comment in extension.ts, and the same vscode job passed on the two earlier heads of this PR (including the one that added the handshake test), so I'm treating it as an extension-host flake, not this diff. Re-running the failed job once; a second failure gets a real look.


Generated by Claude Code

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.13924% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ripr/src/lsp/state.rs 88.52% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FxXb3KRfWM32PA5EtQ854z

Copy link
Copy Markdown
Member Author

Merged main into the branch (490740d) to clear a conflict in chaos_interrupted_runs.rs; main already carried an equivalent fix, so I took main's version. The previous head 9872dac was fully green, including vscode after a re-run of the known multiroot.test extension-host flake. Re-applying merge-ready so CI runs on the merged head; the diff against main is unchanged apart from that file.

cargo xtask precommit was run on the pre-merge head (result in an earlier comment); the merge touched only main's own changes.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 11:13
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 11:13
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown
Member Author

rust-coverage failed on 490740d with no lcov.info produced (the coverage-merge step died, the known intermittent profraw failure tracked in #4978). It passed on the previous head 9872dac with the same code, and the merge only brought in main's changes. Re-running the failed job once; if it fails again I'll treat it as real.


Generated by Claude Code

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

Labels

full-ci Run required, advisory, and release-like CI lanes. merge-ready

Projects

None yet

2 participants