Skip to content

fix(models): report accurate limits in OpenRouter scans - #110855

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
mushuiyu886:fix/openrouter-scan-top-provider-limits
Aug 3, 2026
Merged

fix(models): report accurate limits in OpenRouter scans#110855
vincentkoc merged 1 commit into
openclaw:mainfrom
mushuiyu886:fix/openrouter-scan-top-provider-limits

Conversation

@mushuiyu886

@mushuiyu886 mushuiyu886 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What problem this solves

openclaw models scan read only OpenRouter's catalog-wide context and output
limits. When the primary provider published smaller limits under
top_provider, scan output could overstate the metadata used for display and
optional capability probes.

Canonical fix

  • Prefer positive safe-integer limits from top_provider.
  • Fall back independently to valid catalog-wide context_length,
    max_completion_tokens, and max_output_tokens.
  • Reuse the same precedence and validation already owned by
    extensions/openrouter/provider-catalog.ts.

top_provider describes OpenRouter's primary-provider configuration; it is not
a guarantee that every routed request will use one fixed provider.

No config, Plugin SDK, protocol, persistence, migration, or feature surface
changes.

Evidence

Exact rewritten head: d3c9ac59bbb95539d76b1dd06b58b130fa9bd74f

  • Real public no-key/no-probe scan proof:
    • Before: google/gemma-4-26b-a4b-it:free reported catalog context
      262144 and no completion cap.
    • Live OpenRouter metadata reported primary-provider context 131072 and
      completion cap 32768.
    • After: the same scan reported context 131072 and completion cap 32768.
  • Four focused suites: 51/51 passed.
  • Regression coverage includes provider precedence; zero, negative,
    fractional, unsafe, string, and null provider values; independent fallback;
    and max_output_tokens.
  • Scoped formatting, direct touched-file oxlint, and git diff --check: clean.
  • Autoreview on the patch-equivalent pre-rebase commit found no actionable
    issues; correctness confidence 0.99; TruffleHog clean.
  • The single commit is based on current main
    a67c52611e5768ffe89dc2c4eea0cea0e26e34e6.

Scope

Production delta: +10/-10 (net zero) in src/agents/model-scan.ts.
Tests add 102 lines.

Changelog not required: this corrects existing internal catalog normalization
without changing commands or configuration.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Jul 18, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 2:10 PM ET / 18:10 UTC.

ClawSweeper review

What this changes

The PR updates openclaw models scan to prefer valid OpenRouter top_provider context and completion limits, with valid catalog-wide fields as independent fallbacks.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

This PR remains necessary: current main still reads only catalog-wide OpenRouter limits, while the branch correctly normalizes valid top_provider limits first and retains independent catalog fallbacks. The exact-head patch matches the current OpenRouter provider-catalog owner pattern, protects probe construction from invalid numeric metadata, and has focused regression coverage; no blocking correctness or security finding remains.

Priority: P2
Reviewed head: d3c9ac59bbb95539d76b1dd06b58b130fa9bd74f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, canonical repair with strong regression coverage and credible real scan evidence; no code change is needed from the contributor.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body provides an exact-head no-key/no-probe before-and-after public scan result, compares it with live OpenRouter metadata, and reports focused validation; no secret-bearing proof is required for this public catalog path.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides an exact-head no-key/no-probe before-and-after public scan result, compares it with live OpenRouter metadata, and reports focused validation; no secret-bearing proof is required for this public catalog path.
Evidence reviewed 7 items Current-main behavior: Current main only accepts catalog-wide finite context_length, max_completion_tokens, and max_output_tokens; it does not read top_provider, so the reported metadata mismatch remains on main.
Canonical owner alignment: The current OpenRouter provider catalog already uses the same non-array record coercion, positive-safe-integer validation, and top_provider → catalog-wide fallback order that this patch applies to scanning.
Downstream behavior: Scan metadata is used both for output and to set contextWindow and maxTokens on optional probe models, so rejecting invalid preferred values before fallback prevents malformed metadata from changing probe behavior.
Findings None None.
Security None None.

How this fits together

The model scan fetches OpenRouter’s public model catalog and converts each entry into scan metadata for CLI output and optional capability probes. Normalized context and completion limits flow from the catalog parser into the displayed scan result and the probe model configuration.

flowchart LR
  A[OpenRouter model catalog] --> B[Model scan fetch]
  B --> C[Limit normalization]
  C --> D[Scan model records]
  D --> E[CLI scan output]
  D --> F[Capability probes]
Loading

Before merge

  • Complete next step (P2) - No repair job is needed: the active assigned PR already contains the focused fix and has no actionable review finding.
Agent review details

Security

None.

PR surface

Source 0, Tests +102. Total +102 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 10 0
Tests 1 102 0 +102
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 112 10 +102

Review metrics

Metric Value Why it matters
Production vs test delta production +10/-10 (net 0); tests +102/-0 The canonical normalization repair is production-net-neutral while adding targeted coverage for provider precedence and malformed metadata.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/agents/model-scan.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Merge this focused repair after the normal exact-head gates complete, keeping OpenRouter limit normalization centralized on the canonical positive-safe-integer and record-coercion contracts rather than adding a display-only or probe-only workaround.

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

Yes, source-reproducible: current main demonstrably ignores top_provider, and the PR body supplies an exact-head public no-key scan comparison whose before/after values match the parsed fields and downstream probe path.

Is this the best way to solve the issue?

Yes. Parsing the provider payload once at the scan-record owner boundary fixes both output and optional probes; display-only or probe-only adjustments would leave the other consumer inconsistent.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This corrects bounded model-scan metadata and optional probe limits without changing configuration, persistence, or provider API surfaces.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides an exact-head no-key/no-probe before-and-after public scan result, compares it with live OpenRouter metadata, and reports focused validation; no secret-bearing proof is required for this public catalog path.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an exact-head no-key/no-probe before-and-after public scan result, compares it with live OpenRouter metadata, and reports focused validation; no secret-bearing proof is required for this public catalog path.

Evidence

What I checked:

  • Current-main behavior: Current main only accepts catalog-wide finite context_length, max_completion_tokens, and max_output_tokens; it does not read top_provider, so the reported metadata mismatch remains on main. (src/agents/model-scan.ts:237, a67c52611e57)
  • Canonical owner alignment: The current OpenRouter provider catalog already uses the same non-array record coercion, positive-safe-integer validation, and top_provider → catalog-wide fallback order that this patch applies to scanning. (extensions/openrouter/provider-catalog.ts:197, a67c52611e57)
  • Downstream behavior: Scan metadata is used both for output and to set contextWindow and maxTokens on optional probe models, so rejecting invalid preferred values before fallback prevents malformed metadata from changing probe behavior. (src/agents/model-scan.ts:502, a67c52611e57)
  • Patch and regression coverage: The exact head uses asOptionalRecord plus asPositiveSafeInteger, then tests valid primary-provider precedence, malformed values, independent per-field fallback, and max_output_tokens fallback. (src/agents/model-scan.test.ts:86, d3c9ac59bbb9)
  • Normalization contract: The imported guard accepts only numeric positive safe integers, while the record guard rejects arrays and non-object values; this is the canonical boundary behavior needed for untrusted provider metadata. (packages/normalization-core/src/number-coercion.ts:98, a67c52611e57)
  • History and exact-head provenance: History identifies recent dedicated model-scan work by Vincent Koc and Alix-007, while current lines blame to Peter Steinberger; the PR head has current main as its parent, so it contains no stale-base merge delta. (src/agents/model-scan.ts:237, d3c9ac59bbb9)

Likely related people:

  • steipete: Current-main blame attributes the affected normalization lines to Peter Steinberger, and the model-scan history is predominantly associated with this area. (role: current scan-path contributor; confidence: high; commits: 8d1fe4f09106; files: src/agents/model-scan.ts, src/agents/model-scan.test.ts)
  • vincentkoc: Recent history includes OpenRouter model-scan body-cap and error-body repairs, directly adjacent to this catalog-fetch and normalization path. (role: recent OpenRouter scan contributor; confidence: medium; commits: ad3b2f4b8827, dbd5689ea199; files: src/agents/model-scan.ts, src/agents/model-scan.test.ts)
  • Alix-007: A recent merged fix addressed OpenRouter catalog-read timeout behavior in the same scan implementation and test surface. (role: recent model-scan contributor; confidence: medium; commits: fece179cf93a, 06ca1235efb7; files: src/agents/model-scan.ts, src/agents/model-scan.test.ts)

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-20T13:06:46.168Z sha cd15b84 :: needs changes before merge. :: [P2] Reject invalid top-provider token limits before precedence
  • reviewed 2026-07-20T13:49:03.809Z sha cd15b84 :: needs changes before merge. :: [P2] Reject invalid top-provider limits before applying precedence
  • reviewed 2026-07-20T14:31:47.114Z sha cd15b84 :: needs changes before merge. :: [P1] Validate preferred provider limits as positive integers
  • reviewed 2026-07-31T09:45:04.818Z sha cd15b84 :: needs changes before merge. :: [P1] Validate preferred provider limits as positive integers
  • reviewed 2026-08-02T04:19:04.155Z sha 16d41f1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T12:19:42.430Z sha aefc09c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T20:44:24.795Z sha aefc09c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-03T08:43:13.344Z sha 7dde713 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the fix/openrouter-scan-top-provider-limits branch from 1089411 to df1009e Compare July 20, 2026 10:55
@Yigtwxx

Yigtwxx commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The precedence flip is right and it converges on the in-repo sibling, but asFiniteNumber lets 0 through and ?? doesn't fall through on 0 — so a junk top_provider value now outranks a good top-level one.

// packages/normalization-core/src/number-coercion.ts:2-4
export function asFiniteNumber(value: unknown): number | undefined {
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
}

For { context_length: 32_768, top_provider: { context_length: 0 } } that yields contextLength: 0, and the value isn't only reported — model-scan.ts:507-508 builds the probe model from it:

contextWindow: entry.contextLength ?? baseModel.contextWindow,
maxTokens: entry.maxCompletionTokens ?? baseModel.maxTokens,

0 ?? baseModel.contextWindow is 0, so the probe runs with a zero window instead of the base model's. Negatives and fractions pass the same way.

I want to be careful about how much this proves, because the loose validation isn't new — main already accepted 0 on the top-level field. What's new is the precedence: before this PR the good top-level value was the only one read, so a bad top_provider couldn't shadow it. That's the part I'd call a new failure mode rather than a pre-existing one.

And I can't show you a captured OpenRouter payload containing 0 — the shape I've seen is null, which your code handles correctly (asFiniteNumber(null)undefined → falls through). So this is a reading of the input contract, not a measurement of it. What makes me think it's worth guarding anyway is that the repo's other OpenRouter reader already treats these exact inputs as expected junk: extensions/kilocode/provider-models.ts:121-123 uses asPositiveSafeInteger, and extensions/kilocode/provider-models.test.ts:240-270 fixtures top_provider: { max_completion_tokens: 0 } and context_length: -1 and asserts fallback to defaults. asPositiveSafeInteger (number-coercion.ts:99-101) exists for this; swapping it in here would close the case and finish the convergence you started — src/agents/embedded-agent-runner/openrouter-model-capabilities.ts:165-170 is the sibling you're already matching on precedence.

On tests: the added fixture covers top_provider smaller than top-level, which is the common case and the right one to pin first. Three neighbours are unpinned, and one has a behavior consequence — 0/null inside top_provider, top_provider larger than top-level, and the mixed case where context_length comes from top_provider while max_completion_tokens falls through to the top level. That last one is worth a fixture on its own, since silently mixing two sources for a single model's limits is hard to spot in the scan output.

None of this is a blocker; reading top_provider first is a clear improvement over the top-level field alone. Whether 0 is worth guarding is your call — you've looked at more of these payloads than I have.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed 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 Jul 20, 2026
Comment thread src/agents/model-scan.ts Outdated
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 31, 2026
@Yigtwxx

Yigtwxx commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@mushuiyu886 This morning's ClawSweeper pass turned the asFiniteNumber point into the P1 blocking finding and calls the repair mechanical. It is — so rather than restate it, here it is applied and measured on cd15b84b merged with current main (5fc976571e5), paste-ready.

Source change. asPositiveSafeInteger is exported from the same module you already import from, so this adds nothing:

 import {
-  asFiniteNumber,
   asDateTimestampMs,
+  asPositiveSafeInteger,
   resolveTimerTimeoutMs,
 } from "@openclaw/normalization-core/number-coercion";

           const contextLength =
-            asFiniteNumber(topProvider?.context_length) ??
-            asFiniteNumber(obj.context_length) ??
+            asPositiveSafeInteger(topProvider?.context_length) ??
+            asPositiveSafeInteger(obj.context_length) ??
             null;

           const maxCompletionTokens =
-            asFiniteNumber(topProvider?.max_completion_tokens) ??
-            asFiniteNumber(obj.max_completion_tokens) ??
-            asFiniteNumber(obj.max_output_tokens) ??
+            asPositiveSafeInteger(topProvider?.max_completion_tokens) ??
+            asPositiveSafeInteger(obj.max_completion_tokens) ??
+            asPositiveSafeInteger(obj.max_output_tokens) ??
             null;

Measured, same tree, same fixtures. Top-level context_length: 32768 / max_completion_tokens: 4096 in every row; only top_provider varies:

top_provider before after
0 0 / 0 32768 / 4096
-1 -1 / -1 32768 / 4096
8192.5 8192.5 / 8192.5 32768 / 4096
16384 / 1024 (control) 16384 / 1024 16384 / 1024
null (control) 32768 / 4096 32768 / 4096

The two control rows are the ones that matter for scope: a well-formed top_provider still wins, and null still falls through, so the guard rejects malformed values without touching the precedence flip this PR is actually about.

Fixtures, including the mixed-field case the review asks for. Both fail on your current head — expected +0 to be 32768 and expected +0 to be 4096 — and pass with the change above, so they're load-bearing rather than descriptive:

  it("falls back when top-provider limits are malformed", async () => {
    for (const topProvider of [
      { context_length: 0, max_completion_tokens: 0 },
      { context_length: -1, max_completion_tokens: -1 },
      { context_length: 8192.5, max_completion_tokens: 8192.5 },
      { context_length: null, max_completion_tokens: null },
    ]) {
      const fetchImpl = createFetchFixture({
        data: [
          {
            id: "acme/provider-limited:free",
            name: "Provider Limited",
            context_length: 32_768,
            max_completion_tokens: 4096,
            top_provider: topProvider,
            supported_parameters: [],
            pricing: { prompt: "0", completion: "0" },
          },
        ],
      });

      const [result] = await scanOpenRouterModels({ fetchImpl, probe: false });

      expect(result?.contextLength).toBe(32_768);
      expect(result?.maxCompletionTokens).toBe(4096);
    }
  });

  it("mixes provider context length with a top-level completion cap", async () => {
    const fetchImpl = createFetchFixture({
      data: [
        {
          id: "acme/provider-limited:free",
          name: "Provider Limited",
          context_length: 32_768,
          max_completion_tokens: 4096,
          top_provider: { context_length: 16_384, max_completion_tokens: 0 },
          supported_parameters: [],
          pricing: { prompt: "0", completion: "0" },
        },
      ],
    });

    const [result] = await scanOpenRouterModels({ fetchImpl, probe: false });

    expect(result?.contextLength).toBe(16_384);
    expect(result?.maxCompletionTokens).toBe(4096);
  });

Validation with everything applied:

node scripts/run-vitest.mjs run src/agents/model-scan.test.ts src/commands/models/scan.test.ts
Tests  13 passed (13)   # model-scan.test.ts, 11 before the two added cases
Tests  10 passed (10)   # commands/models/scan.test.ts, unchanged

./node_modules/.bin/oxfmt --check src/agents/model-scan.ts   All matched files use the correct format.
./node_modules/.bin/oxlint src/agents/model-scan.ts          clean

Take it or adapt it — I'm not attached to the fixture wording, and the null row is worth keeping whichever way you write them, since it's the one that proves the guard didn't just start rejecting everything.

@mushuiyu886

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 2, 2026
@Yigtwxx

Yigtwxx commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@mushuiyu886 Heads-up: this branch started conflicting a few hours ago, and the review comment above predates it — it says GitHub reports the PR mergeable, but the API now returns mergeable: false, mergeable_state: "dirty". Your work is not obsolete; the cause is mechanical and the resolution is small, so here it is measured.

What moved. 33ea3e16e984refactor: consolidate core micro-helpers (#117825), merged today at 06:10 UTC — extracted withTimeout out of src/agents/model-scan.ts into src/node-host/with-timeout.js. That removed one nesting level, so the whole return entries.map(...) chain shifted two spaces left. It is the only commit to touch this file since your July 20 base.

Three-way merge against main at 7068bc2ffe5:

$ git merge-tree --write-tree --name-only origin/main <pr-head>
src/agents/model-scan.ts
CONFLICT (content): Merge conflict in src/agents/model-scan.ts

The conflicting hunk is your two limit blocks against the re-indented ones. No logic disagreement — both sides changed the same lines for unrelated reasons.

The fix is still needed. Current main has no top_provider read at all:

const contextLength =
  typeof obj.context_length === "number" && Number.isFinite(obj.context_length)
    ? obj.context_length
    : null;

So the top-level-only behaviour your PR corrects is exactly what main still does.

Resolution. asPositiveSafeInteger is still exported from packages/normalization-core/src/number-coercion.ts:99, and model-scan.ts still imports from that module, so this is an addition to the existing list:

 import {
   asDateTimestampMs,
+  asPositiveSafeInteger,
   resolveTimerTimeoutMs,
 } from "@openclaw/normalization-core/number-coercion";

Then, at main's new indentation, replace the two limit blocks with:

            const topProvider =
              obj.top_provider && typeof obj.top_provider === "object"
                ? (obj.top_provider as Record<string, unknown>)
                : undefined;

            const contextLength =
              asPositiveSafeInteger(topProvider?.context_length) ??
              asPositiveSafeInteger(obj.context_length) ??
              null;

            const maxCompletionTokens =
              asPositiveSafeInteger(topProvider?.max_completion_tokens) ??
              asPositiveSafeInteger(obj.max_completion_tokens) ??
              asPositiveSafeInteger(obj.max_output_tokens) ??
              null;

I applied exactly that on top of current main and checked it: npx oxlint src/agents/model-scan.ts exits 0, and npx oxfmt --check src/agents/model-scan.ts reports "All matched files use the correct format" — so the indentation above is the formatter's own, not my guess at it.

What I did not check: I did not run the test file through the merged tree, so treat the source resolution as verified and the suite as still owing a run once you push. Your existing top_provider cases should be unaffected — the refactor touched nesting, not behaviour — but that is worth confirming rather than assuming.

@mushuiyu886

Copy link
Copy Markdown
Contributor Author

Resolved the current-main conflict in aefc09cf3eb8 while retaining main's new withTimeout(work, timeoutMs, label) contract and the provider-limit normalization.

Post-merge verification:

  • Node 24.15.0 focused run: 25 tests passed across src/agents/model-scan.test.ts and src/commands/models/scan.test.ts.
  • Targeted formatting, lint, and diff checks passed.
  • Latest ClawSweeper review is on aefc09cf3eb8 and reports no actionable findings.

Exact-head CI passed every product/check lane except build-artifacts. Its failure is in the unrelated TUI PTY test src/tui/tui-pty-local.e2e.test.ts: the first prompt did not reach the model. The PR diff only changes the two model-scan files, and the same build-artifacts job passed on current-main run https://github.com/openclaw/openclaw/actions/runs/30746443912/job/91493362209.

I attempted to rerun the failed jobs, but GitHub rejected the contributor token because reruns require repository admin rights. A maintainer rerun of https://github.com/openclaw/openclaw/actions/runs/30747370605 is the remaining CI action; no product-code change is indicated by this failure.

@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Aug 3, 2026
@clawsweeper clawsweeper Bot added the rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. label Aug 3, 2026
@vincentkoc
vincentkoc force-pushed the fix/openrouter-scan-top-provider-limits branch from 7dde713 to d3c9ac5 Compare August 3, 2026 18:03
@vincentkoc vincentkoc self-assigned this Aug 3, 2026
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 3, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer review complete for exact head d3c9ac59bbb95539d76b1dd06b58b130fa9bd74f.

  • ClawSweeper's latest review has no findings, no security concern, and sufficient public live-output proof.
  • The sole before-merge item was normal maintainer review; that is complete.
  • Focused exact-head tests pass 56/56, direct scoped formatting/lint pass, and required openclaw/ci-gate is green.
  • Fresh current-main integration at 05dc73bb35fd6ef1dc56ec82f0e913476d438412 has zero touched-path overlap and a conflict-free merge tree.
  • The fix remains production-net-neutral and does not change config, SDK, persistence, protocol, or feature surfaces.

Proceeding through the repository's native prepare and merge verification flow.

@vincentkoc
vincentkoc merged commit 8fa1b82 into openclaw:main Aug 3, 2026
127 of 133 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 3, 2026
* origin/main: (25 commits)
  test(qa): cover plugin authoring contracts (#118821)
  fix(parallels): keep provider keys out of POSIX job logs (#118840)
  improve: reduce redundant Code Mode test work (#118815)
  fix(models): report primary OpenRouter limits in scans (#110855)
  test: speed up setup inference fixtures (#118811)
  fix(auto-reply): enforce canonical reset authorization (#118580)
  docs(gateway): fix invalid heartbeat visibility examples (#118827)
  fix(plugins): unify HTTP route conflict handling (#118203)
  test(agents): use prepared auth fixtures (#118816)
  fix(lmstudio): resolve JIT embedding variants
  fix(lmstudio): preserve embedding preload and model identity
  fix(ai): reject binary Codex websocket frames (#111138)
  fix(deps): bump brace-expansion override to 5.0.9 for HIGH advisory 1130705 (#118804)
  feat(cli): add session archive and delete commands (#118791)
  fix(openai): commit eligible final realtime transcription audio safely (#118782)
  fix(reef): restrict management commands to owners [AI] (#118578)
  fix(google): honor Cloud SDK credential location and Vertex billing project (#118745)
  fix(bedrock): preserve private embedding endpoints and AWS routing policy (#118744)
  fix(voice): make signed callback replay reservations durable and retryable (#118754)
  fix(openrouter): isolate custom proxy credentials and transport security (#118773)
  ...
vincentkoc added a commit that referenced this pull request Aug 3, 2026
…-state-mutation

* origin/main: (22 commits)
  fix(delivery): renew stable producer leases (#118663)
  test(mcp): isolate catalog size checks from wall-clock load (#118871)
  test(ui): add credentials primary QA proof (#118790)
  fix(slack): prevent stalled presence polling from hanging shutdown (#117478)
  test(security): cover gateway shared auth modes (#118834)
  fix(macos): show gateway auth failures in app status (#118841)
  test(tui): route PTY gateway scenarios through explicit models (#118802)
  test(qa): add session transcript primary coverage (#118820)
  fix(browser): protect private observation media and Canvas trust boundaries (#118775)
  fix(build): restore SDK packages and signed macOS app builds (#118833)
  test(qa): cover plugin authoring contracts (#118821)
  fix(parallels): keep provider keys out of POSIX job logs (#118840)
  improve: reduce redundant Code Mode test work (#118815)
  fix(models): report primary OpenRouter limits in scans (#110855)
  test: speed up setup inference fixtures (#118811)
  fix(auto-reply): enforce canonical reset authorization (#118580)
  docs(gateway): fix invalid heartbeat visibility examples (#118827)
  fix(plugins): unify HTTP route conflict handling (#118203)
  test(agents): use prepared auth fixtures (#118816)
  fix(lmstudio): resolve JIT embedding variants
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
xialonglee pushed a commit to xialonglee/openclaw that referenced this pull request Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

4 participants