Repository navigation
refactor(core): consolidate runtime discriminant facts - #176012
Conversation
|
🦞👀 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. What this changesThis PR consolidates execution phases, diagnostic policies, error descriptions, worker terminal checks, and Gateway profile requirements into their existing owners. Example: An HTTP request exceeds its configured body limit.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR removes duplicate runtime mappings through existing owners without an identified correctness regression; the earlier conflict and draft blockers are resolved. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherInternal runtime owners classify execution phases, diagnostics, errors, connection states, and Gateway methods; their consumers use those facts for status, delivery, recovery, and request admission. flowchart TD
A[Runtime events and requests] --> B[Existing owner descriptors]
B --> C[Agent startup status]
B --> D[Diagnostic delivery]
B --> E[HTTP and secret errors]
B --> F[Gateway profile admission]
G[Worker connection owner] --> H[Worker RPC clients]
Technical reviewBest possible solution: Retain the consolidation in the existing owners and let the current head complete its required CI gates. Do we have a high-confidence way to reproduce the issue? This refactor does not claim a reproducible user bug; source inspection verifies the moved mappings without executing target code. Is this the best way to solve the issue? The change follows the smallest complete consolidation: existing owners hold each fact, callers migrate together, and replaced mappings disappear without new runtime machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ed2de46114ea. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -97, Tests +1. Total -96 across 15 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 17, 2026, 11:21 PM ET / October 18, 2026, 03:21 UTC (Revision 2). |
77ccfaf to
8ad7cd8
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Merged via squash.
|
What Problem This Solves
Core runtime discriminants have independent inventories for labels, startup phases, diagnostic delivery policy, HTTP errors, secret-resolution explanations, worker terminal states, and Gateway profile dependency. The duplicate mappings can drift even though each responsibility already has an owner.
What Changed
Execution phases declare their label and startup bucket together. Diagnostic event rows own priority and public-exclusion facts. HTTP and secret error descriptors replace parallel mappings. Worker RPC clients use the connection owner's existing terminal predicate. The existing Gateway method descriptors now carry the 26 exact profile-dependent method flags; session-target and prefix policies remain distinct and unchanged. The narrower family helper is renamed, with its only caller migrated and its old export removed.
This is the core-runtime area of a wider mapping-owner cut, split by area to keep attribution bounded. No new registry, state store, SDK surface, wire shape, permission, or dependency is introduced. Supported behavior and user-visible text remain unchanged. Security/effect checks, lifecycle settlement, and ordinary crash/restart durability are retained.
Best-effort tradeoffs accepted
Evidence
The isolated actual-module Gateway probe compares against pinned main 33b5bee: all 545 registered descriptors match across every field, all 26 moved flags retain authenticated-profile admission, and 52 custom/unknown/prototype/prefix controls retain classification and rejection behavior. The real registry consumes the resulting descriptors with unchanged scope/profile outcomes. This is descriptor/registry boundary proof, not live authorization or provider proof.
Existing source-parity evidence also covers all 14 phase labels/startup buckets, diagnostic membership and 1,008 listener decisions, HTTP error messages/statuses/text, secret error explanations and recovery, and worker terminal/client scenarios. All 184 focused tests passed across eleven suites/five serial shards with one worker and isolated HOME/OpenClaw/XDG state. Removing the proposal's redundant always-true async filter is covered by a subsequent 31-test diagnostics replay. The first scoped lint caught the method table exceeding its 700-line limit; reusing one startup/profile policy for three methods resolves it without a suppression or allowance change. The actual-module 545-descriptor comparison and 12 Gateway tests pass again after that simplification. Final touched-graph types, scoped lint/format, cycle checks, and independent review pass.
Final format checks, official scoped syntax lint, and touched-production-graph typecheck pass. Both official cycle checks report zero cycles. The final isolated lint-suppressions suite passes all14tests (143.54s including a65.02s Git inventory case; wrapper199.21s). Independent complete-candidate review is scoped-clean with no accepted/actionable P0-P2 findings (correctness confidence0.96). Broad tests/builds remain exact-head hosted CI gates; no full local suite or build was run.
Production delta: 160 added, 257 removed, 97 net lines removed across 14 production files. One existing worker-client fixture is migrated to the real owner predicate; its assertions are unchanged.
Conflict repair
GitHub reported CONFLICTING at reviewed head 77ccfaf80b16eff8bca18c8b23221a20909dfec7. The branch is rebased onto main 7c0b2ae as signed head 8ad7cd8. The only conflict was the execution module's import block: preserve main's direct failover/classify import and add the phase-owner import. All other 14 changed-file blobs are identical to the independently reviewed candidate. Dependency inputs are unchanged.
Post-conflict formatting and official scoped syntax lint pass. The complete touched-production graph typecheck passes; runtime and static cycle checks both report zero. The fresh isolated suppression suite passes all 14 tests (133.44s, wrapper181.18s). Two execution suites were also attempted, but stopped after 13.5 minutes of cold preparation with no completed test cases; their worker cleanup fully drained and the invocation exited143. That runtime attempt is incomplete evidence, not a passing test or product failure. The original 184 focused tests and subsequent 31 diagnostics/12 Gateway replays remain valid prior-head evidence; exact repaired-head hosted CI is the broad gate.
Exact repaired-head hosted CI 39093004530 completed successfully at
8ad7cd8658d06fef9eef75caf7506d26ffa3c01e. Complete exact-head check-run enumeration confirms successfulopenclaw/ci-gate, production/test types, lint, selected runtime/UI suites, andsecurity-fast. No CI reruns or inherited-failure exception were needed.