Repository navigation
refactor(acp): consolidate scalar runtime option validation - #157446
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 changes before merge. Reviewed September 24, 2026, 4:39 PM ET / 20:39 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch replaces six repeated ACP runtime-option checks with a private setter and adds tests for existing validation, clearing, ordering, and timeout behavior. Merge readiness⛔ Needs changes before merge - 2 items remain The cleanup is still absent from current main, and the refactor appears to preserve existing behavior. The prior request to report hosted CI time for the expanded test file remains unresolved. Priority: P3 Review scores
Verification
How this fits togetherThe ACP control plane receives session-start options and runtime-control requests. It validates and merges those options before storing session metadata and applying controls to a backend. flowchart LR
A[Session start or ACP command] --> B[Runtime option patch]
B --> C[Validate scalar options]
C --> D[Merge session options]
D --> E[Session metadata]
E --> F[Backend controls and turns]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -27, Tests +116. Total +89 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one private ACP scalar-validation policy with the existing observable option behavior covered, and include scoped hosted CI timing in the PR record. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses duplicated implementation, not a reported failing behavior. The current-main and PR source give a direct comparison of the validation path. Is this the best way to solve the issue? Yes: the private setter removes repeated scalar handling while retaining explicit field order and existing backend-extras handling. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4a9b2de1988d. 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 (2 earlier review cycles) |
* commit 'a0905dfe5c17053a3f0ef2aa0cf8f421bce9381c': (75 commits) fix: preserve conversation titles across split-pane agent switches (#157482) test(gateway): settle resumed work before checking announcement fix(update): avoid socket-arrival assumptions in deadline tests (#157504) fix(ci): include Android Access in release coordination refactor: share LINE message context test fixtures (#157488) refactor(matrix): reuse startup verification account key (#157310) perf(config): avoid repeated environment scans during publication (#156457) chore(i18n): refresh native locales (#157495) fix(update): show quiet step progress and date recorded outcomes (#153407) feat(gateway): preserve browser sign-in requirements before connecting (#157454) test(scripts): await CLI admission fixture lifetimes (#157424) fix(ci): preserve consumer selection across core type stripes (#157373) fix(wizard): preserve typed plugin enum values (#127577) (#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (#157458) test: prebuild run-node signal fixture (#157478) refactor(exec): reuse approval policy rule keys (#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (#157365) fix(config): apply Gateway writes without waiting for file events (#157372) fix: count recorded nested tool operations once (#157438) ...
|
Merged via squash.
|
…#157446) * refactor(acp): consolidate scalar runtime option validation * chore: merge main for ACP validation * commit 'a2532ef8d2eb80fd2fd391ef7ea645c051f8be9c': (75 commits) fix: preserve conversation titles across split-pane agent switches (openclaw#157482) test(gateway): settle resumed work before checking announcement fix(update): avoid socket-arrival assumptions in deadline tests (openclaw#157504) fix(ci): include Android Access in release coordination refactor: share LINE message context test fixtures (openclaw#157488) refactor(matrix): reuse startup verification account key (openclaw#157310) perf(config): avoid repeated environment scans during publication (openclaw#156457) chore(i18n): refresh native locales (openclaw#157495) fix(update): show quiet step progress and date recorded outcomes (openclaw#153407) feat(gateway): preserve browser sign-in requirements before connecting (openclaw#157454) test(scripts): await CLI admission fixture lifetimes (openclaw#157424) fix(ci): preserve consumer selection across core type stripes (openclaw#157373) fix(wizard): preserve typed plugin enum values (openclaw#127577) (openclaw#138090) fix(qa): title mock Code Mode fixture calls refactor: simplify SQLite worker lifecycle and test fixtures (openclaw#157458) test: prebuild run-node signal fixture (openclaw#157478) refactor(exec): reuse approval policy rule keys (openclaw#157198) fix(ci): reuse prepared runtime for changed-target E2E shards (openclaw#157365) fix(config): apply Gateway writes without waiting for file events (openclaw#157372) fix: count recorded nested tool operations once (openclaw#157438) ... Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
ACP runtime-option patch validation repeats own-property checks, explicit-clear handling and validation assignments for six scalar fields. This cleanup gives that private policy one implementation while keeping field order explicit.
User Impact
No intended user-visible change. Missing and inherited fields remain omitted; an own
undefinedstill clears an option. Unknown keys fail first, scalar errors retain their order, rounded timeout bounds stay unchanged, and backend extras keep their separate handling. No public API, configuration, stored-data, schema, migration or backend protocol changes.Why This Change Was Made
Maintainer scope: I explicitly request this specific ACP scalar runtime-option validation consolidation as an active deliverable in my 40-PR code-sloppiness reduction campaign and accept its standalone scope. One private typed setter replaces six repeated blocks; six ordered calls retain the existing validators. Production +13/-40 (net -27); tests +117/-1 (net +116).
The signed head
eeb5bde429aa182bd824006fc1c5f405fcc7fd9bpreserves the prior head's ancestry and integrates frozen maina0905dfe5c17053a3f0ef2aa0cf8f421bce9381c. Its two-file proposal is byte-identical to the previously reviewed patch. This integration includes the separately landed CLI readiness-test assertion repair; the prior head's CI failed that unrelated test. No production timeout or budget change was added here, and the historical scheduling trigger is not claimed proven.Evidence
check:changedpassed all 31 selected stages, including core production types, all 25 selected core test type graphs, formatting/lint and the selected static guards. All 49,475 bound tracked inputs and final source identity matched; remote/local exit 0, EOF and exact lease shutdown were verified.codex-rs/app-server-protocol/src/protocol/v2/thread.rs:62–159,turn.rs:156–280,codex-rs/protocol/src/config_types.rs:700–798, andprotocol.rs:975–1050. Local patch clearing is not equated with Codex wire omission/null semantics.Current changed-file timing
The 37-case owner invocation,
pnpm test src/acp/control-plane/runtime-options.test.ts --maxWorkers=1, took 2.323293604 seconds monotonic whole-command wall time; Vitest reported 0.961 seconds. The other complete files took 27.468784484s (22 cases), 37.458826038s (5 cases), and 25.036918781s (6 cases). These separate command walls include transforms/setup and exclude provisioning/dependency installation.Environment: Linux x64, Node 24.19.0, pnpm 12.4.2. Install reported 0 packages reused and 1,453 downloaded; this does not establish universally cold caches. These measurements are descriptive file-process costs, not speedups, shared hosted job/step durations or estimates of incremental CI cost. The earlier isolated 2.070461641s owner measurement belongs to the prior head and remains historical evidence.
Observed hosted CI timing
The accepted exact-head hosted job,
checks-node-changed-compact-large-12, passed the owner's 37 cases in the Buncore-unit-fast-1-hosted-2group. That shared group selected 215 files (214 passed, 1 skipped): Vitest reported 59.06s, and its group wrapper took 60.88s including harness work. The enclosingRun Node test shardstep ran 372s across five groups (20:37:57–20:44:09 UTC on September 24, 2026); the whole job took 411s (20:37:22–20:44:13 UTC), including setup/cleanup and excluding its prior queue. The step excludes checkout (10s), Node/dependency setup (17s, cache hit), and Bun setup (5s). API durations have one-second precision.These are observed shared group/step/job costs, not isolated runtime-options file time, incremental PR cost or a speedup. The accepted run tested this head through merge
d6c56846602831078138124e442e07d87de21167. A Bun directory-mismatch diagnostic appeared after the group summary; the wrapper exited 0 and the job passed. No cause or retry is inferred from that diagnostic. This disclosure addresses both timing items in ClawSweeper revision 3; the source head is unchanged.Limits: manager fixtures mock backend/session metadata; no live ACP/provider request or full build is claimed. External proof-portal timeouts and an unavailable staging-discovery cursor were retained, not reported as successful portal publication or cleanup. Exact-head hosted CI and required status checks passed. The latest exact-head ClawSweeper review requested the timing disclosure above and reported no behavior or security findings. Native landing safeguards remain required; pending native publication receipts are not passing CI evidence.