Skip to content

fix(models): select authored rows before applying defaults - #144034

Merged
steipete merged 1 commit into
mainfrom
codex/config-owned-model-rows-main
Sep 10, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/config-owned-model-rows-main

Conversation

@steipete

@steipete steipete commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #130706, #142100. Follows #143967.

What Problem This Solves

Config defaults can collapse an alias into an exact destination after filling its omitted capabilities, allowing the alias row to contaminate the selected row. Later planning cannot recover which fields were authored.

Why This Change Was Made

Reuse the planner's existing row-selection algorithm in the config owner, before capability defaults. Remove the later repeated ID normalization and let the planner delegate to the shared pure helper. Exact destinations retain their omissions and same-spelling duplicate costs retain their existing merge semantics. This adds 16 production lines; sparse capability inheritance and runtime pricing remain separate follow-ups.

User Impact

The intended authored model row determines which fields are explicit before defaults or prepared runtime metadata are added.

Evidence

Five baseline failures and one control established the producer defect. The fresh-main replay passed 132 focused tests, six final fixture rechecks, independent P2 review with unchanged production context, and the full changed gate. A test-table type correction produced byte-identical JavaScript and unchanged assertions.

One normal full build at the tested commit and 18 compiled cases passed: six config/defaults-to-inline/runtime cases and 12 planner/registry controls. All 11,929 root/workspace output files remained unchanged; the proof loaded no checkout TypeScript and made no HTTP or catalog rediscovery calls. All owned processes joined. This is compiled producer/planner proof, not an upstream-provider request.

Tested commit: 0ffd387049b04c07dda65f61f68684548105ca36.

CI refresh: the unchanged authored-row patch is replayed onto main eb9f4ff537c01eed0596bf0949f40be0d5b16e9f, including the separate session-fixture cleanup in #144087 identified during the TaskFlow CI investigation. Every changed-file postimage and the stable task patch match 5b6b4ffc04f538feb334186e54aac03eab375fa6. Original exact-commit runtime proof is preserved without restamping; fresh CI is required for eb90eba9303c5eae8e7d1972bbb21a600077934a. #144087 documents the historical causal limit.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 10, 2026
@steipete
steipete marked this pull request as ready for review September 10, 2026 12:31
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 10:18 AM ET / 14:18 UTC (Revision 3).

ClawSweeper review

What this changes

Selects configured model rows before filling omitted capabilities and costs, sharing the existing selection algorithm between config loading and catalog planning.

Merge readiness

✅ Ready for maintainer review

This focused fix remains necessary: current main still fills defaults before selecting competing authored rows. No blocking correctness findings were identified, and the rebased files match the previous reviewed revision.

Priority: P2
Reviewed head: eb90eba9303c5eae8e7d1972bbb21a600077934a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with meaningful regression coverage, preserved review continuity, and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change. Its recorded compiled scenarios exercise defaults through inline/prepared models and planner controls at the original tested commit; they are not upstream-provider proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change. Its recorded compiled scenarios exercise defaults through inline/prepared models and planner controls at the original tested commit; they are not upstream-provider proof.
Evidence reviewed 9 items Current-main defect remains: Current main normalizes and defaults each configured row independently, leaving aliases and exact destinations to collide downstream; it does not perform the earlier selection introduced here.
Shared selection preserves authored precedence: The extracted helper retains the existing planner algorithm: merge same-spelling rows, prefer an exact destination over aliases, preserve omissions, and return unchanged objects when possible. Config defaults now invoke it before filling metadata.
Existing documented contract and merged history: The documented contract gives exact destinations ownership of their fields without donations from aliases. GitHub identifies #143967 as the merged catalog-planning prerequisite; its commit adds this documentation but does not fix the earlier config-defaults boundary.
Findings None None.
Security None None.

How this fits together

OpenClaw turns operator-authored provider and model configuration into runtime model definitions. Row selection determines which model supplies capabilities, limits, and pricing before those definitions reach agent execution.

flowchart LR
  A[Authored model rows] --> C[Select exact destination]
  B[Provider alias policies] --> C
  C --> D[Fill omitted model defaults]
  D --> E[Inline runtime models]
  E --> F[Prepared agent models]
  C --> G[Provider catalog planning]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +16, Tests +165. Total +181 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 82 66 +16
Tests 1 165 0 +165
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 247 66 +181

Review metrics

Metric Value Why it matters
Production growth justification Production net +16 lines; tests +165 lines The small production increase moves an existing algorithm into a shared owner and applies it at the earlier config boundary.

Root-cause cluster

Relationship: canonical
Canonical: #144034
Summary: This PR owns the focused config-defaults extraction from the broader model-selection campaign.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep authored-row selection in one shared owner before default materialization, preserving explicit values and leaving sparse catalog inheritance to its separately tracked work.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the path: configure an alias alongside its sparse exact destination, apply defaults, then build inline runtime models. Current main loses row distinctions before selection; this review did not execute the reproduction.

Is this the best way to solve the issue?

Yes. Reusing the planner's existing selection algorithm at the config producer repairs the ordering defect without creating competing selection policy or changing stored configuration formats.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d9f1f50e074b.

Labels

Label justifications:

  • P2: Repairs incorrect capabilities and pricing for configured alias collisions without evidence of a widespread urgent outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate and introduces no material authority change. Its recorded compiled scenarios exercise defaults through inline/prepared models and planner controls at the original tested commit; they are not upstream-provider proof.

Evidence

What I checked:

  • Current-main defect remains: Current main normalizes and defaults each configured row independently, leaving aliases and exact destinations to collide downstream; it does not perform the earlier selection introduced here. (src/config/defaults.ts:228, d9f1f50e074b)
  • Shared selection preserves authored precedence: The extracted helper retains the existing planner algorithm: merge same-spelling rows, prefer an exact destination over aliases, preserve omissions, and return unchanged objects when possible. Config defaults now invoke it before filling metadata. (src/config/model-provider-rows.ts:16, eb90eba9303c)
  • Existing documented contract and merged history: The documented contract gives exact destinations ownership of their fields without donations from aliases. GitHub identifies fix(models): resolve authored catalog aliases once #143967 as the merged catalog-planning prerequisite; its commit adds this documentation but does not fix the earlier config-defaults boundary. Public docs: docs/concepts/models.md. (docs/concepts/models.md:403, 11a267dd8a4b)
  • Regression coverage exercises production composition: Six cases pass raw config through validation, defaults, inline construction, and prepared runtime selection. They cover both alias orders, explicit capability values, partial duplicate costs, a single-row control, and source-config immutability. Existing planner tests separately cover chained aliases and emitted identities. Tests were inspected, not executed during this read-only review. (src/agents/prepared-model-runtime.inline-defaults.test.ts:42, eb90eba9303c)
  • Re-review continuity verified through file identities: GitHub contents reads at previous reviewed revision 5b6b4ff returned the same four blob hashes as the current checkout. Local comparison could not load that historical commit, so GitHub supplied the independent identity check. The previous review contained no findings. (eb90eba9303c)
  • Recorded compiled proof retains its original revision: The supplied PR body records five baseline failures, 132 focused tests, and 18 compiled producer/planner cases at 0ffd387. The compiled scenarios cover config/defaults-to-inline/runtime behavior and planner/registry controls; they explicitly claim no upstream-provider request. These are contributor-recorded results, not executions performed by this review. (0ffd387049b0)

Likely related people:

  • 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-10T12:37:29.014Z sha 0ffd387 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T13:24:07.814Z sha 5b6b4ff :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/config-owned-model-rows-main branch from 0ffd387 to 5b6b4ff Compare September 10, 2026 13:17
steipete added a commit that referenced this pull request Sep 10, 2026
Wait for each session fixture's native transcript reconciliation and state
cleanup before deleting its temporary directory. Attempt all owned roots,
retain failed cleanup state, and preserve the existing test assertions.

Related: #144034
Preserves the session regression coverage from #137381 by @jalehman.
Reuse one pure row materializer for config defaults and catalog planning.
Select the exact destination before generic defaults obscure omissions,
so aliases cannot donate capabilities, names, or limits to a sparse row.
Preserve same-spelling cost merges and each caller's bound normalizer.

Validation: 132 focused tests, six fixture cases after a type-only fix,
full check:changed, and managed P2 review of the prerequisite composition.
@steipete
steipete force-pushed the codex/config-owned-model-rows-main branch from 5b6b4ff to eb90eba Compare September 10, 2026 14:11
@steipete
steipete merged commit 2872da6 into main Sep 10, 2026
181 of 183 checks passed
@steipete
steipete deleted the codex/config-owned-model-rows-main branch September 10, 2026 15:03
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
)

Wait for each session fixture's native transcript reconciliation and state
cleanup before deleting its temporary directory. Attempt all owned roots,
retain failed cleanup state, and preserve the existing test assertions.

Related: openclaw#144034
Preserves the session regression coverage from openclaw#137381 by @jalehman.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
)

Reuse one pure row materializer for config defaults and catalog planning.
Select the exact destination before generic defaults obscure omissions,
so aliases cannot donate capabilities, names, or limits to a sparse row.
Preserve same-spelling cost merges and each caller's bound normalizer.

Validation: 132 focused tests, six fixture cases after a type-only fix,
full check:changed, and managed P2 review of the prerequisite composition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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