Skip to content

fix(server): confirm a protocol mismatch against the metadata that reported it - #552

Merged
lg2m merged 1 commit into
mainfrom
fix/daemon-discovery-stale-mismatch
Nov 3, 2026
Merged

lg2m merged 1 commit into
mainfrom
fix/daemon-discovery-stale-mismatch

Conversation

@lg2m

@lg2m lg2m commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Change

qq daemon run --detach (and any discovery) could fail with server protocol version 43 does not match client version 42 right after a daemon of another protocol stopped.

  • Discovery read stale metadata from the stopped daemon and got a protocol mismatch.
  • To confirm the other daemon was alive, it then read the metadata file a second time and health-checked whatever that file named.
  • When the new daemon had just rewritten the file, that probe reached the new, matching server, and discovery reported a mismatch that no longer existed.

Discovery now confirms a mismatch against the snapshot that reported it. A stale snapshot whose server is gone is retried, and the next read finds the new daemon. This is a pre-release fix for v0.1.11: it showed up as a flaky restart_replaces_a_daemon_from_another_protocol_version failure on #551's CI (test passed on attempt 2/2).

Verification

  • New a_mismatch_is_confirmed_against_the_metadata_that_reported_it. The same check against the old other_protocol_answers(paths) fails: it confirms the stale mismatch by probing the live server.
  • cargo nextest run -p qq --test daemon_lifecycle --stress-count 20: 20/20 passed.
  • cargo xtask check: passed.

Known impact

None. No wire, metadata format or CLI change.

@lg2m lg2m added the ci:full label Nov 3, 2026
@lg2m

lg2m commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T06:17:00.362520Z f6a64d2 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: c1b3dad6c0

ℹ️ 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".

@lg2m
lg2m enabled auto-merge November 3, 2026 06:10
@lg2m
lg2m force-pushed the fix/daemon-discovery-stale-mismatch branch from c1b3dad to f6a64d2 Compare November 3, 2026 06:15
@lg2m

lg2m commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased onto main after #551 merged (no content change). @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: f6a64d2b8a

ℹ️ 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".

@lg2m
lg2m added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit a7fae90 Nov 3, 2026
14 checks passed
@lg2m
lg2m deleted the fix/daemon-discovery-stale-mismatch branch November 3, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant