feat: harden live gateway and mac restarts#104314
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12eed38923
ℹ️ 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".
| "--limit", | ||
| "1000", | ||
| "--max-bytes", | ||
| "1000000", |
There was a problem hiding this comment.
Cover the full restart log window
When a restart emits more than 1000 log lines or 1 MB before this audit runs, openclaw logs returns only the newest tail (the log reader slices to the last limit lines), so an error/fatal entry earlier in the restart window is absent from output and parseGatewayLogAudit can pass with zero errors. For noisy startup/plugin logs, this defeats the new restart-window invariant; capture a cursor/size before restarting or fail when the returned tail is truncated or does not reach sinceMs.
Useful? React with 👍 / 👎.
12eed38 to
e1e2d6f
Compare
|
Codex review: stale review; fresh review needed. Summary Next step |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1e2d6f3b3
ℹ️ 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".
| restartGateway(runCommand, update.checkout, update.afterSha); | ||
| const restartStartedAt = restartGateway(runCommand, update.checkout, update.afterSha); | ||
| verifyGateway(runCommand, update.checkout, update.afterSha); | ||
| gatewayLogAudit = auditGatewayLogs(update.checkout, restartStartedAt); |
There was a problem hiding this comment.
Persist restart audit windows before probing
When a freshly restarted Gateway is slow enough that this first verifyGateway call throws, auditGatewayLogs is never reached and the restart boundary is not saved anywhere. A later heartbeat can then see the exact-current build, pass the no-restart verifyGateway path, and return ok without ever auditing the logs emitted by the managed restart that just happened; persist the restart start time before probing, or carry a pending audit window into the next pass.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3da903a6b
ℹ️ 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".
| if ! kill_managed_openclaw; then | ||
| fail "Managed OpenClaw instances did not exit after cleanup attempts" | ||
| fi | ||
| log "==> Keeping managed OpenClaw running while the replacement builds" |
There was a problem hiding this comment.
Avoid packaging over a live target-only bundle
When --target-only is used while the live app is this checkout's dist/OpenClaw.app, this branch now leaves that process running, but the immediately following package app step invokes scripts/package-mac-app.sh, which deletes and recreates the same bundle with rm -rf "$APP_ROOT" before this script's later switch block (scripts/package-mac-app.sh:223-225). That means the preserved live app can run while its own bundle is removed/partially rewritten, and any build/package/signing failure leaves the old process backed by a missing or incomplete bundle rather than a clean old version; package/sign into a separate bundle or keep the old kill-before-package behavior for same-bundle restarts.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
* feat: audit gateway logs after live restarts * fix: keep mac app running during replacement build
* feat: audit gateway logs after live restarts * fix: keep mac app running during replacement build
Summary
Proof
pnpm exec vitest run test/scripts/openclaw-live-updater.test.ts test/scripts/restart-mac.test.ts(46 passed)f9ebefba29manually audited: 181 entries, zero error/fatal entries; warnings surfaced for review