Skip to content

refactor(acp): consolidate scalar runtime option validation - #157446

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/acp-runtime-option-patch-20260924
Sep 24, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/acp-runtime-option-patch-20260924

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

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 undefined still 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 eeb5bde429aa182bd824006fc1c5f405fcc7fd9b preserves the prior head's ancestry and integrates frozen main a0905dfe5c17053a3f0ef2aa0cf8f421bce9381c. 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

  • Fresh proof at the signed head passed 70 tests across four complete files: runtime-options 37, manager runtime-config 22, initialize-session 5, runtime-config-validation 6. Each file ran once with one worker. Characterization covers all six fields, normalization/errors, missing/inherited/own-undefined values, property reads, input immutability, error precedence and fractional timeout boundaries. Current proof run.
  • Canonical two-file check:changed passed 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.
  • Fresh independent source/proof review and whole-candidate P0–P3 automated review found no actionable findings. Current acpx 0.19.1 source and the unchanged backend adapter were inspected. Direct Codex inspection at be2951ea covered 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, and protocol.rs:975–1050. Local patch clearing is not equated with Codex wire omission/null semantics.
  • Historical evidence remains separate: the earlier same-characterization 70 baseline / 70 candidate pair passed before a formatting-only failure. After the exact oxfmt-only test delta was verified, separate formatting/lint passed. Historical pair · Historical static checks. The baseline pair was not replayed for this refresh.

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 Bun core-unit-fast-1-hosted-2 group. 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 enclosing Run Node test shard step 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.

@vincentkoc vincentkoc self-assigned this Sep 24, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 24, 2026 17:33
@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 24, 2026, 4:39 PM ET / 20:39 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: eeb5bde429aa182bd824006fc1c5f405fcc7fd9b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused refactor and contract coverage are sound; a small required CI-cost disclosure remains.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This member-authored internal refactor is exempt from the external-contributor live-proof gate. The PR reports owner and sibling test runs for the changed validator; no stored-data format changes, so upgrade compatibility proof is not applicable.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored internal refactor is exempt from the external-contributor live-proof gate. The PR reports owner and sibling test runs for the changed validator; no stored-data format changes, so upgrade compatibility proof is not applicable.
Evidence reviewed 10 items Introduced production change: The pinned PR delta replaces six ordered scalar blocks with one private setter and six calls; backend extras remain in their existing path.
Contract tests: The added cases check normalization, validation errors, omitted versus own-undefined fields, error precedence, and rounded timeout bounds.
Current main still needs the cleanup: The fetched main revision retains the six repeated scalar checks; the consolidation is introduced by this PR.
Findings 1 actionable finding [P3] Report hosted CI time for the expanded test file
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Report hosted CI time for the expanded test file (P3) - The added cases materially expand this per-PR test file. Repository test policy asks for CI seconds once a run exists; the earlier head has a completed hosted CI run, while the PR body gives only command wall times and explicitly excludes hosted job or step duration. Please report an observed CI step or shard duration with its scope, without presenting the whole shard as this file’s incremental cost.
  • Complete next step (P2) - Add observed hosted CI step or shard seconds, clearly scoped, to the PR body before merge.

Findings

  • [P3] Report hosted CI time for the expanded test file — src/acp/control-plane/runtime-options.test.ts:10
Agent review details

Security

None.

PR surface

Source -27, Tests +116. Total +89 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 40 -27
Tests 1 117 1 +116
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 130 41 +89

Review metrics

Metric Value Why it matters
Production and test balance production net -27 lines; tests net +116 lines The helper removes repeated production policy while direct contract coverage grows.

Technical review

Best 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:

  • [P3] Report hosted CI time for the expanded test file — src/acp/control-plane/runtime-options.test.ts:10
    The added cases materially expand this per-PR test file. Repository test policy asks for CI seconds once a run exists; the earlier head has a completed hosted CI run, while the PR body gives only command wall times and explicitly excludes hosted job or step duration. Please report an observed CI step or shard duration with its scope, without presenting the whole shard as this file’s incremental cost.
    Confidence: 0.92

Overall correctness: patch is correct
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4a9b2de1988d.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a bounded internal cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored internal refactor is exempt from the external-contributor live-proof gate. The PR reports owner and sibling test runs for the changed validator; no stored-data format changes, so upgrade compatibility proof is not applicable.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-24T17:41:11.363Z sha d7b3624 :: needs changes before merge. :: [P3] Report the changed test file's measured cost
  • reviewed 2026-09-24T18:10:26.326Z sha d7b3624 :: needs changes before merge. :: [P3] Report hosted CI timing for the expanded test file

* 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)
  ...
@vincentkoc
vincentkoc merged commit 688c3e9 into main Sep 24, 2026
215 checks passed
@vincentkoc
vincentkoc deleted the refactor/acp-runtime-option-patch-20260924 branch September 24, 2026 21:22
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
…#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant