Skip to content

fix(gateway): stop TLS renewal through the shutdown owner - #146473

Closed
steipete wants to merge 1 commit into
mainfrom
codex/fix-tls-sidecar-shutdown
Closed

steipete wants to merge 1 commit into
mainfrom
codex/fix-tls-sidecar-shutdown

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #130741

What Problem This Solves

TLS-enabled Gateway startup registers an array as a shutdown sidecar, so cleanup cannot call the renewal monitor's stop method.

User Impact

The TLS renewal monitor participates in normal Gateway shutdown without an invalid-sidecar error.

Why This Change Was Made

Pass the renewal handle directly to the existing variadic sidecar owner. Renewal scheduling and shutdown ownership remain unchanged.

Evidence

The original call produces TS2741 on the unchanged main source. The corrected call passes the core typecheck and all 140 focused TLS, sidecar-retention, startup, and shutdown tests. The full canonical changed gate and an isolated P1 review also pass.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 12, 2026, 5:26 PM ET / 21:26 UTC.

ClawSweeper review

What this changes

Pass the TLS certificate renewal monitor directly to the Gateway shutdown owner so its watchers and pending work are stopped correctly.

Merge readiness

⛔ Blocked before merge - 2 items remain

The patch is correct, but the identical fix already reached main through #146412. The protected maintainer PR requires human disposition rather than automated closure.

Priority: P2
Reviewed head: 85bd9b9b7aea1cf4532c5d63a7c6cb7735396bf5
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, correct repair with no actionable findings; redundancy affects disposition rather than patch quality.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its reported checks are supplemental, while the identical merged fix separately records real TLS startup, shutdown, and updater observations.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its reported checks are supplemental, while the identical merged fix separately records real TLS startup, shutdown, and updater observations.
Evidence reviewed 8 items Verified introduced change: The pinned merge-base-to-head diff contains only the correction from an array argument to the renewal handle itself.
Shutdown contract: The sidecar owner accepts variadic handles and invokes each handle's stop method. The TLS monitor's stop method invalidates pending publication, clears its timer, unregisters file watchers, and joins pending work.
Current main already contains the correction: Fetched main registers tlsRenewal directly at line 416.
Findings None None.
Security None None.

How this fits together

The Gateway monitors its configured TLS certificate files and refreshes running HTTPS listeners. Its lifetime owner stops background services during shutdown, including the certificate renewal monitor.

flowchart TD
  A[Configured certificate files] --> B[TLS renewal monitor]
  B --> C[HTTPS listeners]
  B --> D[Register shutdown handle]
  E[Gateway shutdown] --> F[Lifetime owner]
  D --> F
  F --> G[Stop watchers and join pending work]
Loading

Decision needed

Question Recommendation
May this protected PR be closed as superseded by the identical merged fix at #146412? Close the redundant branch: Preserve the merged implementation and link the canonical fixing PR.

Why: The technical work is complete on main, but the maintainer protection requires explicit human disposition.

Before merge

Agent review details

Security

None.

PR surface

Source 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 1 0

Review metrics

None.

Root-cause cluster

Relationship: superseded
Canonical: #146412
Summary: The canonical merged PR fixes the identical registration defect; the linked Swarm work addresses separate behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Retain the merged shutdown-owner correction and consolidate this redundant branch with its canonical merged PR.

Do we have a high-confidence way to reproduce the issue?

No current-main failure was reproduced: source confirms the original argument mismatch, but fetched main already contains the correction.

Is this the best way to solve the issue?

Yes. Passing the existing handle directly restores the owner's established contract without adding another cleanup path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9b59fe4ef7da; fix evidence: commit b405e7f64410, main fix timestamp 2026-09-12T14:12:52-07:00.

Labels

Label changes:

  • add P2: This is a bounded TLS shutdown cleanup correction, already present on main.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its reported checks are supplemental, while the identical merged fix separately records real TLS startup, shutdown, and updater observations.

Label justifications:

  • P2: This is a bounded TLS shutdown cleanup correction, already present on main.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate; its reported checks are supplemental, while the identical merged fix separately records real TLS startup, shutdown, and updater observations.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e2c3eaa adds src/gateway/server-tls-renewal.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e2c3eaadfc75; files: src/gateway/server-tls-renewal.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

The identical one-line fix is already on main through #146412 (b405e7f644106306d2d3965ecf22335fdbe15716). I verified the current main source passes the TLS renewal handle directly to the variadic sidecar owner. Closing this duplicate; the dependent Swarm PRs already have their prerequisite on main.

@steipete steipete closed this Sep 12, 2026
@RomneyDa
RomneyDa deleted the codex/fix-tls-sidecar-shutdown branch October 22, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant