Skip to content

refactor(agents): move live model policy to test owner - #129184

Merged
steipete merged 2 commits into
mainfrom
codex/cleanup20k-agents-live-model-owner-20260825
Aug 25, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/cleanup20k-agents-live-model-owner-20260825

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Live model validation policy lived in a 453-line production-classified agent module despite having no shipped runtime, package, SDK, or public consumers. Its only callers were live/unit tests and their change-classification fixtures.

Why This Change Was Made

Delete the unused production module and consolidate the still-valuable live-provider selection policy into its existing test-support owner. Update real direct agent/Gateway tests, truthful live-testing documentation, and existing CI planner fixtures without weakening classification.

User Impact

No production behavior or shipped public contract changes. Production code decreases by 453 lines; test-support grows 269 lines while the complete change still removes 184 lines. Existing provider priorities, owner exclusions, spread, caps, overrides, lazy preparation, and fail-safe CI planning remain unchanged.

Evidence

  • The focused agent/Gateway owner suites passed 118 tests before the move and 122 tests after it.
  • Existing CI change-planner coverage passed 49 actual tests.
  • Targeted owner lint, formatting, and whitespace validation passed.
  • Independent source review accepted the complete owner-boundary change, and fresh structured autoreview reported no actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 09:21
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 5:48 AM ET / 09:48 UTC.

ClawSweeper review

What this changes

Moves live-model selection policy into the dynamic live-candidate test helper, removes its standalone module, and updates live-test imports, documentation, and CI-planner expectations.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: current main still keeps the policy in the standalone module, while this PR removes that test-only duplicate and repoints all known test consumers. No blocking defect was found; the protected maintainer label, behind base, and incomplete exact-head CI require maintainer review before merge.

Priority: P3
Reviewed head: dcb284029decb55553ff2032e113be9b22c8a181
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The policy move is coherent and preserves the direct-agent and Gateway test call paths; a current-main refresh and exact-head CI remain needed.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, non-user-facing refactor has no separate external-contributor proof requirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, non-user-facing refactor has no separate external-contributor proof requirement.
Evidence reviewed 6 items Current-main owner and callers: Current main still defines the full live-model policy in the standalone module; its tracked references are documentation and test files, including direct-agent and Gateway live suites, rather than shipped runtime consumers.
Equivalent test-owner consolidation: The PR-head helper contains the priority lists, filtering, provider-exclusion, selection, and cap logic, while both direct-agent and Gateway live tests import that one helper.
Test-owner boundary: Current main's dynamic candidate helper already owns candidate expansion and imports only the prioritized-list function from the standalone policy module; moving the remaining policy there removes that one test-support dependency.
Findings None None.
Security None None.

Live Verification

Command: pnpm test src/agents/live-model-filter.test.ts src/agents/live-model-dynamic-candidates.test.ts src/agents/model-compat.test.ts

Result: PASS (completed)

pnpm test src/agents/live-model-filter.test.ts src/agents/live-model-dynamic-candidates.test.ts src/agents/model-compat.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129184-BDQ4y2/target$ pnpm test src/agents/live-model-filter.test.ts src/agents/live-model-dynamic-candidates.t
est.ts src/agents/model-compat.test.ts
$ node --import tsx scripts/test-projects.mts src/agents/live-model-filter.test.ts src/agents/live-model-dynamic-candidates.test.ts src/agents/model-compat.test
.ts
pnpm test src/agents/live-model-filter.test.ts src/agents/live-model-dynamic-candidates.test.ts src/agents/model-compat.test.ts
[test] starting test/vitest/vitest.unit-fast.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129184-BDQ4y2/target

 ✓  unit-fast  src/agents/live-model-filter.test.ts (8 tests) 4ms

 Test Files  1 passed (1)
      Tests  8 passed (8)
   Start at  09:49:32
   Duration  7.08s (transform 5.67s, setup 76ms, import 6.89s, tests 4ms, environment 0ms)

[test] starting test/vitest/vitest.agents-core.config.ts

































Assertions:

  • PASS expect_output: Test Files

How this fits together

Opt-in direct-agent and Gateway live tests select and cap provider models through shared policy before running real provider checks. This refactor makes the dynamic candidate helper own that test-only policy and feeds the same selected candidates into both test suites.

flowchart LR
  A[Live test settings] --> B[Model selection policy]
  C[Configured provider models] --> B
  B --> D[Direct agent live tests]
  B --> E[Gateway live tests]
  D --> F[Provider validation]
  E --> F
Loading

Decision needed

Question Recommendation
After a current-main refresh and green exact-head checks, should this maintainer-owned refactor replace the standalone policy module with the test-helper owner? Accept the test-helper owner: Keep the consolidated policy after the branch is refreshed and exact-head validation passes.

Why: The protected maintainer label routes this ownership-boundary cleanup to an explicit maintainer decision even though source review found no correctness blocker.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main and exact-head CI is still incomplete, so the final three-way merge and validation result remain unproven.
Agent review details

Security

None.

PR surface

Source -185, Tests +1, Docs 0. Total -184 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 2 269 454 -185
Tests 5 35 34 +1
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 306 490 -184

Review metrics

Metric Value Why it matters
Production versus test-support LOC production -453; test support +268; tests +1; docs 0 net The branch removes the standalone policy implementation and preserves its behavior in the existing test-support owner.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or refresh against current main, retain one policy implementation in the test helper, and land only after exact-head checks confirm the move remains behavior-neutral.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or refresh against current main, retain one policy implementation in the test helper, and land only after exact-head checks confirm the move remains behavior-neutral.

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

Not applicable: this PR refactors test-support ownership rather than reporting a user-observable failure.

Is this the best way to solve the issue?

Yes: current-main references show this policy is consumed by docs and test suites, and consolidating it into the existing candidate helper removes the standalone test-only owner without adding a parallel path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a behavior-neutral test-ownership cleanup with no user-facing contract change.
  • 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: This maintainer-authored, non-user-facing refactor has no separate external-contributor proof requirement.

Evidence

What I checked:

  • Current-main owner and callers: Current main still defines the full live-model policy in the standalone module; its tracked references are documentation and test files, including direct-agent and Gateway live suites, rather than shipped runtime consumers. (src/agents/live-model-filter.ts:1, ef7b6653a89d)
  • Equivalent test-owner consolidation: The PR-head helper contains the priority lists, filtering, provider-exclusion, selection, and cap logic, while both direct-agent and Gateway live tests import that one helper. (src/agents/test-helpers/live-model-dynamic-candidates.ts:25, dcb284029dec)
  • Test-owner boundary: Current main's dynamic candidate helper already owns candidate expansion and imports only the prioritized-list function from the standalone policy module; moving the remaining policy there removes that one test-support dependency. (src/agents/test-helpers/live-model-dynamic-candidates.ts:19, ef7b6653a89d)
  • Documentation alignment: The PR updates both testing-guide references to the new source of truth, matching the relocated policy. Public docs: docs/help/testing-live.md. (docs/help/testing-live.md:80, dcb284029dec)
  • Current-main provenance: Blame attributes the current standalone policy and existing dynamic-helper import to commit 063fcaf; that source remains on current main, so this PR is not implemented or superseded there. (src/agents/live-model-filter.ts:18, 063fcaf89e25)
  • Validation limitation: The required docs-list command could not run because Corepack attempted to create its cache on the read-only filesystem; no repository file was modified.

Likely related people:

  • vincentkoc: Current-main blame attributes both the standalone policy and its dynamic-helper dependency to commit 063fcaf. (role: recent area contributor; confidence: medium; commits: 063fcaf89e25; files: src/agents/live-model-filter.ts, src/agents/test-helpers/live-model-dynamic-candidates.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the branch against current main and wait for the exact-head checks to complete.

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 (1 earlier review cycle)
  • reviewed 2026-08-25T09:28:26.513Z sha e46e1cf :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 25, 2026
@steipete
steipete merged commit 33d8f24 into main Aug 25, 2026
167 checks passed
@steipete
steipete deleted the codex/cleanup20k-agents-live-model-owner-20260825 branch August 25, 2026 10:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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