Skip to content

fix: live model probes miss loopback requests after a build - #150684

Merged
RomneyDa merged 1 commit into
release/2026.9.5from
fix/release95-live-stacked-20260917T0633
Sep 17, 2026
Merged

RomneyDa merged 1 commit into
release/2026.9.5from
fix/release95-live-stacked-20260917T0633

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #150653

What Problem This Solves

Fixes live model qualification probes sending requests to real provider endpoints instead of their loopback transport after a build.

User Impact

Internal test fix; installed runtime behavior does not change. Qualification can enforce its routing, header, hook, and timeout assertions instead of failing with an empty local request list.

Dependency: #150653 merged into release/2026.9.5 on September 17, 2026 at 06:29:40 UTC, and its branch was deleted. That prerequisite is satisfied, so this PR targets the release branch directly. Its bootstrap-test change is not part of this three-file diff. Separate output-limit and native-steering failures remain unresolved and are neither changed nor waived here.

Why This Change Was Made

Native built-plugin imports can replace adapters in the process-default registry while the source fixture configures a different package instance's transport host. The sweep now uses the existing isolated registry/runtime factories; custom Ollama registration uses the same owner.

The existing completion callback moves intact into a focused support module, with provider initialization inside its timeout/abort race. All wire assertions remain, including real HTTP aborts and callback ordering. The extraction also shrinks the oversized live test without changing a line-count baseline or suppression. Early provider errors now appear beside the request-count assertion.

This is a maintainer-requested, independently reviewed release-candidate repair, not an unrelated test cleanup.

Evidence

  • Before: the two wire cases passed on source-only Node 24.19.0. Reusing the original frozen build reproduced both zero-request failures; error context established that the synthetic model request had escaped to a real endpoint.
  • After, final PR head: both wire contracts pass on Node 24.19.0 with the same original built runtime present. Canonical agents-root and agents-other type graphs, formatting, and diff checks pass. Reviewed three-file postimages remain byte-identical after rebasing.
  • Retained genuine-provider proof: 39/39 cases passed on September 17 at 06:01 UTC, including both loopback cases and genuine provider prompt, file-read, and image probes. That run used the reviewed postimages on original frozen source e60f19292fbfe707355cb60b0b8cf15a4c19a833 with CI artifact 10481317411, whose manifest targets the same source and Node 24.19.0. This is retained focused evidence, not a new full release qualification.
  • Final reviewed files also passed lint with zero warnings/errors and the line-cap and assertion-safety ratchets. No retries, larger timeouts, weaker assertions, or expectation waivers were introduced.
  • Hosted PR checks are separate from these local results; they are not claimed complete at publication.
Focused commands and dependency provenance
# Node 24.19.0; real loopback HTTP, no external model sweep
CI=1 OPENCLAW_LIVE_TEST=0 OPENCLAW_LIVE_MODELS='' OPENCLAW_VITEST_MAX_WORKERS=1 \
  node --import ./scripts/tsx.mjs scripts/test-live.mts -- \
  src/agents/models.profiles.live.test.ts -t 'live model probe session wire contract'
# 2 passed; 37 unrelated cases not selected

node scripts/run-tsgo.mjs -b \
  test/tsconfig/tsconfig.core.test.agents-root.json \
  test/tsconfig/tsconfig.core.test.agents-other.json --builders 1
# exit 0

The exact accepted prerequisite head ee245a6398bffb09efc903faccdc7995abe69a66 and its merged commit b466d221071cd72d48c26aafa1fdb8da94fa597b have the same Git tree. The original e60 branch, pre-stack repair, exact-prerequisite stack, and original proof are preserved locally. Only the reviewed repair was rebased onto the already-merged prerequisite; neither the prerequisite nor release branch was modified by this publication.

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 17, 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 agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 2:46 AM ET / 06:46 UTC.

ClawSweeper review

What this changes

The live model test suite uses an isolated provider registry so built plugins cannot divert its loopback requests, while preserving timeout handling and improving failure diagnostics.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused release-candidate repair remains useful, preserves the wire assertions, and has relevant before/after evidence. No blocking defect was found; the protected maintainer label also rules out automatic closure.

Priority: P2
Reviewed head: 8dcf26cfc50c980367c9c7d267ff9cc22d87c8d4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair using existing runtime factories, with relevant before/after evidence and no identified blocking defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured body records both production-adapter loopback contracts passing at the final head on Node 24.19.0 with the original built runtime retained, after both failed before the repair; the inspected fixture checks requests, responses, headers, ordering, and HTTP cancellation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured body records both production-adapter loopback contracts passing at the final head on Node 24.19.0 with the original built runtime retained, after both failed before the repair; the inspected fixture checks requests, responses, headers, ordering, and HTTP cancellation.
Evidence reviewed 9 items Introduced change and ownership: The verified merge-base-to-head delta changes only the live test and its support modules. Model preparation, completion dispatch, and custom Ollama registration now share the isolated registry; the existing timeout timers and cleanup remain.
Existing isolation contract: The in-repository @openclaw/ai package documents isolated runtimes. Its default runtime uses a process-global symbol, whereas the transport host is module-local; built-in registration replaces registry entries. These owners support the reported duplicated-package mechanism and the chosen existing factory API.
Meaningful retained wire coverage: The complete wire fixture uses real loopback HTTP and production adapters for OpenAI completions and Anthropic messages. It verifies received requests, response text, header precedence, callback ordering, input preservation, and cancellation of a held response. The introduced assertion change only adds error context.
Findings None None.
Security None None.

How this fits together

OpenClaw’s direct-model qualification suite sends completion probes through model-provider adapters. Its loopback tests check request routing, headers, callbacks, and cancellation before qualification relies on genuine provider calls.

flowchart TD
  A[Model and probe options] --> B[Isolated provider registry]
  B --> C[Configure transport host]
  C --> D[Prepare model and headers]
  D --> E[Provider adapter]
  E --> F[Loopback server or live provider]
  F --> G[Response and wire assertions]
  D --> H[Timeout and cancellation]
  H --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +24. Total +24 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 78 54 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 78 54 +24

Review metrics

None.

Technical review

Best possible solution:

Keep the direct-model sweep on one isolated registry while retaining production transport preparation and the existing real-HTTP assertions.

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

Yes for the reported release-candidate setup: the body records failure with frozen built artifacts and success after the fix, and source supports the shared-registry mechanism. This read-only review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. The patch reuses the existing isolated-runtime API, aligns custom registration with completion dispatch, and preserves the meaningful wire checks without changing production contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a bounded internal qualification failure without changing installed runtime behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body records both production-adapter loopback contracts passing at the final head on Node 24.19.0 with the original built runtime retained, after both failed before the repair; the inspected fixture checks requests, responses, headers, ordering, and HTTP cancellation.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured body records both production-adapter loopback contracts passing at the final head on Node 24.19.0 with the original built runtime retained, after both failed before the repair; the inspected fixture checks requests, responses, headers, ordering, and HTTP cancellation.

Label justifications:

  • P2: This repairs a bounded internal qualification failure without changing installed runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured body records both production-adapter loopback contracts passing at the final head on Node 24.19.0 with the original built runtime retained, after both failed before the repair; the inspected fixture checks requests, responses, headers, ordering, and HTTP cancellation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records both production-adapter loopback contracts passing at the final head on Node 24.19.0 with the original built runtime retained, after both failed before the repair; the inspected fixture checks requests, responses, headers, ordering, and HTTP cancellation.

Evidence

What I checked:

  • Introduced change and ownership: The verified merge-base-to-head delta changes only the live test and its support modules. Model preparation, completion dispatch, and custom Ollama registration now share the isolated registry; the existing timeout timers and cleanup remain. (src/agents/test-helpers/live-model-completion-runtime.test-support.ts:16, 8dcf26cfc50c)
  • Existing isolation contract: The in-repository @openclaw/ai package documents isolated runtimes. Its default runtime uses a process-global symbol, whereas the transport host is module-local; built-in registration replaces registry entries. These owners support the reported duplicated-package mechanism and the chosen existing factory API. (packages/ai/src/internal/default-runtime.ts:13, 8dcf26cfc50c)
  • Meaningful retained wire coverage: The complete wire fixture uses real loopback HTTP and production adapters for OpenAI completions and Anthropic messages. It verifies received requests, response text, header precedence, callback ordering, input preservation, and cancellation of a held response. The introduced assertion change only adds error context. (src/agents/test-helpers/live-model-completion-wire.test-support.ts:182, 8dcf26cfc50c)
  • Captured after-fix evidence: The supplied complete PR body, captured under sourceRevision 27258459c9f221430cd536cb0c3cca7498b0f1244c36e902b2971ae75be74d55, reports both wire cases failing with the original frozen build and passing at the final head on Node 24.19.0 with that build retained. It includes focused terminal command/result text and separately reports a retained 39/39 genuine-provider run. These are contributor-recorded results, not executions performed by this review. (8dcf26cfc50c)
  • Current main still uses the shared registry: The fetched main implementation prepares and dispatches live completions through the default registry. Its separate session-identity work does not implement this registry-isolation repair. (src/agents/models.profiles.live.test.ts:1314, 8b9739cc48c0)
  • Latest-release comparison: Source fetched at the supplied v2026.9.4 release SHA also retains defaultApiRegistry in the live completion helper; this repair is not established as shipped there. (src/agents/models.profiles.live.test.ts:1333, 3a9d69db306c)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@RomneyDa
RomneyDa merged commit 58a66d7 into release/2026.9.5 Sep 17, 2026
156 checks passed
@RomneyDa
RomneyDa deleted the fix/release95-live-stacked-20260917T0633 branch September 17, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR 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.

2 participants