Skip to content

fix: OAuth catalog refresh fails with historical agent stores - #168957

Merged
obviyus merged 3 commits into
mainfrom
fix/oauth-catalog-peer-fence
Oct 11, 2026
Merged

obviyus merged 3 commits into
mainfrom
fix/oauth-catalog-peer-fence

Conversation

@obviyus

@obviyus obviyus commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes OAuth model-catalog refresh failing before contacting the provider when other agent databases exist, including empty historical databases.

User Impact

Shared OAuth credentials can refresh during catalog discovery without requiring users to delete other agents or sign in again. Historical copies remain fenced during rotation and are settled afterward. No schema, stored format, or authentication-policy changes.

Why This Change Was Made

Historical-peer updates entered the host-only database executor from the catalog Worker. They now use that Worker's existing native auth-write scope, retaining the captured database path and file identity, existing-only opening, transactional credential comparisons, and committed publication. The same path handles fencing and settlement. Pre-request failures still roll claims back; failures after provider I/O remain terminal because a rotating token might already be consumed.

Evidence

  • Three real catalog-Worker integration cases pass: shared OAuth with empty agent databases; an exact historical copy fenced during a held token exchange and removed after successful rotation; and rollback of earlier claims when a later peer already owns the generation.
  • All three fail against unmodified origin/main (390f0f0acb98c577d5ccf71cd04201a6c4083c7b) with the same built-runtime prerequisite: Failed to fence every historical OAuth refresh peer. | Agent admission requires its host owner. No refresh HTTP call is made.
  • The registered-runtime prerequisite and worker regression pass together (8 tests). The clean-shard prerequisite omission found by hosted CI is corrected and covered by the runner-selection test.
  • Existing candidate-store, peer-settlement, store-update, and catalog-retirement tests pass (31 tests across four files).
  • Isolated bundled xAI Gateway proof used only synthetic credentials and an operator-configured CONNECT/TLS stub with an ephemeral CA. Main, configured-peer, and historical-peer credentials were simultaneously pending-fenced during the held exchange. One refresh succeeded; both catalog requests used the rotated bearer; models.list published Synthetic Grok catalog with xai:proof marked ready. Historical rows were removed after settlement and an unrelated generation was unchanged.
    Inspectable synthetic Gateway trace and settlement evidence.
  • pnpm build, targeted Oxlint, the agents-root test typecheck, database-worker/dialect ratchets, line-cap/max-lines ratchets, assertion-safety, and git diff --check pass. The final Codex review reported no actionable defects.

Merge danger: two-way door; reverting restores the old execution path without changing stored formats. Blast radius is refresh-managed OAuth used by catalog discovery, including shared credentials and historical agent copies.

@clawsweeper

clawsweeper Bot commented Oct 11, 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 docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Oct 11, 2026
@obviyus
obviyus marked this pull request as ready for review October 11, 2026 06:59
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: c37867cbfbe067610dd28eadb69fc49787542595
  • Maintainer: @obviyus
  • Repository role: maintain

These security sensitive changes were made:

  • src/agents/auth-profiles/candidate-stores.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/sqlite.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR routes historical OAuth peer fencing and settlement through the catalog worker’s existing native auth writer.

Example: A Gateway refreshes xai:proof while a-historical contains a matching credential and b-empty has no auth row.

  • Before: Catalog discovery fails before token HTTP with “Agent admission requires its host owner.”
  • After: One refresh succeeds, grok-4 appears as ready, and historical markers are removed so peers inherit the rotated shared credential.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The shipped Gateway trace covers the repaired behavior, existing-format persistence remains compatible without migration, and the previous prerequisite defect is fixed.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The inspected macOS arm64/Node 24.21.0 bundled xAI Gateway trace exercises the changed peer writer with synthetic existing credentials and a real CONNECT/TLS transport to a controlled endpoint: peers are fenced during exchange, one refresh completes, rotated bearer requests publish a ready catalog, and historical rows settle correctly. The driver’s incorrect final assertion remains disclosed rather than represented as a passing exit.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: OAuth model discovery fails before refreshing credentials when other agent databases exist, potentially leaving users without their provider catalog.
Reason: Maintainer direction is established, the current-source failure is concrete, and the scoped repair restores discovery without new configuration or public contracts.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current-main OAuth catalog failure and merits landing. The previous prerequisite finding is resolved, and no actionable correctness or security findings remain; required CI is still pending.

Priority: P2
Reviewed head: c37867cbfbe067610dd28eadb69fc49787542595

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway model discovery runs provider catalogs in a worker; the auth-profile owner fences matching persisted credentials before token exchange and settles those credentials afterward.

flowchart TD
  A[Gateway models list] --> B[Catalog worker]
  B --> C[OAuth refresh owner]
  C --> D[Request native auth writer]
  D --> E[Historical agent databases]
  C --> F[Provider token exchange]
  F --> C
  C --> B
Loading

Technical review

Best possible solution:

Land the native-worker repair with the existing fencing, settlement, and persistence contracts intact once required gates pass.

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

Current-main source routes catalog-worker peer updates into a host-only broker, matching the supplied baseline failures before token HTTP; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The repair uses the worker’s already established native auth-write adapter and canonical transaction/save owners, addressing the execution-boundary defect without weakening peer fencing or changing authentication policy.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Historical-peer write dispatch changes intended behavior with a stated reason (2fe7995: Offload peer fencing and settlement from the Gateway thread while preserving physical identity, transactional comparisons, and publication.)
  • Native auth transactions and persistence keeps the original intent (fa5d32f: Keep credential updates consistent under contention and preserve newer credentials and canonical publication.)
  • Catalog refresh fixture and custody keeps the original intent (6802f99: Keep already-started refreshes alive through catalog-worker retirement and settlement.)
  • Compiled-runtime test prerequisites keeps the original intent (3d3bc8a: Prepare built SDK artifacts for real model-preparation tests routed through database-worker projects.)
  • Account-safe peer inheritance keeps the original intent (b824b72: Prevent consumed-token replay and cross-account credential inheritance through durable fencing and exact settlement.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +106, Tests +158, Docs +8, Other +1. Total +273 across 8 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 125 19 +106
Tests 4 165 7 +158
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 8 299 26 +273

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded current-main regression in OAuth model-catalog discovery when other agent databases exist.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T07:06:47.005Z sha 5c585da :: needs changes before merge. :: [P2] Register the new integration file’s built-runtime prerequisite

Reviewed October 11, 2026, 3:18 AM ET / 07:18 UTC (Revision 2).

@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

Isolated bundled xAI Gateway trace

Observed on macOS arm64 / Node 24.21.0 using this PR's runtime. All credentials were synthetic. An operator-configured CONNECT proxy terminated TLS with an ephemeral CA trusted only by the isolated process; it accepted only the two provider hosts and never forwarded external traffic.

The starting credential expired at 2026-10-11T06:56:56.502Z. The actual refresh began 34 seconds earlier:

{"at":"2026-10-11T06:56:22.880Z","kind":"refresh","refreshCalls":1,"grant":"refresh_token","credential":"original-synthetic","held":true}
{"at":"2026-10-11T06:56:27.170Z","kind":"catalog","credential":"rotated-synthetic"}
{"at":"2026-10-11T06:56:28.840Z","kind":"catalog","credential":"rotated-synthetic"}

The refresh endpoint was https://auth.x.ai/oauth2/token; both catalog requests were https://cli-chat-proxy.grok.com/v1/models.

Persisted observation Main Configured peer Historical peer Unrelated generation
Token response held Pending fence Pending fence Pending fence Unchanged, not fenced
After response Rotated credentials Local marker removed Local marker removed Unchanged, not fenced
Effective read-only auth after settlement Rotated Inherits rotated shared auth Inherits rotated shared auth Original unrelated account

models.list published the stub's {"id":"grok-4","name":"Synthetic Grok catalog","available":true} and {"provider":"xai","profileId":"xai:proof","status":"ready"}. No peer-fence error occurred. The Gateway shut down cleanly and the proxy was stopped.

The live driver's initial final assertion incorrectly expected rotated secret copies to remain in every local peer. Its exit status remains 1; inspection of the captured rows plus a separate read-only effective-auth check confirmed the intended removal/read-through contract. The OAuth request was not replayed merely to change that status. The permanent worker integration regression asserts the correct removal behavior.

@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed the missing runtime consumer registration in c37867c and added a runner-selection regression. The supported runner now passes the prerequisite checks and all three real Worker cases (8 tests). With the same built-runtime prerequisite on unmodified 390f0f0, all three fail before token HTTP with "Failed to fence every historical OAuth refresh peer. | Agent admission requires its host owner." The PR body now links the inspectable synthetic Gateway trace: #168957 (comment) .

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@obviyus
obviyus merged commit 43c68c3 into main Oct 11, 2026
159 of 162 checks passed
@obviyus
obviyus deleted the fix/oauth-catalog-peer-fence branch October 11, 2026 07:22
@obviyus

obviyus commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 43c68c3. Catalog-worker OAuth refresh now fences and settles historical peers through its request-owned native writer, retaining exact file identity and transactional generation checks. The runtime-prepared regressions reproduce the original failure and pass with the fix; isolated bundled xAI proof shows one refresh, fenced peers, rotated-bearer catalog publication, and correct settlement. Exact-head ClawSweeper was ready and all 84 CI jobs completed successfully. Thanks for reporting the catalog refresh failure.

RomneyDa pushed a commit that referenced this pull request Oct 12, 2026
## What Problem This Solves

Fixes OAuth model-catalog refresh failing before contacting the provider when other agent databases exist, including empty historical databases.

## User Impact

Shared OAuth credentials can refresh during catalog discovery without requiring users to delete other agents or sign in again. Historical copies remain fenced during rotation and are settled afterward. No schema, stored format, or authentication-policy changes.

## Why This Change Was Made

Historical-peer updates entered the host-only database executor from the catalog Worker. They now use that Worker's existing native auth-write scope, retaining the captured database path and file identity, existing-only opening, transactional credential comparisons, and committed publication. The same path handles fencing and settlement. Pre-request failures still roll claims back; failures after provider I/O remain terminal because a rotating token might already be consumed.

No overlap with Pash/Sarah changes.

## Evidence

- Three real catalog-Worker integration cases pass: shared OAuth with empty agent databases; an exact historical copy fenced during a held token exchange and removed after successful rotation; and rollback of earlier claims when a later peer already owns the generation.
- All three fail against unmodified `origin/main` (`390f0f0acb98c577d5ccf71cd04201a6c4083c7b`) with the same built-runtime prerequisite: `Failed to fence every historical OAuth refresh peer. | Agent admission requires its host owner.` No refresh HTTP call is made.
- The registered-runtime prerequisite and worker regression pass together (8 tests). The clean-shard prerequisite omission found by hosted CI is corrected and covered by the runner-selection test.
- Existing candidate-store, peer-settlement, store-update, and catalog-retirement tests pass (31 tests across four files).
- Isolated bundled xAI Gateway proof used only synthetic credentials and an operator-configured CONNECT/TLS stub with an ephemeral CA. Main, configured-peer, and historical-peer credentials were simultaneously pending-fenced during the held exchange. One refresh succeeded; both catalog requests used the rotated bearer; `models.list` published **Synthetic Grok catalog** with `xai:proof` marked `ready`. Historical rows were removed after settlement and an unrelated generation was unchanged.
  [Inspectable synthetic Gateway trace and settlement evidence](#168957 (comment)).
- `pnpm build`, targeted Oxlint, the agents-root test typecheck, database-worker/dialect ratchets, line-cap/max-lines ratchets, assertion-safety, and `git diff --check` pass. The final Codex review reported no actionable defects.

Merge danger: two-way door; reverting restores the old execution path without changing stored formats. Blast radius is refresh-managed OAuth used by catalog discovery, including shared credentials and historical agent copies.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 43c68c3)
obviyus added a commit that referenced this pull request Oct 12, 2026
Closes #169066

## What Problem This Solves

Fixes slow, misleading **Test connection** results that count model/credential preparation and internal agent-session work as provider latency.

## User Impact

Connection checks make a fresh request without creating an agent session. Each credential shows a labeled **Request round-trip**; the ambiguous aggregate header timing is gone. Empty or thinking-only responses fail the format check, timeouts remain timeouts, and provider diagnostics remain useful and secret-redacted.

## Why This Change Was Made

The original probe in [40181af](40181af) exercised a real provider request through an embedded agent. [#117494](#117494) added the structured internal session required by that runtime. Connectivity checks can now use the existing isolated-completion owner instead of paying for that agent-session lifecycle.

The deliberately isolated, read-only direct-credential generation from [#125816](#125816) stays intact. Every credential still uses raw OpenClaw transport, preserving [#121500](#121500). OAuth refresh remains with its normal persistent owner, including the historical-peer fencing and settlement from [#168957](#168957); no new cooldown/quota writes are introduced. Known configured models no longer trigger unnecessary catalog preparation.

Checked Sarah's [#159246](#159246): its Agents API restricted-session contract and runtime defaults are unchanged. No overlap with Pash's changes.

## Evidence

- Command/target/resource regressions: **38 passed**. Includes direct and stored credentials, immutable API-key auth state, expired OAuth refreshing once into the real shared store with owner/peer fences and peer settlement, and valid OAuth causing no credential/state write.
- Isolated-completion suite: **50 passed**; Gateway probe suite: **13 passed**.
- Models view: **38 passed**; i18n verification passed; Models browser E2E: **7 passed**.
- Discriminating negative control: removing the output/timeout/diagnostic fixes makes empty and thinking-only responses incorrectly report `ok`, aborted timeout output report `unknown`, and provider-detail assertions fail.
- Mock-export gate passes after six justified isolation annotations and removal of six retired baseline entries.

### Paired timing comparison

Real Gateway and Control UI button clicks against the same synthetic HTTP provider with a 250 ms response delay. Baseline `cbba7e2e2ef` versus candidate `994f04547a9`; five alternating measured samples per row, excluding one warmup per lane. These are local stub measurements, not live-provider speed claims.

| Scenario | Median full probe RPC, before → after | Median displayed credential duration, before → request-only after |
| --- | ---: | ---: |
| Successful response | 2,103 → 738 ms | 1,532 → 256 ms |
| HTTP 401 | 1,073 → 389 ms | 929 → 256 ms |

The stub's median HTTP duration was 251–253 ms. Each success made one HTTP request; the old 401 path made two, while the new isolated check made one. Full probe time still includes setup; it is not shown as provider request time.

### Desktop

Before — unlabeled aggregate and repeated credential timing:

![Desktop before: unlabeled aggregate timing](https://github.com/user-attachments/assets/026b85b9-4e7c-4c72-b2c9-401a4bdaee3a)

After — labeled per-credential request timing, no aggregate header duration:

![Desktop after: labeled per-credential request timing](https://github.com/user-attachments/assets/82c30402-0975-4d34-9584-0d97aa2d611a)

### Mobile

![Mobile before: unlabeled aggregate timing](https://github.com/user-attachments/assets/34770f2d-d1e1-4bab-b9dd-f3ccfaabf244)

![Mobile after: labeled per-credential request timing](https://github.com/user-attachments/assets/a54f20d2-f838-4cda-9cc6-d13a2dc72f08)

### CI context

The initial CI run also hit the main-owned `eager-import-closure.test.ts` duplicate-inventory failure. The same three duplicate paths are demonstrated on clean main `44f538c1855d` in [the existing main reproduction](#169511 (comment)), and in [this PR's failing job](https://github.com/openclaw/openclaw/actions/runs/38198084932/job/114645376204). This PR does not modify that test, wrapper inventory, or those source files.

Merge danger: two-way door. Reverting restores the old probe path without a schema or configuration migration. Blast radius is model connection diagnostics in the CLI and Control UI; ordinary chat and other runtime adapters are unchanged.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…aw#168957)

## What Problem This Solves

Fixes OAuth model-catalog refresh failing before contacting the provider when other agent databases exist, including empty historical databases.

## User Impact

Shared OAuth credentials can refresh during catalog discovery without requiring users to delete other agents or sign in again. Historical copies remain fenced during rotation and are settled afterward. No schema, stored format, or authentication-policy changes.

## Why This Change Was Made

Historical-peer updates entered the host-only database executor from the catalog Worker. They now use that Worker's existing native auth-write scope, retaining the captured database path and file identity, existing-only opening, transactional credential comparisons, and committed publication. The same path handles fencing and settlement. Pre-request failures still roll claims back; failures after provider I/O remain terminal because a rotating token might already be consumed.

No overlap with Pash/Sarah changes.

## Evidence

- Three real catalog-Worker integration cases pass: shared OAuth with empty agent databases; an exact historical copy fenced during a held token exchange and removed after successful rotation; and rollback of earlier claims when a later peer already owns the generation.
- All three fail against unmodified `origin/main` (`2903155d69a48f90d93cec74b83267cd145423b5`) with the same built-runtime prerequisite: `Failed to fence every historical OAuth refresh peer. | Agent admission requires its host owner.` No refresh HTTP call is made.
- The registered-runtime prerequisite and worker regression pass together (8 tests). The clean-shard prerequisite omission found by hosted CI is corrected and covered by the runner-selection test.
- Existing candidate-store, peer-settlement, store-update, and catalog-retirement tests pass (31 tests across four files).
- Isolated bundled xAI Gateway proof used only synthetic credentials and an operator-configured CONNECT/TLS stub with an ephemeral CA. Main, configured-peer, and historical-peer credentials were simultaneously pending-fenced during the held exchange. One refresh succeeded; both catalog requests used the rotated bearer; `models.list` published **Synthetic Grok catalog** with `xai:proof` marked `ready`. Historical rows were removed after settlement and an unrelated generation was unchanged.
  [Inspectable synthetic Gateway trace and settlement evidence](openclaw#168957 (comment)).
- `pnpm build`, targeted Oxlint, the agents-root test typecheck, database-worker/dialect ratchets, line-cap/max-lines ratchets, assertion-safety, and `git diff --check` pass. The final Codex review reported no actionable defects.

Merge danger: two-way door; reverting restores the old execution path without changing stored formats. Blast radius is refresh-managed OAuth used by catalog discovery, including shared credentials and historical agent copies.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…#169554)

Closes openclaw#169066

## What Problem This Solves

Fixes slow, misleading **Test connection** results that count model/credential preparation and internal agent-session work as provider latency.

## User Impact

Connection checks make a fresh request without creating an agent session. Each credential shows a labeled **Request round-trip**; the ambiguous aggregate header timing is gone. Empty or thinking-only responses fail the format check, timeouts remain timeouts, and provider diagnostics remain useful and secret-redacted.

## Why This Change Was Made

The original probe in [5083dd5](openclaw@5083dd5) exercised a real provider request through an embedded agent. [openclaw#117494](openclaw#117494) added the structured internal session required by that runtime. Connectivity checks can now use the existing isolated-completion owner instead of paying for that agent-session lifecycle.

The deliberately isolated, read-only direct-credential generation from [openclaw#125816](openclaw#125816) stays intact. Every credential still uses raw OpenClaw transport, preserving [openclaw#121500](openclaw#121500). OAuth refresh remains with its normal persistent owner, including the historical-peer fencing and settlement from [openclaw#168957](openclaw#168957); no new cooldown/quota writes are introduced. Known configured models no longer trigger unnecessary catalog preparation.

Checked Sarah's [openclaw#159246](openclaw#159246): its Agents API restricted-session contract and runtime defaults are unchanged. No overlap with Pash's changes.

## Evidence

- Command/target/resource regressions: **38 passed**. Includes direct and stored credentials, immutable API-key auth state, expired OAuth refreshing once into the real shared store with owner/peer fences and peer settlement, and valid OAuth causing no credential/state write.
- Isolated-completion suite: **50 passed**; Gateway probe suite: **13 passed**.
- Models view: **38 passed**; i18n verification passed; Models browser E2E: **7 passed**.
- Discriminating negative control: removing the output/timeout/diagnostic fixes makes empty and thinking-only responses incorrectly report `ok`, aborted timeout output report `unknown`, and provider-detail assertions fail.
- Mock-export gate passes after six justified isolation annotations and removal of six retired baseline entries.

### Paired timing comparison

Real Gateway and Control UI button clicks against the same synthetic HTTP provider with a 250 ms response delay. Baseline `b372edb6424` versus candidate `994f04547a9`; five alternating measured samples per row, excluding one warmup per lane. These are local stub measurements, not live-provider speed claims.

| Scenario | Median full probe RPC, before → after | Median displayed credential duration, before → request-only after |
| --- | ---: | ---: |
| Successful response | 2,103 → 738 ms | 1,532 → 256 ms |
| HTTP 401 | 1,073 → 389 ms | 929 → 256 ms |

The stub's median HTTP duration was 251–253 ms. Each success made one HTTP request; the old 401 path made two, while the new isolated check made one. Full probe time still includes setup; it is not shown as provider request time.

### Desktop

Before — unlabeled aggregate and repeated credential timing:

![Desktop before: unlabeled aggregate timing](https://github.com/user-attachments/assets/026b85b9-4e7c-4c72-b2c9-401a4bdaee3a)

After — labeled per-credential request timing, no aggregate header duration:

![Desktop after: labeled per-credential request timing](https://github.com/user-attachments/assets/82c30402-0975-4d34-9584-0d97aa2d611a)

### Mobile

![Mobile before: unlabeled aggregate timing](https://github.com/user-attachments/assets/34770f2d-d1e1-4bab-b9dd-f3ccfaabf244)

![Mobile after: labeled per-credential request timing](https://github.com/user-attachments/assets/a54f20d2-f838-4cda-9cc6-d13a2dc72f08)

### CI context

The initial CI run also hit the main-owned `eager-import-closure.test.ts` duplicate-inventory failure. The same three duplicate paths are demonstrated on clean main `1abe83478663` in [the existing main reproduction](openclaw#169511 (comment)), and in [this PR's failing job](https://github.com/openclaw/openclaw/actions/runs/38198084932/job/114645376204). This PR does not modify that test, wrapper inventory, or those source files.

Merge danger: two-way door. Reverting restores the old probe path without a schema or configuration migration. Blast radius is model connection diagnostics in the CLI and Control UI; ordinary chat and other runtime adapters are unchanged.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts security-sensitive-changed 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