Skip to content

fix(fleet): keep adjacent dispatches reusable - #470

Merged
kjgbot merged 5 commits into
mainfrom
lane/garden-ship-0904
Sep 4, 2026
Merged

fix(fleet): keep adjacent dispatches reusable#470
kjgbot merged 5 commits into
mainfrom
lane/garden-ship-0904

Conversation

@kjgbot

@kjgbotkjgbot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reuse recent successful control-plane evidence for adjacent team placements
  • invalidate that evidence after failures and require a new roster probe after a finite lease
  • delete ephemeral deterministic Relay identities during release so retries can reuse their worker names
  • prepare package metadata for the workflow-only 0.1.87 next-tag publication

Why

A full fleet inventory can exceed the five-second admission boundary in a workspace with substantial historical node data. Repeating it between sequential implementer and reviewer placements can strand a half-created team. Separately, releasing only the runtime retains its create-only identity, so retrying the deterministic name collides.

The release metadata is included here so these required fixes can be deployed without merging the older release-only PR #460. Publication remains exclusively through the repository publish workflow and the next dist-tag.

Validation

The complete local suite used an existing dependency tree because no install was performed: 2,468 tests passed; nine unrelated tests failed because that tree lacks the built dist artifacts and has an incompatible persona-kit export. Clean-runner CI is the merge gate.

@coderabbitai

coderabbitaiBot commented Sep 4, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 612e8c90-4679-4bb1-b1e6-d359b41fa7e5


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head be58cbd3f75303ac53e0c402aae89fe4a3326611.

kjgbot added 2 commits September 4, 2026 22:51
Session-Id: 01a06e0f-f7a1-7902-b058-9129b9679596
Session-Id: 01a06e0f-f7a1-7902-b058-9129b9679596
Session-Id: 01a06e0f-f7a1-7902-b058-9129b9679596
@kjgbot
kjgbotforce-pushed the lane/garden-ship-0904 branch from be58cbd to 0b6df4eCompareSeptember 4, 2026 20:52
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head 0b6df4e82e89cca8864ca74093e0750ef76d6cea.

@cubic-dev-aicubic-dev-aiBot 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.

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment threadsrc/fleet/control-plane-circuit.ts Outdated
Comment threadsrc/fleet/control-plane-circuit.ts Outdated
Comment threadsrc/fleet/control-plane-circuit.ts Outdated
Comment threadsrc/fleet/relay-fleet-client.ts
Session-Id: 01a06e0f-f7a1-7902-b058-9129b9679596
@kjgbot

Copy link
Copy Markdown
ContributorAuthor

Addressed all four Cubic findings on head fe4591d:

  1. Failed direct roster reads now invalidate admission evidence; regression mutation fails with 2 vs 3 required roster calls.
  2. Unrelated successful roster reads no longer establish or extend mutation admission evidence; the lease is now finite from the last admission probe or completed mutation. Regression mutation again demonstrates the skipped third probe.
  3. Half-open mutations now perform the circuit recovery roster probe. Restoring the old pre-probe assertion makes the regression reject with FleetControlPlaneCircuitOpenError.
  4. Corrected the stale commands.invoke comment to agents.release and strengthened the fake-SDK contract to record the public surface directly. Routing back through commands.invoke makes the regression observe no agent release.

Final focused suites: 112 passed; git diff --check passes. Clean-runner exact-head CI is pending.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head fe4591d13db5c02af2536e8d2b832c98e3595a14.

@cubic-dev-aicubic-dev-aiBot 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.

1 issue found across 4 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/fleet/control-plane-circuit.ts">
<violation number="1" location="src/fleet/control-plane-circuit.ts:221">
P2: When `resetTimeoutMs` is shorter than `rosterTimeoutMs`, a half-open mutation can join the stale pre-open probe instead of starting recovery. That probe rejects after the generation changes, so the mutation fails and no recovery roster probe runs. Make `probe()` ignore an in-flight request from an older open generation when starting half-open recovery.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

// half-open must run the recovery probe even if older evidence exists.
const admissionState = circuit.status().state
if (admissionState === 'open') circuit.assertMutationAllowed()
if (admissionState === 'half-open' || !hasFreshAdmissionEvidence()) await probeRoster(true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: When resetTimeoutMs is shorter than rosterTimeoutMs, a half-open mutation can join the stale pre-open probe instead of starting recovery. That probe rejects after the generation changes, so the mutation fails and no recovery roster probe runs. Make probe() ignore an in-flight request from an older open generation when starting half-open recovery.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/fleet/control-plane-circuit.ts, line 221:
<comment>When `resetTimeoutMs` is shorter than `rosterTimeoutMs`, a half-open mutation can join the stale pre-open probe instead of starting recovery. That probe rejects after the generation changes, so the mutation fails and no recovery roster probe runs. Make `probe()` ignore an in-flight request from an older open generation when starting half-open recovery.</comment>
<file context>
@@ -204,9 +214,11 @@ export function guardFleetControlPlane(
+ // half-open must run the recovery probe even if older evidence exists.
+ const admissionState = circuit.status().state
+ if (admissionState === 'open') circuit.assertMutationAllowed()
+ if (admissionState === 'half-open' || !hasFreshAdmissionEvidence()) await probeRoster(true)
circuit.assertMutationAllowed()
try {
</file context>

Session-Id: 01a06e0f-f7a1-7902-b058-9129b9679596
@kjgbot

Copy link
Copy Markdown
ContributorAuthor

Addressed Cubic’s follow-up P2 on head a16551a. FleetControlPlaneCircuit now tags an in-flight probe with its open generation; a half-open caller only joins a probe from the current generation and starts a fresh recovery probe when the existing request predates the open transition. Added a short-cooldown/long-roster regression. Restoring the unconditional in-flight join fails with one roster call instead of the required two; final focused suites pass 113/113 and diff check passes.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head a16551a98dfd3553815e711e5c73e0414ef24806.

@cubic-dev-aicubic-dev-aiBot 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.

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment threadsrc/fleet/control-plane-circuit.ts
Session-Id: 01a06e0f-f7a1-7902-b058-9129b9679596
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

Requested for exact head cf0698409b4c411175855b72cda6e390f3419b3c.

@kjgbot

Copy link
Copy Markdown
ContributorAuthor

Addressed Cubic’s latest P2 on exact head cf06984. A probe now checks its captured open generation before recording a rejection, so a stale pre-open failure cannot reopen a circuit after the fresh half-open probe recovered it. Added a regression that opens while the old request is pending, recovers, then rejects the old request and proves the circuit remains closed. The regression failed on the prior code because the stale rejection reopened the circuit; corrected focused suites pass 187/187 and diff check passes.

@kjgbot
kjgbot merged commit 24f63e9 into mainSep 4, 2026
8 checks passed
@kjgbot
kjgbot deleted the lane/garden-ship-0904 branch September 4, 2026 23:01
Sign up for freeto 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

@kjgbot