Skip to content

fix: clear the unused restart export from changed checks - #206805

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-restart-pending-dead-reexport-20260919
Nov 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-restart-pending-dead-reexport-20260919

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #206739

What Problem This Solves

On clean main, pnpm check:changed fails the production unused-export scan because the old restart module still forwards a predicate after its production caller moved to a lighter module.

User Impact

Developers can run the changed-file check with the production unused-export gate enabled. This is an internal cleanup with no user-visible change.

Why This Change Was Made

#206739 moved the production read to restart-pending.ts. The forwarding export in restart.ts remained for a single test file. The test now imports the predicate from the same module as the production caller, and the forwarding export is deleted. Production code is one line smaller.

Evidence

  • On clean main ebabd17b7d79, two production Knip scans each found only src/infra/restart.ts: hasPendingGatewayRestart and exited 1. The same scan on the candidate passed with zero findings. No ignore or baseline edit.
  • The SDK and package export maps expose neither the forwarding export nor the predicate, and the Control UI does not import the affected modules.
  • The restart, restart-suspension, and prepared-model refresh-scope tests passed all 44 cases in 44.03 seconds locally.
  • Unscoped pnpm check:changed passed in 383.10 seconds, including all three Knip export scans, core typechecks, lint, and format.
  • Codex autoreview found no actionable P0–P2 issues in the candidate diff against ebabd17b7d79. The signed head is 51b37def0beaefc2e0d97edf8bc95a7cd7590e03.

Related to #206739, which moved the production pending restart reader to its own module.
@clawsweeper

clawsweeper Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review November 27, 2026 16:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T16:14:00.661214Z 51b37de Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label Nov 27, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review signed head 51b37def0beaefc2e0d97edf8bc95a7cd7590e03. The automatic dispatch reported cross-route deduplication and I found no completed review or active review run for this PR.

@clawsweeper

clawsweeper Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 27, 2026
@clawsweeper

clawsweeper Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR removes an unused restart predicate re-export and imports the predicate directly in the existing test.

Example: A developer runs pnpm check:changed with production unused-export checks enabled.

  • Before: The PR reports that hasPendingGatewayRestart in src/infra/restart.ts causes the production Knip scan to exit 1.
  • After: The obsolete export is removed, and the PR reports that the scan and changed-file checks pass.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, source-verified cleanup with reported focused validation; current-head CI remains in progress.
Proof confidence 🐚 platinum hermit (4/6) This internal export cleanup changes no user-visible runtime behavior; supplied validation covers unused-export checks and retained restart tests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Maintenance · Worth it: Yes · Fix scope: Complete
User problem: Developers encounter a production unused-export failure during changed-file checks.
Reason: The maintainer-authored cleanup restores the existing check contract without exemptions, new machinery, or runtime changes.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it completes the restart-reader cutover with a minimal cleanup, and no actionable correctness or security defects were found.

Reviewed head: 51b37def0beaefc2e0d97edf8bc95a7cd7590e03

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway restart controller updates shared in-memory restart handles, while model recovery and restart tests read their pending-state predicate from restart-pending.ts.

flowchart TD
  A[Gateway restart requests] --> B[Restart controller]
  B --> C[Shared restart handles]
  D[Pending restart predicate] --> C
  E[Model recovery] --> D
  F[Restart tests] --> D
Loading

Technical review

Best possible solution:

Remove the unused internal forwarding export while retaining the shared predicate and existing recovery assertions.

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

Source confirms the production-unused forwarding export on current main, and the PR records failing base scans followed by passing candidate scans; this read-only review ran no target code.

Is this the best way to solve the issue?

This is the smallest complete fix because it removes the redundant export and updates its sole remaining test consumer without changing restart ownership or behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c7ea9f418610.

Provenance checked

  • Restart predicate forwarding export keeps the original intent (f4e5600: Preserve the existing import while moving production recovery reads to a lightweight module; this PR migrates the remaining test consumer.)
  • Failed-emission recovery test keeps the original intent (9288184: Verify that failed custom restart emission retires live recovery and leaves work admission open.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change is a complete internal cutover: The introduced diff deletes only the forwarding export and moves the existing test import to restart-pending.ts; it changes no implementation or assertions. (src/infra/restart.ts:29, 51b37def0bea)
  • Current main still needs the cleanup: Fetched main retains the forwarding export and its test consumer; the production recovery caller already imports the lightweight module directly. (src/infra/restart.ts:29, c7ea9f418610)
  • Prior extraction explains the forwarding export: improve: keep Gateway restart controls out of local model preparation #206739 moved the predicate and shared handles to avoid loading supervisor controls during model preparation, retaining the re-export for the remaining test consumer. (src/infra/restart-pending.ts:16, f4e560013512)
  • Recovery regression coverage remains intact: The retained test schedules a custom emission that fails, verifies pending recovery before emission, and checks callback execution, cleared pending recovery, and reopened admission afterward. (src/infra/restart.test.ts:190, 51b37def0bea)
  • No remaining consumer requires the forwarding path: Repository-wide symbol references resolve to the lightweight module, its production consumer, and restart tests; the predicate is absent from the public SDK and package export surface. (src/agents/prepared-model-runtime.refresh-scope.ts:4, 51b37def0bea)
  • Validation and current GitHub state: The full PR body reports passing production Knip scans, focused tests, and check:changed; live GitHub reads confirm the requested head remains open and mergeable, with CI still running and one cancelled context check rather than a demonstrated diff-caused failure. (51b37def0bea)

Likely related people:

  • Vincent Koc: Raw commit f4e5600 adds src/infra/restart-pending.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f4e560013512; files: src/infra/restart-pending.ts)

PR surface

Source -1, Tests 0. Total -1 across 2 files. Added test files: 0.

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

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 27, 2026, 11:19 AM ET / 16:19 UTC.

@steipete
steipete merged commit 01ca7a9 into main Nov 27, 2026
198 of 199 checks passed
@steipete
steipete deleted the steipete/perf-micro-restart-pending-dead-reexport-20260919 branch November 27, 2026 16:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 28, 2026
…6805)

Related to openclaw#206739, which moved the production pending restart reader to its own module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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