Skip to content

feat: harden live gateway and mac restarts#104314

Merged
steipete merged 2 commits into
mainfrom
codex/audit-gateway-restart-logs
Jul 11, 2026
Merged

feat: harden live gateway and mac restarts#104314
steipete merged 2 commits into
mainfrom
codex/audit-gateway-restart-logs

Conversation

@steipete

@steipete steipete commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • capture the wall-clock boundary before each managed Gateway restart
  • query structured Gateway logs through RPC after deep status and health proof
  • fail on restart-window error/fatal entries; return bounded warning/error summaries in updater output
  • document the log audit as a required live-updater invariant
  • keep the current managed Mac app alive while its signed replacement builds, then perform only the short final process swap
  • repeat the foreign-process safety check immediately before that swap

Proof

  • pnpm exec vitest run test/scripts/openclaw-live-updater.test.ts test/scripts/restart-mac.test.ts (46 passed)
  • SKILL.md frontmatter YAML parsed successfully
  • live restart at f9ebefba29 manually audited: 181 entries, zero error/fatal entries; warnings surfaced for review

@steipete steipete self-assigned this Jul 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +586 to +589
"--limit",
"1000",
"--max-bytes",
"1000000",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete force-pushed the codex/audit-gateway-restart-logs branch from 12eed38 to e1e2d6f Compare July 11, 2026 08:23
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head e1e2d6f3b341917bb736a771e2d00c2dee72dede, but the PR head is now b3da903a6b46c5004b81b46396d5809a0ab39423. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 11, 2026
@steipete steipete changed the title feat: audit gateway logs after live restarts feat: harden live gateway and mac restarts Jul 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/restart-mac.sh
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete merged commit 2ed2424 into main Jul 11, 2026
95 of 98 checks passed
@steipete
steipete deleted the codex/audit-gateway-restart-logs branch July 11, 2026 08:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 11, 2026
* feat: audit gateway logs after live restarts

* fix: keep mac app running during replacement build
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
* feat: audit gateway logs after live restarts

* fix: keep mac app running during replacement build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant