Repository navigation
fix: show provider request time for model connection checks - #169554
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR runs model connection checks through isolated completion and displays each credential’s request round-trip time. Example: Test a synthetic provider configured to respond after 250 ms.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses misleading connection-check timing that remains on main, and the reviewed head has no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI and Control UI connection checks select models and credentials, invoke the provider transport, and return categorized results with per-credential timing. flowchart TD
A[CLI or Control UI] --> B[Connection check owner]
B --> C[Model and credential preparation]
C --> D[Isolated completion]
D --> E[Provider transport]
E --> F[Status and request timing]
F --> A
Technical reviewBest possible solution: Use the existing isolated-completion owner for connection checks while preserving credential isolation, refresh ownership, and clear per-request timing. Do we have a high-confidence way to reproduce the issue? Current-main source establishes preparation-inclusive credential timing and fastest-target aggregation; the supplied paired Gateway measurements demonstrate the removable overhead, without reproducing the reporter’s exact Synology delay. Is this the best way to solve the issue? The change removes the unnecessary agent-session lifecycle at its owner rather than adjusting retries or credential coverage, while retaining the established raw transport and credential contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 48d96b4e3b6f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -37, Tests -118, Docs +9, Other -6. Total -152 across 17 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 11, 2026, 11:29 PM ET / October 12, 2026, 03:29 UTC (Revision 3). |
|
@clawsweeper re-review The PR body now includes inspected before/after desktop and mobile screenshots from the real Gateway + browser flow, plus five paired alternating measurements per success/401 scenario on the same 250 ms stub. All four uploaded images render on GitHub. Source head remains 994f045. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head 46813f5. The final two-file repair fixes the reported lint/type issues (bound method call; awaited test cleanup; explicit isolated state env). Full CI run 38199124259 is green. The inspected desktop/mobile images remain embedded; their UI and request-timer code is unchanged by this repair. |
|
🦞👀 Re-review progress:
|
|
Landed as 7af9595. Connection checks now use sessionless raw OpenClaw completion and show only labeled per-credential request timing, while preserving isolated direct credentials and canonical OAuth refresh. Empty/thinking-only output, timeout classification, and redacted provider diagnostics have regression coverage. Focused suites, the same-stub five-pair timing proof, approved desktop/mobile screenshots, exact-head ClawSweeper, and required CI passed. Thanks for reporting #169066. |
…#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:  After — labeled per-credential request timing, no aggregate header duration:  ### Mobile   ### 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]>
…overy Scheduled main CI run 38201451496 failed model-setup-recovery.e2e.test.ts waiting for "1234 ms" in the provider probe summary. #169554 intentionally removed that aggregate header timing and now labels each credential with "Request round-trip: N ms"; this e2e test was not updated. Assert the full per-credential row text, so the status, the new label, and the measured time are all checked. Proof: model-setup-recovery.e2e.test.ts passes 4/4.
#169554 made isolated completions report the provider's formatted error instead of the fixed stop-reason text. This changed-shard e2e still asserted the old text, so main stayed latently red until a PR selected it.
…overy Scheduled main CI run 38201451496 failed model-setup-recovery.e2e.test.ts waiting for "1234 ms" in the provider probe summary. openclaw#169554 intentionally removed that aggregate header timing and now labels each credential with "Request round-trip: N ms"; this e2e test was not updated. Assert the full per-credential row text, so the status, the new label, and the measured time are all checked. Proof: model-setup-recovery.e2e.test.ts passes 4/4.
openclaw#169554 made isolated completions report the provider's formatted error instead of the fixed stop-reason text. This changed-shard e2e still asserted the old text, so main stayed latently red until a PR selected it.
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 exercised a real provider request through an embedded agent. #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 stays intact. Every credential still uses raw OpenClaw transport, preserving #121500. OAuth refresh remains with its normal persistent owner, including the historical-peer fencing and settlement from #168957; no new cooldown/quota writes are introduced. Known configured models no longer trigger unnecessary catalog preparation.
Checked #159246: its Agents API restricted-session contract and runtime defaults are unchanged.
Evidence
ok, aborted timeout output reportunknown, and provider-detail assertions fail.Paired timing comparison
Real Gateway and Control UI button clicks against the same synthetic HTTP provider with a 250 ms response delay. Baseline
cbba7e2e2efversus candidate994f04547a9; five alternating measured samples per row, excluding one warmup per lane. These are local stub measurements, not live-provider speed claims.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:
After — labeled per-credential request timing, no aggregate header duration:
Mobile
CI context
The initial CI run also hit the main-owned
eager-import-closure.test.tsduplicate-inventory failure. The same three duplicate paths are demonstrated on clean main44f538c1855din the existing main reproduction, and in this PR's failing job. 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.