Repository navigation
refactor: share active run state precedence - #157168
Conversation
Use the projection owner to merge running, queued and capacity-wait states for both index construction and session resolution. This removes duplicate precedence rules and brings the registry below the unchanged line limit while preserving lifecycle, authority and version handling.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 6:00 AM ET / 10:00 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch gives active run indexing and session progress resolution one shared priority rule: running, then queued, then waiting for capacity. Merge readiness✅ Ready for maintainer review Keep open: current main still exceeds the registry’s lint limit. The reviewed head passes CI, and the source review found no actionable defect. Priority: P3 Review scores
Verification
How this fits togetherThe process-local agent run registry tracks live work and builds session status indexes. Gateway session and task views use those indexes to report whether work is running, queued, or waiting for capacity. flowchart LR
A[Live run contexts] --> B[Shared status priority]
B --> C[Projection index]
C --> D[Session status lookup]
B --> D
D --> E[Gateway and task views]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7. Total +7 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one projection-owned status priority rule while preserving existing run lifecycle and index invalidation behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current main retains the oversized registry and the 700-counted-line lint rule; the PR reports 704 counted lines before the change. This read-only review did not execute lint. Is this the best way to solve the issue? Yes. Sharing the existing projection owner’s priority rule is a narrow repair, and the three states retain their previous ordering. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20590155d1bf. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Use the projection owner to merge running, queued and capacity-wait states for both index construction and session resolution. This removes duplicate precedence rules and brings the registry below the unchanged line limit while preserving lifecycle, authority and version handling.
What Problem This Solves
The agent run registry exceeds the existing lint size limit, blocking repository checks.
User Impact
No user-visible behavior change. Running work still takes precedence over queued work, which takes precedence over capacity waits.
Why This Change Was Made
The projection builder and registry resolver separately implemented the same precedence rule. Both now use the existing projection owner’s shared merge operation. This brings the registry from 704 to 699 counted lines without changing its 700-line limit, lifecycle ownership, or version tracking.
Evidence
The exact failing lint check passes after the change. All 108 existing tests across seven affected files, core types, and fresh independent P0–P2 review pass. No new tests, dependencies, suppressions, or budget changes.
Exact-head CI passed at
34e5fc19a6fc51d9fd491fc4e81af39a07d31358. ClawSweeper completed that revision with no findings, and final native preparation withOPENCLAW_TESTBOX=1passed.Related: #157161.