fix(config): guard legacy agentRuntime regression#73257
Conversation
Greptile SummaryThis PR adds regression tests only — no production code is changed. It adds a Confidence Score: 5/5Safe to merge — only test files are changed, no production code is affected. All changes are in test files. The new assertions correctly model the existing implementation: AgentRuntimePolicySchema already accepts { id, fallback }, 'doctor' is already in ALLOWED_INVALID_COMMANDS, and runtime.error is always called before the allowInvalid exit guard. No files require special attention. Reviews (1): Last reviewed commit: "fix(config): guard legacy agentRuntime r..." | Re-trigger Greptile |
80d92b9 to
f44a88c
Compare
|
Codex review: needs maintainer review before merge. Reviewed May 25, 2026, 10:57 AM ET / 14:57 UTC. Summary PR surface: Tests +18. Total +18 across 2 files. Reproducibility: no. high-confidence current-main failure path remains; current main and Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge Security Review detailsBest possible solution: Land the focused guardrail tests if maintainers want regression coverage; no runtime/config contract change is needed in this PR. Do we have a high-confidence way to reproduce the issue? No high-confidence current-main failure path remains; current main and Is this the best way to solve the issue? Yes. For the remaining PR scope, targeted tests are the narrowest maintainable solution because production behavior already matches the desired contract. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against aa702cf3dbe7. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +18. Total +18 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Pearl Merge Sprite Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
Fixes openclaw#72872 Co-authored-by: OpenClaw Bot <bot@openclaw.dev>
|
Landing verification for #73257. Behavior addressed: regression coverage for Exact local command run before merge: git switch --detach upstream/main
git merge --no-ff --no-commit upstream/pr-73257-head
pnpm test -- src/config/zod-schema.agent-defaults.test.ts src/cli/program/config-guard.test.ts
git merge --abort
git switch mainLocal proof: merged CI proof: GitHub checks green on the relevant lanes, including Real behavior proof run Known proof gaps: no packaged npm global install or original macOS upgrade reproduction was rerun for this test-only guardrail PR. |
Summary
Describe the problem and fix in 2–5 bullets:
Config invalidonagents.defaults.agentRuntime, which could block CLI workflows including the suggesteddoctor --fixrecovery path.mainby direct commit 5b9be2c (fix: migrate agent runtime config). GitHub's commit-to-PR lookup returns no associated PR for that commit.agents.defaults.agentRuntimeis accepted by schema validation, and config guard allowlisted commands (includingdoctor fix) do not hard-exit on invalid snapshots while still surfacing diagnostics.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
agents.defaults.agentRuntimefrom prior 4.x configs; gates ALL CLI commands includingdoctor --fix#72872maincommit; no associated PR returned by GitHub commit-to-PR lookup)Root Cause (if applicable)
mainby 5b9be2c.agents.defaults.agentRuntimeacceptance +doctor fixallowlist behavior in the config guard test path.Regression Test Plan (if applicable)
src/config/zod-schema.agent-defaults.test.tssrc/cli/program/config-guard.test.tsagents.defaults.agentRuntimevaluesUnrecognized key: "agentRuntime"does not hard-exit allowlisted commands, includingdoctor fix, while still printing diagnostics.agentRuntime-specific assertion.User-visible / Behavior Changes
None. This PR adds tests only; the user-visible regression fix is already present on
mainin 5b9be2c.Diagram (if applicable)
N/A
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
amber-crab(leasecbx_e503b0866411) with Nodev22.22.2and pnpm11.2.2agents.defaults→Unrecognized key: "agentRuntime")Steps
pnpm test -- src/config/zod-schema.agent-defaults.test.ts src/cli/program/config-guard.test.tscollect-openclaw-evidence.sh --id amber-crab --name pr-73257-agent-runtime-proof --test src/config/zod-schema.agent-defaults.test.ts --test src/cli/program/config-guard.test.ts --command '<schema proof command>'agentRuntimeand rejects retiredfallback.Expected
agents.defaults.agentRuntime.doctor fixdoes not hard-exit and still emits key diagnostics.Actual
59b92227a710db43bd421c652322eb13ef6a35b7): 2 Vitest shards passed, 41 tests passed. After rebasing onto currentorigin/main, focused local proof also passed on heada09d162ab0414f2ba05c60ef22bcc78f8c0471bb: 2 files passed, 41 tests passed.AGENT_RUNTIME_SCHEMA_PROOF=idOnly:true;fallback:false;fallbackIssue:agentRuntime:Unrecognized key: "fallback".Real Behavior Proof
Behavior addressed:
agents.defaults.agentRuntimeremains accepted by schema validation with the supported id-only shape, and allowlisted invalid-config commands includingdoctor fixcontinue instead of hard-exiting while surfacing diagnostics.Real environment tested: Azure Crabbox provider
azure, slugamber-crab, leasecbx_e503b0866411, remote workdir/work/crabbox/cbx_e503b0866411/openclaw-pr73257-evidence; Nodev22.22.2, pnpm11.2.2.Exact steps or command run after this patch:
collect-openclaw-evidence.sh --id amber-crab --name pr-73257-agent-runtime-proof --test src/config/zod-schema.agent-defaults.test.ts --test src/cli/program/config-guard.test.ts --command '<schema proof command>'.Evidence after fix:
AGENT_RUNTIME_SCHEMA_PROOF=idOnly:true;fallback:false;fallbackIssue:agentRuntime:Unrecognized key: "fallback"; Azure Crabbox:src/config/zod-schema.agent-defaults.test.tspassed 28 tests andsrc/cli/program/config-guard.test.tspassed 13 tests; post-rebase local focused proof also passed 41 tests.Observed result after fix: Crabbox evidence run exited
0; focused remote tests passed 2 shards / 41 tests; post-rebase focused local tests passed 2 files / 41 tests; id-onlyagentRuntimeparsed successfully and retiredfallbackwas rejected.What was not tested: full cross-version upgrade flow on the originally affected macOS host; packaged npm global install reproduction end-to-end.
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
agents.defaults.agentRuntimeparses, while retiredagentRuntime.fallbackis rejecteddoctor fixcheck for non-exitfallbackcontractReview Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations