Skip to content

GH-5163 Unplaced agents carry an UnplacedReason; leader logs agents awaiting capacity - #5176

Merged
jeremydmiller merged 1 commit into
mainfrom
gh-5163-unplaced-reason
Oct 23, 2026
Merged

jeremydmiller merged 1 commit into
mainfrom
gh-5163-unplaced-reason

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

What changed

  • New UnplacedReason enum (AwaitingCapacity, NoCapableNode, Paused, TakeoverHold) and AssignmentGrid.Agent.UnplacedReason (nullable). The getter returns null whenever the agent has an AssignedNode, and Node.Assign clears it, so a reason never outlives a placement.
  • Where it is set:
  • NodeAgentController.ReportAgentsAwaitingCapacity logs one Information line per evaluation where the count of agents awaiting capacity changes, so a parked steady state is not re-logged every cycle. It includes a sample of up to 5 URIs.
  • Optional, additive: DurabilitySettings.NodeAcceptThreshold (double?, default null = NodeOverloadThreshold - 10, same as today).
  • Docs: short notes in leadership-and-troubleshooting.md on the new threshold and the reason/log.

Why

CritterWatch (JasperFx/CritterWatch#1343) can't tell an agent parked for capacity from one that never started, so its ProjectionAgentUnassigned remediation is wrong. IWolverineObserver.AssignmentsChanged(grid, ...) now sees the reason on grid.UnassignedAgents.

Tests run locally (net9.0, Release)

  • unplaced_agents_carry_a_reason_5163: 8/8 passed (grid-level reasons, clearing, log latch, SimulatedCluster end-to-end with a custom NodeAcceptThreshold, cold-start hold)
  • Whole CoreTests.Runtime.Agents namespace: 540 passed, 6 skipped, 0 failed (546 total)
  • dotnet build src/Testing/CoreTests -c Release -f net9.0: 0 warnings, 0 errors

Closes #5163

🤖 Generated with Claude Code

https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U

…waiting capacity

AssignmentGrid.Agent.UnplacedReason (AwaitingCapacity, NoCapableNode, Paused,
TakeoverHold) records why the leader left an agent without a node, cleared on
placement. The leader logs agents parked for capacity at Information, latched on
the count. New optional DurabilitySettings.NodeAcceptThreshold overrides the
hard-coded NodeOverloadThreshold - 10 accept line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
@jeremydmiller
jeremydmiller merged commit c200f3c into main Oct 23, 2026
ArieGato pushed a commit to ArieGato/wolverine that referenced this pull request Oct 25, 2026
… null-reason gaps

Follow-up to JasperFx#5163 / JasperFx#5176, per the CritterWatch comment (JasperFx/CritterWatch#1460).

- Document the UnplacedReason member names as a stable contract (CritterWatch persists them by
  name) and pin them in a test.
- Node markers (wolverine://durability-agents-enabled, wolverine://node-role/warmup) are no
  longer seeded into the leader's grid as agents; they sat there unassigned with a null reason
  on every cluster.
- New UnplacedReason.Superseded for an event subscription agent retired by a tenant-scoping
  change.
- A cluster with no serving node: DistributeEvenly and SingularAgent say NoCapableNode (was
  AwaitingCapacity and null respectively). Empty-pool early returns in the group affinity and
  blue/green passes stamp NoCapableNode defensively.
- SimulatedCluster asserts after every round that no unassigned agent lacks a reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U
This was referenced Oct 25, 2026
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.

Capacity-aware assignment: an agent parked for lack of capacity carries no reason, log or observer signal

1 participant