Repository navigation
fix(ci): repair Gateway lint and Doctor mock cleanup - #158074
Conversation
Move private-reference representation helpers without changing companion execution or lifecycle behavior. Use native immediate promises for the two metadata fixture event-loop barriers.
Observe native IPC request roles so the snapshot reader and staging custodian retain separate lifecycle assertions. Preserve the startup migration checkpoint and restore the spawn mock on rejection. Co-authored-by: Peter Steinberger <[email protected]>
|
🦞👀 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. |
Integrate the frozen native main checkpoint. Retain the landed child-role assertions and current production behavior; keep the tested explicit spawn-mock restoration on rejection.
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 6:48 AM ET / 10:48 UTC. ClawSweeper reviewWhat this changesThe branch moves Side chat prompt formatting into a private Gateway module, replaces two test event-loop barriers with Node’s promise API, and restores the Doctor fixture’s child-process observer on every exit. Merge readiness✅ Ready for maintainer review Keep open: this is the active, bounded repair for the Gateway lint failures. The alternative PR was closed unmerged in favor of this branch, and the pinned diff has no concrete correctness finding. Priority: P3 Review scores
Verification
How this fits togetherControl UI Side chat sends a question to the Gateway, which combines selected-session context and observer notes into a prompt for a utility model and returns a bounded answer. Separately, the Doctor preflight test observes child processes used for SQLite reads. flowchart LR
A[Control UI question] --> B[Gateway Side chat RPC]
B --> C[Session context and notes]
C --> D[Private prompt formatter]
D --> E[Utility model]
E --> F[Side chat answer]
G[Doctor preflight test] --> H[SQLite child observation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +11, Tests -8. Total +3 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one private prompt formatter behind the Gateway companion runtime, preserve Side chat’s existing answer semantics, and make the Doctor fixture restore its real child launcher on every exit. Do we have a high-confidence way to reproduce the issue? Yes for the lint failures: current main retains the affected owner bodies under the existing line-limit rules, and the related PR records the exact violations. The Doctor rejection cleanup was not independently executed in this read-only review. Is this the best way to solve the issue? Yes. The private extraction preserves the formatter bodies and call points, while explicit finally cleanup addresses the fixture lifetime without weakening its child assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c46b51b87d8d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refactor(gateway): separate companion prompt formatting Move private-reference representation helpers without changing companion execution or lifecycle behavior. Use native immediate promises for the two metadata fixture event-loop barriers. * test(doctor): distinguish read-only snapshot child roles Observe native IPC request roles so the snapshot reader and staging custodian retain separate lifecycle assertions. Preserve the startup migration checkpoint and restore the spawn mock on rejection. Co-authored-by: Peter Steinberger <[email protected]> * merge: preserve landed Doctor coverage in CI repair Integrate the frozen native main checkpoint. Retain the landed child-role assertions and current production behavior; keep the tested explicit spawn-mock restoration on rejection. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes two Gateway lint-cap failures and ensures the Doctor pending-read fixture restores its child-process observer even when preflight rejects.
User Impact
No user-visible behavior, configuration, schema, or startup API changes. This restores the affected CI gates and prevents a failed fixture from leaving its spawn observer installed for later cases.
Why This Change Was Made
Companion prompt representation now has a small, separate owner; its formatting and sanitization bodies are unchanged. The metadata lifecycle fixture uses Node's native immediate promise for its two existing event-loop barriers.
The Doctor fixture now installs its observer explicitly and restores the captured implementation in
finally, before asynchronous database cleanup. This avoids the fulfillment-only restoration of Vitest'swithImplementationand removes the intermediate boxed result.The child-role assertions landed concurrently through #145043. They are preserved in full: one reusable reader, balanced staging custodians, every child joined, and the startup migration checkpoint. The original observation slice came from Peter Steinberger's work in #151025; co-author credit is retained. No broader startup changes from that PR are included.
Related: #157940.
Evidence
The build emitted its existing UI size advisory while passing the hard limit; this change makes no UI runtime or performance claim.