Skip to content

fix(acp): refresh runtime handles on config changes - #82237

Merged
giodl73-repo merged 5 commits into
openclaw:mainfrom
giodl73-repo:fix-acp-runtime-config-cache-59273
May 16, 2026
Merged

giodl73-repo merged 5 commits into
openclaw:mainfrom
giodl73-repo:fix-acp-runtime-config-cache-59273

Conversation

@giodl73-repo

@giodl73-repo giodl73-repo commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add the runtime config cache key to cached ACP runtime handles.
  • Reuse cached handles only when backend, agent, mode, cwd, persisted identity, and runtime config signature still match.
  • Add a regression covering tools.exec.security / safeBins changes so ACP sessions reinitialize instead of reusing stale handles.

Real behavior proof

Validation

  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm test src/acp/control-plane/manager.test.ts src/acp/control-plane/runtime-cache.test.ts
  • COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm check:changed

Fixes #59273.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels May 15, 2026
@giodl73-repo

Copy link
Copy Markdown
Contributor Author

OpenClaw QA Artifacts

Summary

ACP runtime config cache proof for PR #82237.

  • Before: origin/main 7715b29 with the PR regression spec fails because the cached ACP runtime handle is reused after tools.exec.security and safeBins change.
  • After: PR branch 59b92f2e27 passes the same focused manager/cache scenario and re-ensures the runtime handle.
  • Artifact image: acp-runtime-config-cache-before-after-proof.png
  • Logs: before-origin-main-with-regression-test.log, after-pr-82237.log

Evidence

@clawsweeper

clawsweeper Bot commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR adds a runtime config signature to cached ACP runtime handles and regression coverage so tools.exec.security / safeBins changes invalidate stale handle reuse.

Reproducibility: yes. there is a high-confidence source/proof-artifact path: add the PR regression to current main and run the focused ACP manager test, which the linked before log shows failing because ensureSession is called once after the config changes. I did not run tests locally because this was a read-only review.

Real behavior proof
Needs real behavior proof before merge: Needs real behavior proof before merge: the linked logs and screenshot show mocked unit-fast before/after runs, so the contributor still needs redacted live ACP/Discord or real runtime config-update proof; screenshots, recordings, terminal/live output, or redacted logs are acceptable, and updating the PR body should trigger a fresh ClawSweeper review or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, ask a maintainer to comment @clawsweeper re-review.

Next step before merge
Needs maintainer handling for the protected label, contributor real behavior proof, and the linked issue close scope; no narrow automated code repair is identified.

Security
Cleared: The diff only threads a config signature through ACP cache state and tests; it adds no dependency, workflow, secret, permission, or artifact execution change.

Review details

Best possible solution:

Land the focused cache-signature fix after protected-label maintainer review and redacted real behavior proof, while keeping any queued Discord config-snapshot or per-session directive remainder tracked separately.

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

Yes, there is a high-confidence source/proof-artifact path: add the PR regression to current main and run the focused ACP manager test, which the linked before log shows failing because ensureSession is called once after the config changes. I did not run tests locally because this was a read-only review.

Is this the best way to solve the issue?

Yes for the ACP cache path: comparing resolveRuntimeConfigCacheKey() in cached runtime state is the narrow maintainable fix for stale handle reuse. It should not be treated as complete proof for queued Discord restart jobs or persisted per-session exec directives.

Acceptance criteria:

  • node scripts/run-vitest.mjs src/acp/control-plane/manager.test.ts src/acp/control-plane/runtime-cache.test.ts
  • Crabbox/Testbox or equivalent live ACP/Discord or real runtime config-update proof with private details redacted
  • Confirm merge wording does not prematurely close Discord sessions carry stale exec config through gateway restarts #59273 if queued-config behavior remains open

What I checked:

  • live-pr-state: GitHub API shows this PR is open at head 3f251e1 with labels maintainer and size: S, and the branch is mergeable but unstable. (3f251e1e1d7a)
  • current-main-cache-gate: Current main's ensureRuntimeHandle() reuse predicate checks backend, agent, mode, cwd, handle metadata, and runtime health, with no runtime config identity comparison. (src/acp/control-plane/manager.core.ts:1472, 4526b447781d)
  • current-main-cache-state: Current main's CachedRuntimeState stores runtime, handle, backend, agent, mode, cwd, and applied control signature, but no config signature. (src/acp/control-plane/runtime-cache.ts:3, 4526b447781d)
  • pr-diff: The PR imports resolveRuntimeConfigCacheKey(), stores configSignature in cached runtime states, and requires the cached signature to match before handle reuse. (src/acp/control-plane/manager.core.ts:1471, 3f251e1e1d7a)
  • config-key-contract: resolveRuntimeConfigCacheKey() already provides a revision/fingerprint key for the active runtime snapshot and falls back to a stable hash for ordinary config objects, which is an appropriate dependency for cache invalidation. (src/config/runtime-snapshot.ts:164, 4526b447781d)
  • focused-proof-artifacts: Downloaded proof logs show the added regression fails on before-main with ensureSession called once instead of twice, while the after log passes the focused manager/runtime-cache unit-fast tests; this is still mocked unit-path proof, not real behavior proof. (src/acp/control-plane/manager.test.ts:945)

Likely related people:

  • osolmaz: Commit a7d56e3 introduced ACP thread-bound agents and the central manager/runtime-cache/test surface involved in this cache reuse bug. (role: introduced ACP runtime-cache/control-plane behavior; confidence: high; commits: a7d56e3554d0; files: src/acp/control-plane/manager.core.ts, src/acp/control-plane/runtime-cache.ts, src/acp/control-plane/manager.test.ts)
  • steipete: Commit 94a9d3f added runtime config revision tracking and resolveRuntimeConfigCacheKey(), and recent ACP test/runtime commits touch the same cache-control path. (role: adjacent config and recent ACP area owner; confidence: high; commits: 94a9d3f0bedb, f8ae0fb1c4ff; files: src/config/runtime-snapshot.ts, src/acp/control-plane/manager.test.ts, src/acp/control-plane/manager.core.ts)
  • pgondhi987: Commit 386d321 recently touched manager.core.ts and manager.test.ts around ACP/gateway approval behavior adjacent to this exec-policy path. (role: recent area contributor; confidence: medium; commits: 386d321634b3; files: src/acp/control-plane/manager.core.ts, src/acp/control-plane/manager.test.ts)
  • kaseonedge: Commit 8237d16 recently changed ACP backend failover behavior in the same manager/test area, with altaywtf listed as reviewer in commit metadata. (role: recent ACP manager contributor; confidence: medium; commits: 8237d165e266; files: src/acp/control-plane/manager.core.ts, src/acp/control-plane/manager.test.ts)

Remaining risk / open question:

  • The linked artifacts prove the focused mocked unit path, but not a live ACP/Discord gateway restart or real runtime config-update flow with changed exec policy.
  • The linked issue also describes queued Discord jobs capturing old config during restart; this PR only proves the cached runtime-handle invalidation part.
  • The PR body uses closing syntax for Discord sessions carry stale exec config through gateway restarts #59273 even though remaining queued-config behavior may need separate tracking or adjusted close scope.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 4526b447781d.

@giodl73-repo
giodl73-repo force-pushed the fix-acp-runtime-config-cache-59273 branch 6 times, most recently from 9b0f503 to 99bbcc6 Compare May 16, 2026 14:09
@giodl73-repo
giodl73-repo force-pushed the fix-acp-runtime-config-cache-59273 branch from 99bbcc6 to 07b1b45 Compare May 16, 2026 14:14
@clawsweeper clawsweeper Bot added the P1 High-priority user-facing bug, regression, or broken workflow. label May 16, 2026
@giodl73-repo
giodl73-repo merged commit 2640244 into openclaw:main May 16, 2026
113 checks passed
vincentkoc added a commit that referenced this pull request May 16, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(acp): refresh runtime handles on config changes
* chore: refresh CI after main repairs
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
* fix(acp): refresh runtime handles on config changes
* chore: refresh CI after main repairs
galiniliev pushed a commit to galiniliev/openclaw that referenced this pull request May 25, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(acp): refresh runtime handles on config changes
* chore: refresh CI after main repairs
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(acp): refresh runtime handles on config changes
* chore: refresh CI after main repairs
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord sessions carry stale exec config through gateway restarts

1 participant