Metadata
| Status | done |
|---|---|
| Assigned | agent-889 |
| Agent identity | fbb2d89fe44d6b761bcb4b67748ab3d417f29df70a65f8d9403308f5bb2bab78 |
| Created | 2026-07-26T10:15:00.296832886+00:00 |
| Started | 2026-07-26T14:27:02.131802956+00:00 |
| Completed | 2026-07-26T15:03:47.285470153+00:00 |
| Tokens | 16429593 in / 22595 out |
Description
Bug
A source task attempted to spawn while dispatcher.resource_management.max_build_agents=1 was occupied. The coordinator recorded build-heavy admission budget full (1/1) as five consecutive spawn failures within seconds, tripped the task circuit breaker, and marked the untouched task incomplete for evaluator review. Resource admission is expected backpressure, not an execution failure.
Scope and ordering
Implement against the authoritative lifecycle transition API after implement-authoritative-lifecycle; do not add a second status writer or a parallel coordinator state path. This task owns the admission-deferral classification and its status/metrics behavior before lazy evaluation changes consume candidate-completion events.
Fix
- Classify build-heavy slot exhaustion and analogous transient admission-budget limits as admission deferrals, never spawn failures.
- Leave the task open/ready with no retry-count, failure-charge, evaluator transition, provider-health charge, or circuit-breaker increment.
- Retry on a bounded/backoff tick after capacity frees; coalesce/rate-limit logs.
- Preserve genuine spawn failures (invalid route, process launch error, missing binary, worktree error) and their breaker behavior.
- Surface deferred reason/count separately in service status/metrics.
Validation
-
Failing regression is written first:
admission_deferral_never_becomes_spawn_failure_or_pending_evaloccupies one build slot and proves a second build-heavy task stays open/deferred across more than five ticks; it fails before the fix. - Implementation makes the RED test pass, and when the slot frees the deferred task spawns exactly once without operator retry.
- Never-attempted/deferred sources create no evaluator/FLIP record or satellite.
- Provider circuit health is unchanged by resource backpressure; genuine launch failures still trip the breaker at the configured threshold.
- A credential-free scripted terminal/daemon human flow displays the deferred reason, releases capacity, and observes the task run once; it does not call the transition helper directly.
-
The permanent live scenario is added under
tests/smoke/scenarios/and registered with this task intests/smoke/manifest.tomlowners. -
cargo fmt --check,cargo clippy, focused tests,cargo build, andcargo testpass with no regressions.
Depends on
Required by
Log
- 2026-07-26T10:15:00.283420785+00:00 Task paused
- 2026-07-26T10:20:18.276252444+00:00 Task published
- 2026-07-26T14:27:02.223770029+00:00 Spawned by coordinator --executor pi --model openai-codex:gpt-5.6-sol --isolation required-worktree
- 2026-07-26T14:27:22.079432802+00:00 Starting RED-first investigation of coordinator admission, spawn breaker, lifecycle transitions, and service metrics; implementing inline because the code path and validation are tightly coupled.
- 2026-07-26T14:36:37.259809088+00:00 RED confirmed: admission_deferral_never_becomes_spawn_failure_or_pending_eval fails with live heavy slot occupied because coordinator reports 0 deferrals (snapshot-derived count misses live registry), matching the race that falls through to spawn failure.
- 2026-07-26T14:57:17.333889997+00:00 Implementation complete: typed admission refusals at final spawn gates, live-registry build occupancy, authoritative AdmissionDeferred evidence, per-tick status count/reason, coalesced logs, and credential-free live daemon smoke. RED regression and focused breaker/provider-neutral tests are green; live smoke passes.
- 2026-07-26T15:03:05.331758386+00:00 Validated: cargo fmt --check PASS; cargo clippy PASS (repository warnings only); cargo build --locked PASS; focused admission-deferral + genuine spawn-breaker tests PASS; installed-binary admission_deferral_backpressure and predictive_build_admission_opt_in smokes PASS. Full cargo test: 3004 passed, 38 ignored; 4 pre-existing unrelated route/profile tests fail (dispatch agency external executor and named-profile role override tests), matching dependency-reported branch drift; no admission/lifecycle/provider/smoke regressions.
- 2026-07-26T15:03:34.173505273+00:00 Committed: d4dac15e — pushed to remote
- 2026-07-26T15:03:47.285470453+00:00 Task marked as done