Skip to content

fix(agents): keep exact model transports in harness selection - #147849

Merged
steipete merged 1 commit into
mainfrom
codex/harness-exact-row-20260913
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/harness-exact-row-20260913

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #130706, #143822.

What Problem This Solves

Fixes: a registered harness can reject an otherwise supported configured model because a legacy row supplies the wrong API or endpoint to its support check.

User Impact

User impact: harnesses receive transport and request-override facts from the selected model row. Exact IDs keep their provider defaults without inheriting unrelated legacy-row fields; literal legacy selections, legacy-only fallback, and same-spelling duplicates retain their existing behavior.

Why This Change Was Made

Harness support now uses the existing configured-row resolver, removing its separate prefix-stripping and normalized-row merge. Production code decreases by 14 lines. Existing configuration remains valid; no SDK, loader, updater, schema, or migration contract changes.

Evidence

  • The registered custom-harness baseline failed in both conflicting row orders, with seven controls passing. An earlier OpenAI policy-only probe passed because that provider's route owner compensates; this is not a claim of a native Codex selection defect.
  • On df0c530a1aa469e36548e33bc0fa2e794852f57d, 203 focused tests, the full changed-file gate, independent P2 review, and one normal build passed.
  • Five fresh pnpm openclaw row-proof commands exercised real synthetic plugin registration and the existing public command-auth-native SDK. The selected runtime, API, endpoint, and override facts matched every case. All 50 recorded Node processes and their groups closed, persistent observed modules and 14,109 checked regular build files stayed unchanged, and temporary plugin output was captured before normal loader cleanup.
  • This proves compiled public CLI/SDK capability selection, not Gateway execution, provider HTTP, credentials, or inference. The normal source development launcher is recorded separately; actual CLI runtime processes reject product TypeScript imports and run under verified network denial. Earlier instrumentation attempts remain diagnostic evidence; no product change or build retry was used to make the final proof pass.

Keep API, endpoint, and request override facts tied to the selected configured model. Reuse the existing configured-row resolver and remove duplicate prefix stripping and normalized-row merging from harness support.

Preserve literal legacy selection, legacy-only fallback, and same-spelling duplicate semantics. Registered-harness regressions fail in both conflicting row orders before the fix; 203 focused tests, the changed-file gate, and independent review pass.

Related: #130706, #143822.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@steipete
steipete marked this pull request as ready for review September 14, 2026 04:17
@clawsweeper

clawsweeper Bot commented Sep 14, 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 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 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 12:24 AM ET / 04:24 UTC.

ClawSweeper review

What this changes

The PR makes agent runtime selection use the exact configured model’s transport settings, adds registered-harness regression coverage, and documents row precedence.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main still combines conflicting model rows when building harness support facts. No actionable defect was found in the introduced patch.

Priority: P2
Reviewed head: df0c530a1aa469e36548e33bc0fa2e794852f57d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-reuse repair with meaningful registered-harness coverage and no identified correctness or security blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled CLI/SDK runs exercising the changed support-selection owner across five row configurations; those claims cover selection, not provider I/O or inference, and were not rerun here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled CLI/SDK runs exercising the changed support-selection owner across five row configurations; those claims cover selection, not provider I/O or inference, and were not rerun here.
Evidence reviewed 7 items Introduced repair: The complete introduced diff replaces prefix stripping and normalized-row merging with the existing configured-row resolver; the test rename preserves the subscription-selection cases.
Current-main necessity: Fetched main still uses resolveMergedModelProviderModels with prefix-normalized keys in harness support. A legacy row can therefore supply an endpoint or API belonging to a different spelling. The latest-release source read failed during object retrieval, so no shipped-fix claim is made.
Existing selection owner: The shared resolver prefers literal rows, merges only same-spelling duplicates, preserves provider-declared equivalents, and uses legacy self-provider rows as a final fallback. Request-override detection already uses this resolver.
Findings None None.
Security None None.

How this fits together

OpenClaw selects an agent runtime by asking registered harnesses whether they support the chosen provider and model. The support context supplies API, endpoint, and request-override facts that determine whether a plugin runtime or the embedded runtime handles the request.

flowchart TD
  A[Provider and model configuration] --> B[Configured model row resolver]
  C[Prepared route facts] --> D[Harness support context]
  B --> D
  D --> E[Registered harness support checks]
  E --> F[Selected plugin runtime]
  E --> G[Embedded runtime]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -14, Tests +84, Docs +4. Total +74 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 19 -14
Tests 1 85 1 +84
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 94 20 +74

Review metrics

None.

Technical review

Best possible solution:

Keep harness transport and request-override facts tied to the existing configured-row owner, preserving literal selection, legacy fallback, and duplicate semantics.

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

Yes, from source: configure exact and legacy-prefixed rows with conflicting transport fields and register a harness that supports only the exact route. Current main merges those rows; the added tests exercise both orders. No runtime reproduction was executed here.

