Skip to content

refactor(cli): reuse validated inputs and private setup rows - #176805

Merged
steipete merged 3 commits into
mainfrom
dbasync/defcode2-cli-inputs
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
dbasync/defcode2-cli-inputs

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Command handlers repeat parser decisions, and setup deep-clones an entire agent roster to update one workspace field.

User Impact

No intended change to CLI options, invalid-input refusal, TTS fallback selection, or persisted setup data.

Why This Change Was Made

Use the resolved TTS provider to decide whether fallback is disabled: every accepted explicit provider/model/voice selection already produces that provider, and unsupported selections throw. Let the existing string normalizer validate the prompt and normalize the Commander thinking string once, keeping explicit blank/invalid rejection.

Setup now changes the selected workspace on the canonical roster converter’s private output. The converter already copies every top-level row, preserving caller-owned input and nested values without a whole-roster deep clone or a second projection; no nested field is mutated. Include provenance, stale-write protection, and migration calls stay unchanged.

Evidence

Production: 11 additions / 23 deletions, net -12 lines; tests: 22 additions / 14 deletions, net +8 lines. Changed-file formatting, type-aware lint, line-cap ratchet, and diff checks pass. Two isolated Codex P0/P1 reviews are scoped-clean, including the final test-fixture extraction and full source verification.

Final head 46f881a919b2aa288bab11757b0b805852a4975e: ordinary CI 39189640804 finished with 31 successful jobs and 28 skips. Owner tests, production types, core test types, lint, source contracts, Madge, and T1/dialect/worker ratchets pass. The only failing check is extension test types (plus the aggregate gate): job 117859986930 reports TS2353 for completionDeliveryRetryDelaysMs in the untouched native-subagent-monitor.parent-retention.test.ts:37. Current main 8401410da6b46153386d9100d970c98659749e9e independently reproduces the exact diagnostic in run 39190189076 / job 117861351867.

Final-head Knip job 117859681913 adds zero findings: the unused TaglineMode export matches main job 117857507393, and the unused spawn-diagnostics.test-support.ts file matches main job 117850679944. The first main job emitted its diagnostic before later cancellation; it is diagnostic evidence, not a completed baseline pass. Optional supplemental UI translation/performance checks also failed; neither is claimed passing or inherited. The supplemental run was canceled after required evidence was collected.

CI caught literal-type widening in the proposed file-provider mode simplification; that deletion was dropped by restoring the exact base code. The final production diff is a subset of the reviewed diff. Main was integrated to pick up its sidebar-build repair; all five reviewed file blobs stayed identical, and the frozen install passed. Existing capability/CLI parser and setup tests cover accepted and rejected inputs. Two blank-thinking cases extend the existing invalid-input table, which moves to the existing test harness to keep the oversized test file shrinking; every assertion remains unchanged.

No SQL, schema, transaction, worker request, or public SDK change is intended. SQL/requests/MAIN delta: estimated 0/0/0, unmeasured; no latency claim. Workload measurement is deferred under the campaign policy after the previously observed SSD rename stalls. Setup retains its existing migration calls and final config-write owner; this patch changes only local roster construction.

Candidate ledger

Candidate Category Decision Reason
C13299 b REMOVE Resolved TTS overrides already carry provider for every nonblank provider/model/voice selection; resolver throws if model/voice lacks a provider. Replace the raw re-normalization expression with Boolean(overrides.provider).
C15853 f REMOVE The canonical roster converter already creates private top-level rows. Change the selected workspace there instead of deep-cloning the input roster; legacy list entries may be caller-owned.
C13297 c REMOVE The private Commander action declares --thinking without default, parseArg, env, or variadic conversion; only strings or undefined reach it. Normalize once, retaining the explicit-supplied invalid-level rejection.
Supplemental prompt check b REMOVE normalizeOptionalString already rejects non-string and blank inputs; preserve original prompt bytes.
Supplemental file-provider mode b KEEP CI proved the proposed object-spread rewrite widens the value to string. Retain the exact base literal-union expression; alternatives add code.
Provider env result guard c KEEP An input such as proto=x can leave the constructed object empty; input length does not establish output size.
Setup input copies f KEEP Legacy roster rows may belong to the caller; the canonical top-level row copies remain.
C13308 c KEEP Real CLI ingress: source is an untrusted string and must be narrowed to env/file/exec/store.
C13309 c KEEP Real file-secret reference ID validation; prior source parsing establishes source, not JSON-pointer syntax.
C13310 c KEEP Real positive-integer CLI parse failure; parseStrictPositiveInteger returns undefined on invalid input.
C13311 c KEEP Real file-provider mode ingress validation; the retained post-guard expression also supplies literal-union inference, see supplemental entry.
C13312 c KEEP Batch/patch SecretRef input is unknown; object shape validation precedes required string fields.
C13313 c KEEP JSON5 allows arrays and primitives; a config patch requires an object.

Preserve invalid and blank input refusal, explicit TTS fallback selection, and setup snapshot ownership while removing duplicate checks and a deep roster copy.
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T02:25:18.121761Z 46f881a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: S labels Oct 19, 2026
@steipete
steipete merged commit 8d4c9e0 into main Oct 19, 2026
209 of 290 checks passed
@steipete
steipete deleted the dbasync/defcode2-cli-inputs branch October 19, 2026 02:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…w#176805)

Use resolved TTS overrides and the existing prompt/thinking parsers instead of repeating their checks. Update setup workspaces through the canonical roster converter’s private rows, avoiding a whole-roster deep clone while preserving caller-owned data.

Keep explicit blank-thinking refusal, unsupported TTS selection errors, include provenance, migrations, and final config-write authority. No public CLI or persisted-data behavior change is intended.

Validation: focused owner CI, type-aware lint, contracts, Madge and ratchets; two scoped-clean Codex reviews. SQL/request/MAIN change is estimated zero and unmeasured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant