Skip to content

Fix duplicate-provider scan race with attestation renewal - #919

Closed
Gajesh2007 wants to merge 2 commits into
masterfrom
fix/provider-duplicate-attestation
Closed

Gajesh2007 wants to merge 2 commits into
masterfrom
fix/provider-duplicate-attestation

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Duplicate-device scans read a provider’s attestation pointer without the mutex used by attestation renewal. Concurrent renewal and a new connection’s duplicate scan race; repeated pointer reads also do not represent one snapshot. Use the existing GetAttestationResult accessor before comparing serials, preserving which sessions are disconnected and the existing teardown path.

Before:

flowchart LR
  A[Attestation renewal] --> B[SetAttestationResult under provider mutex]
  C[New connection duplicate scan] --> D[Read mutable attestation pointer under registry lock only]
  B -. races .-> D
  D --> E[Match serial and disconnect duplicate sessions]
Loading

After:

flowchart LR
  A[Attestation renewal] --> B[SetAttestationResult under provider mutex]
  C[New connection duplicate scan] --> D[GetAttestationResult under same provider mutex]
  B --> F[Immutable attestation snapshot]
  D --> F
  F --> E[Same serial match and disconnect after registry scan]
Loading

Validation:

  • New concurrent attestation/duplicate-scan regression fails on master under -race, with races in DisconnectDuplicatesBySerial and SetAttestationResult.
  • GOTOOLCHAIN=go1.25.0 go test -race ./coordinator/registry/... passes after the fix (registry 24.654s; routing simulations 4.066s). Existing duplicate tests verify that matching sessions are removed while the kept session and other devices remain connected.
  • scripts/docs-check.sh --all passes (278 documents); canonical attestation ownership documentation and changelog updated.

No wire format, model defaults, trust policy or deployment changes.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 11, 2026 11:44pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 11, 2026 11:44pm UTC
d-inference-landing Ready Ready Preview Sep 11, 2026 11:44pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 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-09-11T23:46:03.721395Z 44e936a 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 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: 41609402ef

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

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 44e936ac2a

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

@Gajesh2007

Copy link
Copy Markdown
Member Author

Consolidated into #1056 for review and merge after #1094, #1095 and #1096. #1056 contains this branch's exact head (44e936ac2a20f365ba7687748673f124248396b5), including its reviewed fixes, with implementations and regressions reconciled into the coordinator subsystem owners. Closing the component PR to collapse the stack; its branch, commits and review history are retained. Follow #1056 for combined validation and merge status.

@Gajesh2007 Gajesh2007 closed this Sep 16, 2026
jonathan308 added a commit that referenced this pull request Nov 13, 2026
…es allow

Review of #2058 and a read of the coordinator's cache receipts:

- A network request the coordinator planned for its prompt cache (it carries
  a cache scope or receipt nonce) now renders the prompt of its plan, never
  Transformers' JSON. The prompt sidecar plans for the prompt as rendered
  before, so a flagged render would contradict the lookup receipt
  (prompt_anchor_mismatch) and fence this Mac's cache affinity for the model
  (60 s, doubling to 10 min); today's coordinator forwards unknown body
  fields, so a caller could set the field and provoke that. An unplanned
  request (no scope: platform #919's sidecar declines flagged tool requests)
  still renders as it asks (ChatTemplateControls.servingCoordinatorRequest).
- DARKBLOOM_TEMPLATE_JSON=transformers applies to local chat requests only,
  no longer to the network's.
- Transformers' rendering needs the request's bytes (Evidence.captured): the
  local batch route and /v1/responses, which decode the field without them,
  and a body whose tools the ordered parser refuses render as before instead
  of Transformers' filters over sorted members.
- The local chat route copies the body once, as before.

Docs (inference.md, direct-mode.md) and the changelog fragment state which
requests render this way. Tests: onlyAnUnplannedCoordinatorRequestAsks,
aRequestWhoseBodyWasNotReadRendersAsBefore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch is waiting to be deployed

3 active and 1 waiting deployments
Preview – d-inference-console-ui-dev — 44e936ac Deployed Sep 11, 2026 by vercel[bot]
Preview – d-inference — 44e936ac Deployed Sep 11, 2026 by vercel[bot]
Preview – d-inference-landing — 44e936ac Deployed Sep 11, 2026 by vercel[bot]
benchmarks — 44e936ac Waiting Sep 11, 2026 by Gajesh2007 via E2E Benchmarks #978
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