Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review The branch remains at 6be1f15 and its full CI run passed. The previous review workflow failed during review generation; its diagnostics classify the failure as retryable and no completed review was published. Please retry this exact head so the native merge gate can validate the completed result. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 3:46 PM ET / 19:46 UTC. ClawSweeper reviewWhat this changesThe PR makes the real Gateway test fixture wait for its initial health snapshot and resets test environment stubs before each case. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo blocking correctness finding: the patch correctly makes fixture readiness wait for passive health initialization and re-establishes the baseline CLI environment for each case. This current maintainer-authored, maintainer-labeled PR should remain open for normal landing. Priority: P3 Review scores
Verification
How this fits togetherThe CLI state-directory guard connects to a locally running Gateway before allowing writes. Its fixture starts that Gateway and signals readiness before tests exercise matching and mismatched state-directory behavior. flowchart LR
A[CLI state guard tests] --> B[Gateway fixture process]
B --> C[Gateway startup]
C --> D[Passive health refresh]
D --> E[Readiness signal]
E --> F[Authenticated state checks]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +6. Total +6 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the focused readiness and environment-isolation repair so the real-Gateway state guard reliably covers authenticated refusal behavior. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only review. The fixture sequence is source-supported, and the PR body provides order-sensitive failure and after-fix run evidence. Is this the best way to solve the issue? Yes. Settling startup work at the fixture readiness boundary and reapplying test-owned environment state before each case targets the observed race without altering production refusal, authentication, or timeout logic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8f8e77414965. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Superseded by the merged state-directory proof rewrite in #135495 (5131048). The real-Gateway test now obtains one authenticated hello and feeds its reported paths to the comparison owner; it no longer uses the per-test environment overrides or repeatedly races the guard’s offline deadline that this PR repaired. The callback/refusal wiring has separate focused coverage, and the production guard is unchanged. I checked current main node scripts/run-vitest.mjs src/cli/state-dir-gateway-check.test.ts src/cli/state-dir-gateway-check.server.test.ts src/cli/state-dir-gateway-check.process.test.ts src/gateway/health/collector.channel-discovery.test.tsAll 13 tests passed, including the real authenticated Gateway hello, actual CLI refusal before a model-credential write, and passive health discovery. The health collector also now avoids dormant credential discovery. Closing this test-only alternative; no part of it is counted toward the performance campaign. |
What Problem This Solves
The real-Gateway state-directory suite can authenticate its first client, then time out the next handshake and incorrectly observe an allowed write. Its minimal server announces readiness before the omitted initial health refresh has completed. The suite also installs environment stubs in beforeAll even though Vitest restores them before every test.
Why This Change Was Made
The fixture now awaits the real passive health refresh before its IPC readiness signal. Existing client environment stubs move into beforeEach. Production refusal logic, authentication, timeouts and assertions are unchanged.
User Impact
This repairs test readiness and isolation so the suite consistently exercises authenticated matching paths, mismatched-path refusal and tokenless warnings. It does not change production behavior.
Evidence
The original failure reproduced in file order on a frozen copy of the failing CI head; running the mismatch case first passed. Pass-through tracing captured a correct authenticated hello followed by a 9.1-second synchronous cold plugin-presence load. That work blocked the second handshake. An environment-only repair still failed; waiting for actual health readiness passed all three cases. Independent and maintainer five-file runs each passed all 15 tests, including a real CLI refusal before credential writes. The maintainer run also passed the test type shard, typed lint and configured autoreview.
The cold plugin-presence loader cost is a separate production follow-up; this patch does not hide it or claim a runtime performance fix. The unrelated stdin TTY type error is already fixed by #135407 and is not duplicated here.
Production: 0 lines changed. Tests: +5/-3; test support: +4. No configuration, dependency, schema, protocol or production policy changes.