Skip to content

refactor(inference): own attempt cancellation and provider feedback - #1034

Closed
Gajesh2007 wants to merge 5 commits into
refactor/coordinator-inference-settlementfrom
refactor/coordinator-inference-attempt
Closed

Gajesh2007 wants to merge 5 commits into
refactor/coordinator-inference-settlementfrom
refactor/coordinator-inference-attempt

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Dispatch, provider ingress and response relays shared cancellation and provider-feedback policy through api.Server. inference/attempt now owns those operations and their cancellation history. api/inference_attempt.go supplies current registry, model-store, reservation, logger and metric dependencies; response relays use the same Service directly.

Stacked on #1027 (refactor/coordinator-inference-settlement). This is the shared attempt boundary for the subsequent dispatch and ingress extractions.

Before

flowchart TD
  D[Dispatch and provider ingress] --> A[Server cancellation and feedback methods]
  R[Response relays] --> F[responseServices forwarding methods]
  F --> A
  A --> T[API zombie tracker: record, enqueue, correlate terminal]
  A --> H[Registry health and capacity recorders]
  A --> B[Shared settlement refunds]
  T --> O[Same cancellation and terminal outcomes]
  H --> P[Retry eligibility and recovery]
Loading

After

flowchart TD
  D[Same dispatch and provider ingress] --> A[attempt.Service via API bindings]
  R[Same response relays] --> A
  A --> T[Private attempt.Tracker: same record and enqueue ordering]
  A --> H[Same registry health and capacity recorders]
  A --> B[Same shared settlement refunds]
  T --> O[Same cancellation and terminal outcomes]
  H --> P[Same retry eligibility and recovery]
Loading

The tracker keeps its existing bounds, expiry, recency and resend rules. Nonblocking enqueue acceptance and sent marking remain under the tracker mutex so an immediate terminal cannot observe an accepted cancel as unsent. Cancellation still records before pending removal, refunds only the attempt it removes, and preserves first-content timeout arbitration. API terminal claiming, parked settlement and route outcomes retain their ordering. Typed neutral, capacity and legacy failure classifications are unchanged.

Pure policy/history tests follow their owner. Actual WebSocket, financial and response tests remain at the API boundary; two fixtures consume the same terminal receipts as ingress instead of accessing tracker maps. No tracker mutex or map is exported. The existing three metric adapters share one name and implementation across attempt and settlement bindings.

Validation:

  • All 100 moved declarations match original Go tokens under explicit owner/dependency mappings, including the two fixture constructors. All 3,512 original test/benchmark entries remain, with 23 moved beside the owner and one new response-binding test.
  • The new real response-path test passes unchanged against both the original source and this extraction. It proves current registry/model context and late metrics configuration, plus recovery on successful completion.
  • Full API/inference Go 1.25 race suite passes, as do the affected cancellation/health tests and the complete attempt package. Existing opt-in skips are reported in the validation receipt; database variables were unset.
  • Pinned golangci-lint 2.1.6 reports zero issues; all 280 documentation checks pass. Independent review covers the source and boundary 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 14, 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 14, 2026 7:03pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 14, 2026 7:03pm UTC
d-inference-landing Ready Ready Preview Sep 14, 2026 7:03pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 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-14T19:06:27.620423Z 274e2ae 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.

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: d895a0074b

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

…/coordinator-inference-attempt

# Conflicts:
#	docs/developer/build.md
#	docs/developer/test.md
#	docs/reference/protocol-messages.md
@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

Refreshed the parent branch and resolved documentation/source-map conflicts. Existing subsystem implementations and regression tests are preserved. Exact parent composition and independent review pass; all coordinator test packages compile and documentation checks pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 274e2ae886

ℹ️ 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 (274e2ae886704acd5d98aea0291b483737985d94), 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

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference-console-ui-dev — 274e2ae8 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference — 274e2ae8 Deployed Sep 14, 2026 by vercel[bot]
Preview – d-inference-landing — 274e2ae8 Deployed Sep 14, 2026 by vercel[bot]
benchmarks — 274e2ae8 Deployed Sep 14, 2026 by Gajesh2007 via E2E Benchmarks #1308
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