Skip to content

fix: preserve safe pristine gateway startup#106282

Merged
steipete merged 1 commit into
mainfrom
codex/gateway-pristine-followups
Jul 13, 2026
Merged

fix: preserve safe pristine gateway startup#106282
steipete merged 1 commit into
mainfrom
codex/gateway-pristine-followups

Conversation

@steipete

@steipete steipete commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Related: #106194
Follow-up to #106195 and its two late review threads:

AI-assisted: yes.

What Problem This Solves

Fixes an issue where pristine Gateway startup could skip required core migration discovery when config used a nested include, while full-CLI Gateway invocations such as openclaw --log-level debug gateway run missed the intended pristine-startup speedup.

Why This Change Was Made

Nested include directives now conservatively keep the full migration path. The full Commander pre-action path also forwards the same pre-bootstrap pristine-state facts already used by the dedicated Gateway fast path.

User Impact

Gateway startup remains migration-safe for included config and avoids redundant migration discovery on pristine full-CLI launches.

Evidence

  • Blacksmith Testbox through Crabbox: tbx_01kxdq278e3xx9j17h85t4cvbm (run)
  • pnpm test src/commands/doctor/shared/pristine-startup-state.test.ts src/cli/program/preaction.test.ts src/cli/command-execution-startup.test.ts src/cli/command-bootstrap.test.ts — 47 tests passed
  • pnpm check:changed — passed on ffee18c0445af63a6b848cf1a572801387797dc9
  • pnpm deadcode:dependencies, pnpm deadcode:unused-files, pnpm deadcode:exports — passed; 25 unused-file and 3,234 unused-export baseline entries matched
  • pnpm check:test-types, pnpm tsgo:scripts, pnpm tsgo:test:root — passed
  • .agents/skills/autoreview/scripts/autoreview --mode commit --commit HEAD --no-web-search — clean, no actionable findings (0.98 confidence)

No changelog entry: internal startup optimization and regression coverage follow-up.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: XS maintainer Maintainer-authored PR labels Jul 13, 2026
@steipete
steipete force-pushed the codex/gateway-pristine-followups branch from ce21d55 to b2cb61f Compare July 13, 2026 11:06
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 13, 2026
@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 13, 2026, 7:42 AM ET / 11:42 UTC.

Summary
Recursively treats nested $include configuration as migration-sensitive and forwards two prepared pristine-state facts through the Commander Gateway pre-action path, with focused regression tests.

PR surface: Source +10, Tests +14. Total +24 across 4 files.

Reproducibility: no. live current-main reproduction is documented, but the two affected branches are high-confidence source-reproducible through the focused planner and pre-action tests.

Review metrics: 2 noteworthy metrics.

  • Prepared migration facts: 2 existing facts forwarded. Both all-state and core-state migration decisions now cross the Commander pre-action boundary, making upgrade-safety proof important.
  • Include safety guard: 1 check broadened to recursive. Nested includes now conservatively disable pristine migration skipping instead of only top-level includes doing so.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/pristine-startup-state.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #106194
Summary: The closed issue describes the canonical pristine-startup problem; the merged implementation addressed its central path, and this PR is the candidate follow-up for two uncovered safety and invocation paths.

Members:

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

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal or runtime-log proof for openclaw --log-level debug gateway run against pristine state.
  • Show a nested-include launch retaining full migration discovery, then refresh review on the rebased exact head.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides focused Testbox tests and checks but no observed after-fix Gateway run; add redacted terminal output or logs for both affected modes, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The full Commander path now influences whether migration discovery is skipped, so an incorrect prepared-state fact could affect existing configuration or upgrade behavior despite focused unit coverage.
  • [P1] No observed runtime evidence yet demonstrates both required outcomes: pristine full-CLI startup taking the optimization and nested-include startup retaining full migration discovery.
  • [P1] The branch is behind current main and three checks are failing in the supplied snapshot, so exact-head integration status still needs refresh even though most checks passed.

Maintainer options:

  1. Require dual-path runtime proof (recommended)
    Rebase the PR and provide redacted terminal or log evidence that pristine full-CLI startup skips redundant discovery while nested includes still run full migration discovery.
  2. Accept focused-test evidence
    A maintainer may explicitly override the real-behavior proof gate and accept the focused tests as sufficient for this internal startup path.

Next step before merge

  • [P1] No automated code repair is identified; hold merge for contributor-provided live startup proof and an exact-head review refresh after the branch catches up.

Security
Cleared: The focused TypeScript and test changes add no dependency, workflow, secret, permission, artifact-download, or supply-chain surface.

Review details

Best possible solution:

Keep the narrow shared-planner and prepared-fact approach, but land it only after redacted terminal or runtime-log proof shows the full-CLI pristine fast path and the nested-include migration-safe path on the exact rebased head.

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

No live current-main reproduction is documented, but the two affected branches are high-confidence source-reproducible through the focused planner and pre-action tests.

Is this the best way to solve the issue?

Yes—the patch reuses the existing bootstrap facts and central migration planner rather than adding a new cache, fallback, or configuration surface; runtime proof remains the missing merge gate.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d262cad41fb1.

Label changes

Label justifications:

  • P2: This is a bounded startup correctness and performance follow-up with limited blast radius rather than an urgent user-facing outage.
  • merge-risk: 🚨 compatibility: The patch changes when existing configurations can bypass migration discovery during Gateway startup.
  • merge-risk: 🚨 session-state: An incorrect pristine-state decision could skip migration work associated with persisted startup or agent state.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides focused Testbox tests and checks but no observed after-fix Gateway run; add redacted terminal output or logs for both affected modes, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +10, Tests +14. Total +24 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 13 3 +10
Tests 2 14 0 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 27 3 +24

What I checked:

Likely related people:

  • steipete: Authored the merged pristine-startup implementation and its current migration-safety follow-up, providing the clearest feature-history connection to these paths. (role: introduced behavior and recent area contributor; confidence: high; commits: 843e3c787806, 46d60dd4ca72; files: src/cli/program/preaction.ts, src/commands/doctor/shared/pristine-startup-state.ts, src/commands/doctor/shared/pristine-startup-state.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-13T11:11:57.991Z sha b2cb61f :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-13T11:29:19.960Z sha 46d60dd :: needs real behavior proof before merge. :: none

@steipete
steipete force-pushed the codex/gateway-pristine-followups branch 2 times, most recently from 46d60dd to 943f547 Compare July 13, 2026 11:47
@steipete
steipete force-pushed the codex/gateway-pristine-followups branch from 943f547 to ffee18c Compare July 13, 2026 12:41
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready at ffee18c0445af63a6b848cf1a572801387797dc9.

Known proof gaps: none.

@steipete
steipete merged commit 0d1573e into main Jul 13, 2026
109 of 111 checks passed
@steipete
steipete deleted the codex/gateway-pristine-followups branch July 13, 2026 12:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

wm0018 pushed a commit to wm0018/openclaw that referenced this pull request Jul 14, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant