Skip to content

perf(process): isolate agent exec IO in delegated cgroups - #188379

Merged
steipete merged 10 commits into
mainfrom
steipete/perf-micro-agent-exec-cgroup-20260919
Oct 30, 2026
Merged

steipete merged 10 commits into
mainfrom
steipete/perf-micro-agent-exec-cgroup-20260919

Conversation

@steipete

@steipete steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Disk-heavy agent commands contend with Gateway SQLite writes when their process trees share the Gateway's systemd cgroup. This change gives host agent-exec trees their own resource controls while keeping the Gateway in an uncapped sibling leaf.

User Impact

Agent exec receives an aggregate io.max ceiling, cpu.weight=10, and memory.high. Disk-heavy commands intentionally run more slowly to leave resources for interactive requests. The Gateway leaf receives no IO cap from this feature.

Delegation is an explicit operator action: openclaw gateway install --force or openclaw doctor --fix installs Delegate=yes and DelegateSubgroup=gateway (systemd 254+). systemd moves the launcher into the Gateway leaf before startup, leaving the service root empty for controller enablement. Normal updates preserve existing unit delegation policy, including its absence; they do not opt existing units in. Custom service policy is retained. Deployment controllers that assume root cgroup membership need coordinated adoption.

Without writable delegation, available controllers, and valid leaf placement, isolation leaves the cgroup layout unchanged, continues running, and emits one startup diagnostic directing the operator to Doctor. Unsupported backing filesystems also preserve working exec with a diagnostic.

Why This Change Was Made

io.max uses blk-throttle, including with the none scheduler. The startup owner resolves the state directory's exact mount, keeps md/RAID and device-mapper logical devices, normalizes partitions, and accounts for all btrfs members. The ceiling is a pressure budget, not measured storage bandwidth: one existing exec memory allowance per five minutes, split equally between reads and writes and across devices. IOPS use a 4 KiB equivalent; finite ancestor ceilings further cap each corresponding dimension at half its allowance.

Runtime detection reads /proc/self/cgroup and verifies writable delegated controls, leaf placement, and controllers. Helpers discover kernel-owned policy; existing broker IPC carries placement context where necessary. There is no new environment variable or user configuration. The environment budget stays unchanged at 458. The only baseline edit removes six obsolete mock exemptions; no baseline or budget is raised.

Broker children, host exec anchors, background descendants, PTY helpers, and extension ctx.exec share the placement owner. Extension exec reuses the owned child adapter while preserving custody, cancellation, bounded output, and background-child lifetime. Windows fallback cancellation retains its five-second grace and forced cleanup, and refuses PID-based signals after observed root exit. Hosted stop and startup installation self-proof recognize the managed /gateway leaf while preserving exact PID, service-manager, invocation, and migration checks.

The complete production-source delta is +543 lines. The new kernel/device owner and explicit installer contract require growth; the direct extension fallback, startup environment handoff, and its propagation/cache machinery are removed. Benchmark usage lives in scripts/perf/team-shape-stress.md; the shared performance README is unchanged.

Evidence

Reviewed head: 3b91424a444fa35773ef6168beb7dc77881daea4. Independent subagent review (autoreview route unavailable) is clean after the routing, cleanup, explicit opt-in, and delegated-service identity repairs.

  • Direct delegation: 46 focused tests passed in 54.18 s. The discovery regression failed against the old environment-dependent helper. The environment guard passes 458/458, with config/env-var-count-budget.txt unchanged.
  • Explicit update opt-in: 19 maintenance tests passed; five consent cases cover published/current updater, missing-unit recreation, explicit install, and Doctor. Two maintenance regressions failed before the fix. Existing installer/audit and upgrade/process fixture proof is retained.
  • Cancellation and identity: 20 exec tests, 30 child-adapter tests, 30 hosted-stop tests, and 34 startup-installation tests pass. Windows escalation, exited-root signaling, delegated hosted stop, and delegated startup identity each have failing old-code controls. PID, scope, invocation, and older-install migration guards remain covered.
  • Changed-file native lint/format, export collision, source closure, CI test-plan checks, and targeted types passed. CI caught two readonly assignments in the Windows fixture; the corrected three cases and exact services typecheck pass. The required mock-baseline shrink guard passes. No full local suite or build was run.

Linux x64 smoke and stated proof gap

Blacksmith Testbox tbx_01m66ccqggh6g3pb1n2dpwfg1n had 4 CPUs, about 16 GiB RAM, and systemd 255. Initial base and candidate builds passed. On the none scheduler, real agent exec writers inherited io.max: measured cgroup writes were approximately 6.2 MB/s under a 6,898,409 bytes/s per-direction ceiling. Gateway io.max remained empty. This is short placement/throttling evidence, not a latency comparison or proof of the final revision.

The long comparison is missing: ten-minute counterbalanced base/candidate timing and allocation runs under disk-heavy agent exec have not completed. No SQLite commit-p99 or main-thread-stall improvement is claimed. Final seven-route Linux placement and real installer-to-Doctor repair also remain unverified on Linux. The maintainer accepts the stated long-comparison gap and will run the real host comparison after explicit delegation. A long x64 comparison can run if capacity is granted immediately; queued leases are stopped rather than awaited. No production host was modified or load-tested.

Inherited pagination failures

The maintainer authorized the inherited-failure exception after baseline proof. The unchanged main parent cd963a2f16bbb9854596b0c8de8bd3a053419f67, run through both complete files with node scripts/run-vitest.mjs src/gateway/server.chat.cli-history.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts --maxWorkers=1, produced 4 failed, 61 passed in 168.51 s:

  • server.chat.gateway-server-chat-b.test.ts: chat.history backfills older offset pages across a dense silent gap (nextOffset undefined instead of 1); chat.history centers a bounded page around a message id (hasMore true instead of omitted).
  • server.chat.cli-history.test.ts: chat.history pages the full local prefix and external-only claude-cli rows; chat.history pages when every older claude-cli import duplicates a local row (both hasMore false instead of true).

These exactly match current-head CI run 41090495897, jobs 124184436259 and 124184436276. Upstream #188372 is already included in the executed baseline. CI tested merge 3b02afe24df18edf3586cd0db7d85cf09a927606, with main parent 2eef065f0f89960d0aaebfc64647386715cc9abe. The response-page owner, cursor helper, and both failing tests are byte-identical between the executed baseline and that tested merge.

Final CI and unrelated failures

Exact-head CI completed with 81 successful jobs, 25 skipped jobs, four failed test buckets, and the aggregate CI-gate failure. Build, lint, types, baseline ratchets, and all three PostgreSQL shards passed. Dependency and security-sensitive review checks passed; the independent review is clean and the four actionable review threads are resolved. Failed CI is not described as green. Landing uses the maintainer-authorized inherited/unrelated-failure exception.

Besides the pagination assertions above:

  • server.health-store-scheduling.test.ts, “registered Gateway health/status preserve separate resident snapshots while serving HTTP,” counted 11 resident selections instead of 12 while returning the correct payload. The complete two-case file passed five consecutive runs on the PR head and five on unchanged main parent cd963a2f16bbb9854596b0c8de8bd3a053419f67. The test and relevant health/summary/projection owners are unchanged through CI's actual main parent. Independent source review found that a background health collection can warm the shared cache between reset and spy attachment; the precise failing interleaving remains unproven. This meets the maintainer's five-run unrelated-flake rule, not a claim that the flake was fixed.
  • server.plugin-reload-send-revocation.product.test.ts, “runs Bob's allowed and revoked retained sends in a prebound owned process,” and server.plugin-reload-send-continuation.product.test.ts, “runs all three real reload continuations in a prebound owned process,” both timed out at 120,000 ms. Both exact signatures also occur on scheduled main ba6cfcd58df47a3037507362e45ed95757fae41c, run 41080670581, job 124149134806: 120,061 ms and 120,016 ms respectively. Local focused pairs also passed on both revisions; another head replay reproduced the continuation timeout. These replays are supplementary: the matching scheduled-main failures establish attribution. Baseline replay used CI's Node 24 launcher, head replay Node 26, and both used the pinned Bun test runtime; the actual CI main parent also includes newer continuation-fixture diagnostics/setup.

Earlier config-readiness failed once and later passed; that prior failure remains unexplained, not claimed fixed. No CI reruns or dispatches were used to chase green.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling app: linux plugin: linux-node size: XL labels Oct 30, 2026
@steipete
steipete marked this pull request as ready for review October 30, 2026 13:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T16:34:20.842743Z 3b91424 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 3c9b1b3071

ℹ️ 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 src/agents/sessions/exec.ts Resolved
Comment thread src/agents/sessions/exec.ts Resolved
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR separates Linux agent commands from Gateway processes using delegated cgroups with aggregate IO and memory pressure limits and lower CPU priority.

Example: A Linux Gateway has a 4 GiB exec memory allowance and one backing device.

  • Before: Agent disk writers share the Gateway cgroup without a separate aggregate IO ceiling.
  • After: Agent commands receive approximately 6.8 MiB/s per direction while Gateway processes remain outside that ceiling.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful direction, but concrete cleanup regressions and failed consumer checks remain, and the declared runtime and upgrade evidence is unfinished.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 6 actionable review findings remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Disk-heavy agent commands can delay Gateway SQLite writes and interactive requests.
Reason: The maintainer-authored direction explicitly accepts slower command IO to protect interactive service responsiveness.

Merge readiness

⛔ Blocked before merge - 8 items remain

Keep open: this maintainer-directed performance improvement has value, but execution-cleanup regressions and unmigrated consumers block merge.

Priority: P2
Reviewed head: 3c9b1b3071a1fd8d4ab7137157df84648457dcb6

Before merge

  • Restore forced cancellation for the Windows fallback (P2) - When native Job support or its launcher is unavailable, createChildAdapter uses an ordinary Windows child. Its SIGTERM branch only invokes non-forced taskkill and schedules neither escalation nor the hard-kill settlement deadline. This caller now invokes that branch once, so an uncooperative command can survive timeout or abort indefinitely while wait and cleanup remain pending. Preserve the previous bounded forced cancellation; this confirms the concern at perf(process): isolate agent exec IO in delegated cgroups #188379 (comment).
  • Preserve canonical errors when extinction confirmation rejects (P2) - A POSIX relay that cannot confirm descendant extinction rejects waitForExtinction with an ordinary error. This join only converts a resolved Windows uncertain outcome, then rethrows rejected cleanup unchanged. Consequently a cancelled extension command loses ERR_COMMAND_PROCESS_CLEANUP_UNCERTAIN and its captured result, violating the contract established by fix: propagate uncertain extension command cleanup #169629. Convert failed extinction confirmation to the canonical cleanup error and retain the command result and underlying failure.
  • Migrate the extension cleanup regression to the adapter owner (P2) - loader.exec-cleanup.real.test.ts still spies on commands.spawnCommand and immediately extracts its returned child before entering cleanup. This path now calls createChildAdapter instead, so both cases fail before exercising cleanup classification and can leave the asynchronous fixture running. Exact-head CI confirms both failures. Update this consumer to observe the new owner while retaining real successful-cleanup and denied-forced-stop assertions.
  • Teach the survivor manager the new generated directives (P2) - Every generated Gateway unit now includes Delegate and DelegateSubgroup, but scripts/e2e/lib/upgrade-survivor/systemd-fixture.mjs rejects any Service directive outside its fixed supported set, which lacks both keys. Newly generated units therefore fail installation or inspection with 'Unsupported survivor manager request or generated unit grammar'; exact-head upgrade-survivor CI confirms this. Update the copied manager contract and its relevant installation and lifecycle coverage.
  • Update audit fixtures for the expanded systemd query (P2) - The new query and delegation audit leave two existing consumers stale: install.definition-repair.test.ts matches the old exact property string, so its concurrent-edit injection never runs, and systemd.environment-preservation.test.ts returns no delegation properties, producing a new unexpected audit issue. Exact-head CI confirms both failures. Update those fixtures while preserving the concurrent-edit refusal and operator-environment assertions.
  • Replace the relay test's obsolete argument-count assertion (P3) - The Homebrew runtime regression in relay-integration.test.ts expects exactly three spawnProcess arguments. This call now supplies five, including undefined optional arguments for the ordinary route, so that existing check fails despite selecting the correct executable. Update or replace the assertion to protect stable-runtime selection without pinning incidental trailing argument count; exact-head CI reports this failure.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.
  • Explain or restore the original intent of Extension execution and cleanup - fix: propagate uncertain extension command cleanup #169629: Uncertain descendant cleanup must produce a canonical error while preserving captured output and the root result.

Findings

  • [P2] Restore forced cancellation for the Windows fallback — src/agents/sessions/exec.ts:102-105
  • [P2] Preserve canonical errors when extinction confirmation rejects — src/agents/sessions/exec.ts:249-257
  • [P2] Migrate the extension cleanup regression to the adapter owner — src/agents/sessions/exec.ts:130-141

Provenance

Tests

  • Missing end-to-end proof: Supply the pending production-route kernel and comparative Gateway measurements plus fresh-install and latest-stable Doctor upgrade evidence; the placement regression's base-fail/head-pass result is not yet shown.
Agent review details

How this fits together

Gateway startup prepares kernel resource policy; process brokers, command adapters, and PTY helpers place command trees into the exec cgroup while service installation and Doctor manage delegation.

flowchart TD
  A[Service installation and Doctor] --> B[Delegated service cgroup]
  B --> C[Gateway leaf]
  C --> D[Gateway startup policy]
  D --> E[Agent exec leaf]
  C --> F[Broker and command adapters]
  F --> E
  E --> G[Commands and descendants]
Loading

Technical review

Best possible solution:

Keep the shared cgroup placement design, restore bounded cancellation and canonical cleanup errors, and complete the existing consumer cutover.

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

Source establishes the Windows cancellation and cleanup-classification regressions, and exact-head CI confirms several consumer failures; no target code was executed during this review.

Is this the best way to solve the issue?

One startup policy owner with placement at existing process boundaries is appropriate, but replacing extension execution must preserve its established cancellation and error contracts.

Full review comments:

  • [P2] Restore forced cancellation for the Windows fallback — src/agents/sessions/exec.ts:102-105
    When native Job support or its launcher is unavailable, createChildAdapter uses an ordinary Windows child. Its SIGTERM branch only invokes non-forced taskkill and schedules neither escalation nor the hard-kill settlement deadline. This caller now invokes that branch once, so an uncooperative command can survive timeout or abort indefinitely while wait and cleanup remain pending. Preserve the previous bounded forced cancellation; this confirms the concern at perf(process): isolate agent exec IO in delegated cgroups #188379 (comment).
    Confidence: 0.99
  • [P2] Preserve canonical errors when extinction confirmation rejects — src/agents/sessions/exec.ts:249-257
    A POSIX relay that cannot confirm descendant extinction rejects waitForExtinction with an ordinary error. This join only converts a resolved Windows uncertain outcome, then rethrows rejected cleanup unchanged. Consequently a cancelled extension command loses ERR_COMMAND_PROCESS_CLEANUP_UNCERTAIN and its captured result, violating the contract established by fix: propagate uncertain extension command cleanup #169629. Convert failed extinction confirmation to the canonical cleanup error and retain the command result and underlying failure.
    Confidence: 0.98
  • [P2] Migrate the extension cleanup regression to the adapter owner — src/agents/sessions/exec.ts:130-141
    loader.exec-cleanup.real.test.ts still spies on commands.spawnCommand and immediately extracts its returned child before entering cleanup. This path now calls createChildAdapter instead, so both cases fail before exercising cleanup classification and can leave the asynchronous fixture running. Exact-head CI confirms both failures. Update this consumer to observe the new owner while retaining real successful-cleanup and denied-forced-stop assertions.
    Confidence: 1
  • [P2] Teach the survivor manager the new generated directives — src/daemon/systemd-unit.ts:68-70
    Every generated Gateway unit now includes Delegate and DelegateSubgroup, but scripts/e2e/lib/upgrade-survivor/systemd-fixture.mjs rejects any Service directive outside its fixed supported set, which lacks both keys. Newly generated units therefore fail installation or inspection with 'Unsupported survivor manager request or generated unit grammar'; exact-head upgrade-survivor CI confirms this. Update the copied manager contract and its relevant installation and lifecycle coverage.
    Confidence: 1
  • [P2] Update audit fixtures for the expanded systemd query — src/daemon/service-audit-systemd.ts:279-280
    The new query and delegation audit leave two existing consumers stale: install.definition-repair.test.ts matches the old exact property string, so its concurrent-edit injection never runs, and systemd.environment-preservation.test.ts returns no delegation properties, producing a new unexpected audit issue. Exact-head CI confirms both failures. Update those fixtures while preserving the concurrent-edit refusal and operator-environment assertions.
    Confidence: 1
  • [P3] Replace the relay test's obsolete argument-count assertion — src/process/spawn-broker/relay-integration.ts:176-177
    The Homebrew runtime regression in relay-integration.test.ts expects exactly three spawnProcess arguments. This call now supplies five, including undefined optional arguments for the ordinary route, so that existing check fails despite selecting the correct executable. Update or replace the assertion to protect stable-runtime selection without pinning incidental trailing argument count; exact-head CI reports this failure.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b186cf209834.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/agents/sessions/exec.test.ts src/agents/sessions/exec.real.test.ts src/agents/sessions/extensions/loader.exec-cleanup.real.test.ts --maxWorkers=1
  • pnpm test src/process/supervisor/adapters/child.test.ts src/process/spawn-broker/relay-integration.test.ts --maxWorkers=1
  • pnpm test src/daemon/systemd.environment-preservation.test.ts src/cli/daemon-cli/install.definition-repair.test.ts --maxWorkers=1
  • pnpm test test/scripts/upgrade-survivor-systemd.test.ts test/scripts/docker-build-helper.test.ts --maxWorkers=1
  • node scripts/check-changed.mjs

What I checked:

PR surface

Source +452, Tests +278, Docs +66, Other +553. Total +1349 across 38 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 21 628 176 +452
Tests 9 492 214 +278
Docs 2 66 0 +66
Config 0 0 0 0
Generated 0 0 0 0
Other 6 553 0 +553
Total 38 1739 390 +1349

Review metrics

Metric Value Why it matters
New benchmark flag 1: --exec-io-storm Adds an opt-in disk-contention workload to the existing performance harness; introduces no production configuration knob.

Labels

Label changes:

  • add P2: Resource isolation is a useful performance improvement with platform-specific execution regressions requiring normal-priority repair.
  • add merge-risk: 🚨 compatibility: Changes generated service layout and extension cleanup behavior; the service-layout tradeoff is explicitly accepted in the maintainer-authored body.
  • add merge-risk: 🚨 availability: Windows fallback commands can remain running indefinitely after timeout or abort.
  • add merge-risk: 🚨 automation: Generated units now fail the copied survivor manager's grammar, breaking install and upgrade proof paths.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Resource isolation is a useful performance improvement with platform-specific execution regressions requiring normal-priority repair.
  • merge-risk: 🚨 compatibility: Changes generated service layout and extension cleanup behavior; the service-layout tradeoff is explicitly accepted in the maintainer-authored body.
  • merge-risk: 🚨 availability: Windows fallback commands can remain running indefinitely after timeout or abort.
  • merge-risk: 🚨 automation: Generated units now fail the copied survivor manager's grammar, breaking install and upgrade proof paths.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 9:59 AM ET / 13:59 UTC.

Complete worker COMMIT measurement and update service/process fixtures for the delegated cgroup contract.
@steipete
steipete force-pushed the steipete/perf-micro-agent-exec-cgroup-20260919 branch from 3c9b1b3 to a5ae78c Compare October 30, 2026 14:15
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Oct 30, 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: 8a116f4c0f

ℹ️ 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 src/daemon/systemd-unit.ts Resolved
@steipete

steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the outstanding lifecycle review findings in 3b91424a444fa35773ef6168beb7dc77881daea4:

  • Windows fallback cancellation preserves the five-second grace period and then requests forced adapter cleanup. Regression red before the fix; 20 focused exec tests pass.
  • Windows fallback signals are also fenced after observed root exit, preventing PID reuse while descendants hold output. The existing bounded uncertain-cleanup result remains; 3 cases were red before the fix and all 30 adapter tests pass.
  • Hosted stop recognizes the delegated /gateway leaf while checking the exact owning service, PID, and invocation, and verifies its executor is outside the entire service subtree. Both delegated regressions were red; 30 focused tests pass.
  • Startup installation self-proof now recognizes the exact managed /gateway leaf while preserving PID, manager, and migration guards. Three delegated cases failed before the fix; 34 focused startup tests pass.
  • Extension cleanup tests now exercise the owned child adapter rather than spying on the retired spawn path; their earlier focused cleanup proof remains documented in the PR.

Independent review is clean. The private environment marker is removed and the environment budget remains unchanged at 458/458. The PR records the x64 throttling smoke and missing long comparison.

The mock baseline only shrinks by six obsolete entries requested by CI. All other baseline and budget files are unchanged.

Exact-head CI has completed. Landing uses the authorized inherited/unrelated-failure exception: four pagination assertions reproduce on unchanged main parent cd963a2f16bbb9854596b0c8de8bd3a053419f67 (4 failed, 61 passed); the health scheduling read-count assertion passed five full-file runs on each revision with the relevant owner logic unchanged; and both plugin-reload wrapper timeouts match scheduled-main run 41080670581, job 124149134806 at ba6cfcd58df47a3037507362e45ed95757fae41c. The PR body names every test and retains the remaining uncertainty. Current-head build, lint, types, ratchets, all PostgreSQL shards, dependency review, and security-sensitive review passed. No failed CI is labeled green.

@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: ae782ab0ba

ℹ️ 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 src/daemon/systemd-unit.ts Resolved
@steipete
steipete merged commit 90b5734 into main Oct 30, 2026
174 of 180 checks passed
@steipete
steipete deleted the steipete/perf-micro-agent-exec-cgroup-20260919 branch October 30, 2026 17:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…88379)

* perf(process): isolate agent exec IO in delegated cgroups

* fix(process): preserve exec cleanup classification

Complete worker COMMIT measurement and update service/process fixtures for the delegated cgroup contract.

* fix(process): require explicit delegation for exec isolation

* test(process): type the cleanup fixture PID pair

* test(process): preserve exports in delegation mocks

* fix(process): discover exec delegation from kernel state

* fix(process): preserve stop and fallback cancellation lifecycles

* fix(process): fence Windows fallback signals after root exit

* test(process): define native exit state in Windows fixtures

* fix(cli): recognize delegated Gateway installation identity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: linux cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: linux-node rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant