Repository navigation
fix: harden Crestodian maintenance flows - #105153
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a37459464
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| recoveredLoadedState = handledRecovery.loaded ?? null; | ||
| } | ||
|
|
||
| if (loaded && params.repairLoadedService) { |
There was a problem hiding this comment.
Repair unloaded services before restart recovery
When the managed service is installed but currently stopped/unloaded, this loaded gate skips the new port-drift repair entirely. In that scenario a user who changes gateway.port and then runs openclaw gateway restart (or start) can still re-bootstrap/kickstart the stale service definition on the old port: macOS takes the onNotLoaded LaunchAgent recovery path before this repair block, and the generic start path's repair collector also returns no issues unless the service is loaded. The result is the same unreachable-gateway state this change is trying to prevent whenever the stale service is not already loaded.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 4:40 AM ET / 08:40 UTC. Summary PR surface: Source +130, Tests +123. Total +253 across 16 files. Reproducibility: yes. The linked reports provide exact-main user reproductions, and current-head source ordering gives a high-confidence reproduction of the remaining installed-but-unloaded LaunchAgent failure. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Inspect installed service definitions regardless of loaded state, repair explicit port drift before bootstrap or kickstart, preserve install-time overrides when gateway.port is unset, and prove real macOS start and restart behavior; retain the request-scoped Crestodian trajectory opt-out for its ephemeral planner. Do we have a high-confidence way to reproduce the issue? Yes. The linked reports provide exact-main user reproductions, and current-head source ordering gives a high-confidence reproduction of the remaining installed-but-unloaded LaunchAgent failure. Is this the best way to solve the issue? No. The gateway fix handles loaded definitions but allows macOS recovery to launch an installed, unloaded stale definition before drift inspection; repair must occur before recovery. The Crestodian trajectory opt-out is otherwise a narrow OpenClaw-owned fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9cf4f03afe1d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +130, Tests +123. Total +253 across 16 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Land-ready proof for
Known proof gap: the pristine Golden Gate snapshot has no approved console-password locator, so the managed LaunchAgent restart branch could not be repeated inside a live |
|
Merged via squash.
|
* fix: harden Crestodian maintenance flows * fix: skip trajectories for ephemeral Crestodian plans * test: satisfy Crestodian CI gates
What Problem This Solves
Closes #105109 and #105111.
gateway.portchanged, so status targeted the new port while the service still launched on the old port.FOREIGN KEY constraint failedduring otherwise successful CLI and TUI requests.Why This Change Was Made
User Impact
gateway.portand restarting the managed gateway now repairs the LaunchAgent to the configured port instead of leaving the gateway unavailable.gateway.portis explicitly configured.Evidence
node scripts/run-vitest.mjs src/crestodian/assistant.configured.test.ts src/agents/embedded-agent-runner/run.before-agent-reply-cron.test.ts— 15 tests passed.8a37459464f: install/version, gateway RPC, Control UI, and real OpenAI agent turn passed. Artifact:.artifacts/parallels/openclaw-parallels-macos.iOJf6w.expect: returnedTUI_CONFIG_OK 18789; no loader or trajectory errors.gui/501session. The restart behavior is covered by focused service/lifecycle regression tests; the headless foreground-gateway fallback was not misrepresented as LaunchAgent proof.