Repository navigation
fix: keep OpenClaw helper calls working across runtime changes - #166235
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 2:13 AM ET / 06:13 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR lets OpenClaw’s setup and repair helper select its own model runtime and plugin inventory while preserving caller permissions and cancellation, with regression coverage for repeated calls. Merge readiness✅ Ready for maintainer review This PR remains useful: pinned main and v2026.9.8 still inherit incompatible caller selection scopes. The focused repair has source-bound Gateway proof, and this review found no blocking defect or unresolved product choice. Priority: P1 Review scores
Verification
How this fits togetherRegular agents invoke the built-in OpenClaw helper through the Gateway for setup and repair. The helper verifies its own inference route and returns a reply or approval outcome to the calling agent. flowchart TD
A[Regular agent request] --> B[Delegation tool]
B --> C[Preserve caller authority]
C --> D[Clear caller selection scopes]
D --> E[Gateway helper admission]
E --> F[Verified helper runtime]
F --> G[Reply or approval outcome]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +7, Tests +75. Total +82 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep helper runtime selection independent of its caller while retaining the existing verified-route, live-authority and cancellation guards. Do we have a high-confidence way to reproduce the issue? Yes: source traces a caller's inherited generation into independently selected helper admission, where the lease rejects it; the contributor also supplies built-Gateway before/after observations. This reviewer did not execute a reproduction. Is this the best way to solve the issue? Yes: using the established paired scope utilities at the delegation boundary repairs selection ownership without weakening generation freshness or adding a competing runtime owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d06bc0fec01. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
8822545 to
3e3fb32
Compare
|
Landed in d72a907. Thanks @PollyBot13! Verified on a built Gateway: a caller on a non-default model and a second helper call after a benign reload were rejected on main and now succeed on the helper's own route, a changed model definition is still rejected, and a real gpt-5-mini helper call passed on this head. |
…law#166235) Let the OpenClaw helper run on its own verified default route when its caller was admitted on a different runtime generation or a benign inventory reload landed between calls, instead of rejecting the call. A genuinely changed model definition is still rejected. Related: openclaw#139710 Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #139710 and its consolidated duplicate #166138.
What Problem This Solves
Fixes the OpenClaw helper rejecting calls when its caller was admitted on a different runtime generation, or a benign inventory reload lands before a second helper call.
User Impact
A regular agent can consult the helper on the helper's verified default route while retaining its own non-default selection, and can consult it again after a benign reload. Genuine route drift and closed caller authority still fail closed.
Why This Change Was Made
The in-process delegation boundary was carrying the caller's prepared generation and plugin inventory into an independently selected helper runtime. Clear both selection scopes using the existing paired re-admission utilities already used by the embedded runner. Caller identity, approval checks, invocation/lifecycle authority, cancellation and the parent's scopes remain intact. No new owner manager, retry loop, public API, provider/config change, or weakened freshness check.
Credit: XX441's earlier diagnosis and proposed prepared-scope boundary. The paired plugin-inventory boundary additionally addresses the retired-inventory failure exposed by the real reload replay. This is independent of #157801 and does not modify that author's branch. Error guidance is a separate companion fix; this patch does not claim arbitrary active-plugin drain recovery (#160122).
Evidence
openclawtool →openclaw.chat→ embedded helper → synthetic loopback provider → actualgateway_statusresult returned to caller. Same-owner non-default-provider baseline fails before helper dispatch; final candidate succeeds on the verified default provider.plugins.load.paths=[]hot reload is observed while the same caller is held after its first successful helper call. Baseline rejects the second call as superseded; prepared-only candidate rejects its retired inventory; final paired boundary completes both calls, with four helper provider requests and two distinct successful helper outputs.build-all.mts qaRuntimepassed (37.8s). Full declaration/release packaging is not claimed.Redacted real Gateway observations
The fixture uses maintained test-instance, Gateway client and Responses SSE helpers with disposable HOME/state, authenticated operator/device, fixture-only keys and synthetic loopback provider. No production Gateway or provider is used. The caller's same
mainsession switches fromopenai/proof-defaultto bundledlitellm/proof-override; the helper remains on the verified default.Final production source SHA-256:
99b2ddb997efa1c0b2498f76f05a2e6f0fb56cf9c7af27faae4178224ea02df8. Proof was captured from these source-identical precommit bytes; Git commit metadata changes no tested source.agent.wait.status=okalone is not used as evidence of helper success.Live proof covers synthetic provider transport and read-only Gateway status. Mutating final effects/live cancellation were not exercised in the Gateway fixture; focused approval/cancellation tests cover those fences. The benign reload fixture disables bundled plugins and does not establish active-plugin drain recovery.
CI baseline refresh — October 7
Rebased the unchanged patch from
88225457d9563d9c0b675162bb9f2fbd0f952449onto main0d06bc0fec0129608ed04ed286e7e1e2c28021e3, which includes the merged MCP dependency repair #166217. Refreshed head:3e3fb3208df892c8dd328f3ac089fe191795edd7. An independent Astra review verified identical per-parent patches and every PR-owned source/test blob, with no refresh-induced finding. No manifest, lockfile or audit-policy change is added by this PR.node scripts/run-vitest.mjsfocused regressions/controls: 108/108 passed (35.78 + 19.95 s). These local runs reuse the pre-refresh installed SDK 1.30.1/fs-safe 0.24.0 snapshot and supplement source validation, not clean-install compatibility. Hosted CI must validate the tracked SDK 1.31.0/fs-safe 0.24.1 dependencies.Owner acceptance: one two-file helper-admission boundary fix, reusing established utilities and existing fixtures. Rollback is reverting this patch. No persistent-data migration; no replay of already applied operations.
AI-assisted: implementation, synthetic fixture and independent review assisted by Codex.
Maintainer verification — October 7
No overlap with Pash/Sarah changes.
Rebuilt exact head
3e3fb3208df892c8dd328f3ac089fe191795edd7in isolated Node 24 Docker (qaRuntime, 44.3 s). A candidate Gateway accepted a synthetic non-default caller, executed itsopenclawdelegation, and returnedLIVE_HELPER_READYfrom one real gpt-5-mini Responses request (HTTP 200, 4096 output-token budget). The transport fixture set reasoning effort to low; caller and route-health responses were synthetic so only helper inference used the live provider. No mutating helper action is claimed. Gateway state was isolated on tmpfs and the provider credential was deleted afterward.Current main
02e2078de7f634af018906abd7a43c3e275d5e25has not touched either PR file since the candidate base; no base merge or source change was needed. Exact-head CI gate passes and ClawSweeper is ready.