Repository navigation
fix: honor the gateway probe overall timeout - #127197
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 shares one deadline across Gateway discovery, SSH setup, and probes while checking known targets concurrently. Example: On macOS, run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a source-verifiable timeout defect still present on main, and the current diff resolves the three previous findings without a discrete introduced bug. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway probe CLI combines configured and explicit endpoints, Bonjour discovery, credential resolution, optional SSH forwarding, and read-only Gateway probes into diagnostic text or JSON. flowchart TD
A[Gateway probe CLI] --> B[Shared deadline and cancellation]
B --> C[Known target probes]
B --> D[Bonjour discovery]
B --> E[SSH setup and tunnel probe]
D --> E
C --> F[Diagnostic results]
E --> F
Technical reviewBest possible solution: Keep the command as the deadline owner and use existing cancellation and cleanup contracts throughout discovery, SSH setup, and probing. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the sequential DNS-SD timeout multiplier and fresh later probe budgets; this read-only review ran no reproduction. Is this the best way to solve the issue? The patch uses the existing command, discovery, process, tunnel, and probe owners, preserves standalone discovery semantics, and introduces no unnecessary manager or parallel implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0f9411abebbd. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +75, Tests +96, Docs +5. Total +176 across 7 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 (8 earlier review cycles)
Reviewed October 21, 2026, 5:36 AM ET / 09:36 UTC (Revision 9). |
09e88f7 to
e4ed40b
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Integrate current main while retaining its inlined discovery and SSH resolution owners. Keep the shared probe budget and finish same-port loopback probes before binding an SSH tunnel. Add deterministic regression coverage for that ordering.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
* fix: share the gateway probe timeout across discovery and connections * test: type gateway probe mocks against the production contract
Closes #127166
What Problem This Solves
Fixes
gateway probe --timeoutexceeding its advertised overall budget when discovery is slow or finds many Gateways.User Impact
Known local and explicit Gateways are checked while discovery runs. Discovery, SSH configuration and tunnel setup, connections, and read checks share one deadline, and unfinished checks report a timeout. Existing options and standalone discovery behavior are preserved; no migration is needed. Connection and process cleanup can briefly extend elapsed command time.
Why This Change Was Made
On the integrated main base (
431f80cf7ac4),src/commands/gateway-status.ts:135resolves SSH configuration before cancellation exists,:232waits for discovery before probing known targets, and:308gives probes a fresh budget.src/infra/bonjour-discovery.ts:264also restarts the timeout for each DNS-SD resolution.The command owns one monotonic deadline and cancellation signal. Its existing discovery, SSH, and probe owners consume the remaining budget. Direct checks on the tunnel's preferred loopback port finish before the tunnel can bind it, preserving credential routing. Main's consolidation in
32e8d817f7d1is retained: SSH resolution and auto-discovery remain in the command, and the deletedgateway-status/discovery.tsis not restored. No additional timeout manager, fallback, or public option is introduced.Against the integrated main base: production +229/-153 (net +76), tests +136/-6 (net +130), documentation +5/-0. The added production code supports concurrent checks and cancellation through the existing owners.
Evidence
Three regressions fail against main's production code and pass with the fix: DNS-SD resolves a third beacon after the deadline; known healthy targets remain unprobed during slow discovery; and the SSH tunnel starts before same-port direct checks finish. The tunnel regression uses controlled promises.
All 42 tests pass across
gateway-status.test.ts,bonjour-discovery.test.ts, andssh-config.test.tsvia the repository runner with one worker. The full focused wrapper took 67.53 seconds, including compiler preparation (infra shard 46.84 seconds; command shard 8.23 seconds). Scoped type-aware lint, formatting, and diff checks pass. Independent Codex review reports scoped-clean with no actionable P0-P2 findings.No live network or SSH endpoint was used, per this repair lane's focused-proof scope. Owner-level regressions exercise deadline and ordering behavior; exact-head PR CI supplies broad validation. Exact-head CI run 39639655335 passed on
3d84106ff8d9f5909fb573dfa8295a8583ca46ac: 33 jobs passed, with no failing or pending jobs; the repository watcher returnedGREEN. Runner queueing caused most of the delay; no CI rerun or follow-up fix was needed. Superseded review-orchestration checks remain visible in GitHub's aggregate rollup and are excluded by the repository watcher.ClawSweeper re-review was requested once on this head and observed through the 25-minute window. Its automatic attempts did not publish a current-head review; run 39644119762 subsequently reported that no publishable artifact was produced. The visible review still covers the previous head. This is a review-infrastructure gap, not a claim of a clean current-head ClawSweeper review; the independent review above is complete.