Is this the best way to solve the issue?

Yes. Reusing the resolver already responsible for request-override selection removes the competing selection rule without changing its public contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Conflicting configured model rows can incorrectly reject a supported harness; this is a bounded runtime-selection repair.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled CLI/SDK runs exercising the changed support-selection owner across five row configurations; those claims cover selection, not provider I/O or inference, and were not rerun here.

Label justifications:

  • P2: Conflicting configured model rows can incorrectly reject a supported harness; this is a bounded runtime-selection repair.
  • 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 supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. Its body reports compiled CLI/SDK runs exercising the changed support-selection owner across five row configurations; those claims cover selection, not provider I/O or inference, and were not rerun here.

Evidence

What I checked:

  • Introduced repair: The complete introduced diff replaces prefix stripping and normalized-row merging with the existing configured-row resolver; the test rename preserves the subscription-selection cases. (src/agents/harness/support.ts:121, df0c530a1aa4)
  • Current-main necessity: Fetched main still uses resolveMergedModelProviderModels with prefix-normalized keys in harness support. A legacy row can therefore supply an endpoint or API belonging to a different spelling. The latest-release source read failed during object retrieval, so no shipped-fix claim is made. (src/agents/harness/support.ts:122, 28dd17e8a15e)
  • Existing selection owner: The shared resolver prefers literal rows, merges only same-spelling duplicates, preserves provider-declared equivalents, and uses legacy self-provider rows as a final fallback. Request-override detection already uses this resolver. (src/config/model-provider-config.ts:45, df0c530a1aa4)
  • Behavioral regression coverage: Five added cases exercise registered runtime selection: both conflicting row orders, legacy-only fallback, literal legacy selection, and same-spelling duplicates. Existing subscription and explicit-profile rejection coverage remains intact. Tests were inspected but not executed in this read-only review; the PR body reports 203 focused tests passing. (src/agents/harness/provider-route-selection.test.ts:81, df0c530a1aa4)
  • Related merged work: fix(models): use exact configured rows before aliases #143822 introduced exact configured-row selection while explicitly preserving normalized-index consumers for later migration. Its supplied merged metadata and recorded commit message support this PR as a distinct consumer repair. fix: prevent Gateway stalls with multiple workspaces #130706 is closed unmerged and is broader historical context, not a replacement. (src/config/model-provider-config.ts, 341932a8ef40)
  • Proof scope and dependency boundary: The captured PR body reports five compiled public CLI/SDK selection runs at the reviewed head with matching runtime, API, endpoint, and override facts. It expressly excludes inference and native Codex behavior. The introduced custom-harness cases depend on OpenClaw’s registry and resolver, not Codex’s protocol or implementation; unchanged Codex-named fixtures do not establish a dependency gate. (src/agents/harness/provider-route-selection.test.ts:112, df0c530a1aa4)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@steipete
steipete merged commit 5697a72 into main Sep 14, 2026
262 checks passed
@steipete
steipete deleted the codex/harness-exact-row-20260913 branch September 14, 2026 04:59
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit 'e3d8d0078369b21223c70028c4502c89f1420897': (51 commits)
  fix: background requests delay opening chats (#147845)
  chore(i18n): refresh native locales (#147899)
  feat: start remote sessions without a repository (#147773)
  fix(slack): retire probe sockets after timeout (#147846)
  refactor(agents): share theme ANSI color encoding (#147838)
  improve(memory): bound vector recall decision counts (#147900)
  improve(browser): narrow dashboard lifetime rechecks (#147892)
  test(discord): compact lifecycle matrices (#147855)
  fix(agents): use exact model rows for harness support (#147849)
  test(agents): compact embedded lifecycle matrices (#147856)
  test(agents): compact embedded admission matrices (#147853)
  test(cli): compact node management matrices (#147854)
  feat(artifacts): select assistant-delivered files by run (#147682)
  improve: reduce event-loop work when recording prompts (#147876)
  fix: preserve readable generated image and video filenames (#147833)
  fix(ci): skip SDK rendering for identical revisions (#147572)
  fix: prevent false process failures and stalled background waits (#147871)
  fix(ui): restore live updates when retrying chat history (#147865)
  fix(ui): preserve text and image order in assistant replies (#147731)
  refactor(qa-lab): reuse approval result formatter (#147867)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Keep API, endpoint, and request override facts tied to the selected configured model. Reuse the existing configured-row resolver and remove duplicate prefix stripping and normalized-row merging from harness support.

Preserve literal legacy selection, legacy-only fallback, and same-spelling duplicate semantics. Registered-harness regressions fail in both conflicting row orders before the fix; 203 focused tests, the changed-file gate, and independent review pass.

Related: openclaw#130706, openclaw#143822.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation 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: 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