fix: hand off supervised git updates#91296
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 10, 2026, 8:24 PM ET / 00:24 UTC. Summary PR surface: Source +392, Tests +1353, Docs +9. Total +1754 across 22 files. Reproducibility: yes. at source level and through the earlier systemd run: current main can rebuild a supervised git checkout while the Gateway is live, and the supplied environment reproduced the corrected handoff lifecycle. The exact latest head has not been re-proven. Review metrics: 2 noteworthy metrics.
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:
Next step before merge
Security Review detailsBest possible solution: Keep the detached handoff and preflight-before-stop design, but land only after the stopped-service terminal policy is explicitly accepted and the exact current head proves successful update plus at least one post-stop failure/recovery path in a real managed service. Do we have a high-confidence way to reproduce the issue? Yes, at source level and through the earlier systemd run: current main can rebuild a supervised git checkout while the Gateway is live, and the supplied environment reproduced the corrected handoff lifecycle. The exact latest head has not been re-proven. Is this the best way to solve the issue? Mostly yes: detached handoff with preflight before service stop is the cleanest owner-boundary fix for the live rebuild race. The unresolved question is the product contract for failures after the service has been stopped, not the central handoff architecture. AGENTS.md: found and applied where relevant. Codex review notes: reasoning high; reviewed against d559dfecfa7e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +392, Tests +1353, Docs +9. Total +1754 across 22 files. View PR surface stats
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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ab73ba3b3
ℹ️ 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".
| installSurface.kind === "global" || | ||
| (installSurface.kind === "git" && supervisor) |
There was a problem hiding this comment.
Stop the supervised gateway before git handoff updates
When this branch includes supervised git installs, the detached helper waits for the parent to exit and then runs openclaw update, but the CLI only stops a managed service for package updates (src/cli/update-cli/update-command.ts:3362) and git updates go straight to runGitUpdate (src/cli/update-cli/update-command.ts:3415). In a launchd/systemd git-source gateway, the supervisor can relaunch the gateway as soon as this process exits, so the helper still rebuilds the git checkout/dist tree while the newly restarted gateway is serving RPCs—the same stale-artifact window this change is meant to avoid.
Useful? React with 👍 / 👎.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
649bdd9 to
d7b31f1
Compare
|
Merged using rebase. What changed after review:
Verification:
Landed on
Thanks @abnershang! |
Summary
update.runcalls through the detached update handoff path.Real behavior proof
dist/while the live gateway was still serving RPCs, creating a transient stale-artifact window. A previous self-update lab run observed a transient module-resolution failure during that live rebuild window.cbx_4e5f6399ffa8) from a fresh PR checkout at50bafd3fc2fe62708bbed8c09259b62b9b62debf, using an isolated user-systemd gateway, isolated OpenClaw profile/state/config, and an isolated loopback port. The production fleet gateway was not changed.pnpm install --frozen-lockfileandpnpm buildfrom the fresh PR checkout.update.runthrough the backend Gateway RPC surface.update.runrequest did not rebuild the live gateway process in-place. It returned the managed handoff result, wrote the handoff sentinel, signaled the isolated service for restart, then the detached helper completed the git update, dependency install, build, UI build, doctor check, service restart, and health verification.Tests
node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-methods/update.test.tsnode scripts/test-projects.mjs src/agents/tools/gateway-tool.test.tspnpm tsgo:corepnpm buildgit diff --checkcrabbox run --provider gcp --type e2-standard-8 --fresh-pr openclaw/openclaw#91296 --script-stdinDependency changes
None. Dependency-file scan against
origin/mainreturned no files.AI-assisted
AI-assisted. I understand the change: supervised git-source updates now use the existing detached update handoff mechanism so the live gateway does not mutate its own built
disttree while handling the update RPC. Local Codex review was attempted but blocked by local Codex CLI auth returning401 Unauthorized.