Skip to content

fix(clawrouter): allow granted Luna utility chat routes - #183779

Merged
roboclaw-bot merged 6 commits into
mainfrom
openclaw/fix-clawrouter-luna-chat-183757
Oct 25, 2026
Merged

roboclaw-bot merged 6 commits into
mainfrom
openclaw/fix-clawrouter-luna-chat-183757

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #183757

What Problem This Solves

Fixes session-observer and other utility preparation rejecting credential-granted ClawRouter Luna Responses routes as chat-unsupported.

User Impact

A compatible conversational route discovered for the selected ClawRouter credential can be used as the utility model. Decision-only or incompatible discovery still cannot enable chat, and changing the endpoint or API does not transfer the discovered capabilities. The static Luna declaration remains chat-disabled; native Decisions keeps its existing per-call grant checks.

This does not deploy or reconfigure a Gateway. Existing cached discovery rows need the normal catalog refresh to acquire the explicit capability metadata.

Why This Change Was Made

ClawRouter discovered conversational transports without an explicit inference contract. Registry/configured projections discarded that contract, while captured and full catalog assembly could retain or overlay the static typed-only prohibition. The completion resolver then rejected the model before sending inference.

Emit the discovered route's explicit chat contract, preserve it through registry/configured preparation, and treat static inference as a default only when no independently discovered contract exists for the exact physical route. Luna's existing typed Decisions descriptor has one shared owner rather than a copied definition. No new user configuration, cache, or authorization mechanism is introduced.

Reported by @hannesrudolph in #183757.

Work sessions

Evidence

  • Reproduced against unmodified upstream main 65e5bd922b8a6c9180a7342678bc709af4451e39: real bundled ClawRouter discovery returned Luna, then utility completion preparation failed with Model clawrouter/openai/gpt-6-luna does not support chat inference.
  • The fixed regression passes through credential-scoped discovery, registry materialization, captured and refreshed catalog assembly, the utility selector, and the real simple-completion resolver. It preserves chat + Decisions and rejects decision-only credentials, incompatible transports, endpoint changes, and API changes. Synthetic credentials and fixed HTTP fixtures only; no reporting-Gateway credential was retrieved or copied.
  • 176 focused tests passed across model catalog/inference, configured preparation, provider merging, ClawRouter discovery, and runtime hooks.
  • Retained-data compatibility is exercised with the generated-catalog representation from stable v2026.10.7 (157d8c2bc3ea2fa183afdc11088e69690bf8e64e): rows without inference metadata remain readable and do not invent a chat grant. Credential-scoped discovery refresh then supplies the explicit grant; the real utility Responses transport completes OK through an owned HTTP/SSE fixture with the expected endpoint, model and credential. Persisted utility settings remain byte-identical.
  • Initial CI exposed two missing extracted-wrapper imports from the required projection extraction. The inventory now includes both exact modules; the unchanged wrapper-closure and native-provisioning suites fail before this correction and pass afterward (34 passed, 3 existing host-specific skips). No test guard or expectation was weakened.
  • Independent autoreview (GPT-6.1 Sol, P0–P2): scoped-clean; no actionable findings. Review covered discovery propagation and route/credential isolation. This proves the preparation/retained-reader/refresh boundary and real utility transport with synthetic HTTP/SSE, not observer scheduling, a full Gateway binary upgrade, or a new authenticated upstream call.
  • pnpm build completed successfully; targeted core, ClawRouter, and agent-test typechecks, touched-file lint/format, and git diff --check passed. The build also emitted a Control UI startup gzip budget warning (270698 B versus 270679 B); no UI source is changed, and required PR CI remains authoritative.

Simplification: reuse the existing inference contract and route matching; share the existing Decisions declaration. Configured-row projection moved into the existing catalog-entry owner because the selection module cannot grow under the repository line-cap ratchet; no parallel implementation or compatibility wrapper remains. One integration regression covers startup and refresh boundaries. Production code/descriptor delta: +124/-47 lines across nine files, including the required projection extraction and its wrapper inventory; test delta: +360 lines.

Worked on by

roboclaw-bot and others added 2 commits October 25, 2026 18:53
Preserve route-bound discovery inference through registry and prepared catalog assembly without promoting static typed-only rows.

Co-authored-by: hannesrudolph <[email protected]>
Worked on by:
- @hannesrudolph

Co-authored-by: hannesrudolph <[email protected]>
OpenClaw-Publication: 03b3f696-9679-4915-a084-561cedf70f31
@clawsweeper

clawsweeper Bot commented Oct 25, 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 extensions: clawrouter Extension: clawrouter size: M labels Oct 25, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 25, 2026 18:57
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) October 25, 2026 19:04
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@roboclaw-bot
roboclaw-bot disabled auto-merge October 25, 2026 19:10
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR preserves discovered chat capabilities through ClawRouter model preparation while retaining route-specific restrictions.

Example: Use clawrouter/openai/gpt-6-luna as the utility model with a credential granting its Responses route.

  • Before: Preparation rejects the model with “does not support chat inference.”
  • After: The matching discovered route passes preparation; decision-only credentials and changed routes remain rejected.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful repair with meaningful preparation coverage, but a confirmed provisioning regression and an unproven retained-catalog upgrade prevent approval.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Session-observer utility preparation rejects a working, credential-granted ClawRouter Luna route and disables assessments after repeated failures.
Reason: Maintainer-authored direction restores the documented independent-discovery contract without adding settings or changing static Decisions eligibility.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this PR addresses a documented capability-propagation bug, but its new import breaks extracted PR-wrapper provisioning.

Priority: P2
Reviewed head: a18b7625bbe6f22d92b2c4f03ea3d2b8cb9f3725

Before merge

  • [P2] Include the extracted projection dependencies in the PR wrapper (P2) - This import adds model-catalog-entry.ts and its model-serving-context.ts dependency to the runtime closure of the extracted PR wrapper, but scripts/pr-lib/wrapper-components.txt contains neither file. Cold scripts/pr review-init provisioning therefore exits with ERR_MODULE_NOT_FOUND before completing. Exact-head CI independently reports this failure in the import-closure and provisioning suites. Add both modules to the existing inventory so the extracted wrapper remains runnable.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] [P2] Include the extracted projection dependencies in the PR wrapper — src/agents/model-selection-shared.ts:25

Tests

  • Missing end-to-end proof: The PR owner should show a latest-stable upgrade with retained catalogs and settings, followed by catalog refresh and successful Luna utility execution; the supplied fresh-catalog regression does not cover that transition.
Agent review details

How this fits together

ClawRouter discovery supplies credential-scoped model metadata to the registry and prepared catalogs, which utility completion uses before resolving authentication and dispatching inference.

flowchart LR
  A[Credential scoped catalog] --> B[ClawRouter discovery]
  B --> C[Model registry]
  D[Static declarations] --> E[Prepared catalog]
  C --> E
  E --> F[Utility completion preparation]
  F --> G[Authenticated Responses transport]
Loading

Technical review

Best possible solution:

Retain the route-bound capability repair and complete its existing PR-wrapper dependency inventory.

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

The linked report provides matching runtime rejection and successful Responses controls, while source inspection establishes the discovery-to-chat-guard failure; no target code was executed during this review.

Is this the best way to solve the issue?

The repair uses the existing inference contract and route-matching owners, preserves typed-only rejection, and avoids globally enabling the static Luna declaration.

Full review comments:

  • [P2] [P2] Include the extracted projection dependencies in the PR wrapper — src/agents/model-selection-shared.ts:25
    This import adds model-catalog-entry.ts and its model-serving-context.ts dependency to the runtime closure of the extracted PR wrapper, but scripts/pr-lib/wrapper-components.txt contains neither file. Cold scripts/pr review-init provisioning therefore exits with ERR_MODULE_NOT_FOUND before completing. Exact-head CI independently reports this failure in the import-closure and provisioning suites. Add both modules to the existing inventory so the extracted wrapper remains runnable.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test test/scripts/eager-import-closure.test.ts
  • pnpm test test/scripts/pr-worktree-provision.test.ts
  • git diff --check

What I checked:

PR surface

Source +75, Tests +223. Total +298 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 8 122 47 +75
Tests 1 223 0 +223
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 345 47 +298

Review metrics

Metric Value Why it matters
Production versus test changes Production +122/-47; tests +223 Growth carries inference through existing owners and extracts the configured projection; one integration regression covers distinct credential, transport, and route boundaries.

Labels

Label changes:

  • add P2: The repair restores a configured utility-model workflow while ordinary Gateway operation remains available.
  • add merge-risk: 🚨 automation: The new model-selection import leaves the extracted maintainer PR wrapper incomplete and breaks cold provisioning.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The repair restores a configured utility-model workflow while ordinary Gateway operation remains available.
  • merge-risk: 🚨 automation: The new model-selection import leaves the extracted maintainer PR wrapper incomplete and breaks cold provisioning.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 execution lanes are retired.

Reviewed October 25, 2026, 3:13 PM ET / 19:13 UTC.

roboclaw-bot and others added 2 commits October 25, 2026 19:20
Include the two newly reachable catalog modules in the trusted wrapper inventory so extracted native PR provisioning can resolve the configured-row projection.

Co-authored-by: hannesrudolph <[email protected]>
Worked on by:
- @hannesrudolph

Co-authored-by: hannesrudolph <[email protected]>
OpenClaw-Publication: 2f08df11-ccdc-49dc-a219-145cc2bbda9a
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 25, 2026
roboclaw-bot and others added 2 commits October 25, 2026 19:41
Load the latest-stable generated catalog shape without inference metadata, preserve retained settings through credential-scoped refresh, and exercise the actual Responses completion transport with synthetic HTTP/SSE fixtures.

Co-authored-by: hannesrudolph <[email protected]>
Worked on by:
- @hannesrudolph

Co-authored-by: hannesrudolph <[email protected]>
OpenClaw-Publication: 085b3e03-fec9-4455-933a-5e81acd845f7
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@roboclaw-bot
roboclaw-bot merged commit cb3bb04 into main Oct 25, 2026
140 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fix-clawrouter-luna-chat-183757 branch October 25, 2026 20:20
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
)

* fix(clawrouter): allow granted Luna utility chat routes

Preserve route-bound discovery inference through registry and prepared catalog assembly without promoting static typed-only rows.

Co-authored-by: hannesrudolph <[email protected]>

* fix(clawrouter): allow granted Luna utility chat routes

Worked on by:
- @hannesrudolph

Co-authored-by: hannesrudolph <[email protected]>
OpenClaw-Publication: 03b3f696-9679-4915-a084-561cedf70f31

* fix(build): preserve PR wrapper catalog projection imports

Include the two newly reachable catalog modules in the trusted wrapper inventory so extracted native PR provisioning can resolve the configured-row projection.

Co-authored-by: hannesrudolph <[email protected]>

* Publish openclaw/fix-clawrouter-luna-chat-183757

Worked on by:
- @hannesrudolph

Co-authored-by: hannesrudolph <[email protected]>
OpenClaw-Publication: 2f08df11-ccdc-49dc-a219-145cc2bbda9a

* test(clawrouter): preserve retained catalog utility execution

Load the latest-stable generated catalog shape without inference metadata, preserve retained settings through credential-scoped refresh, and exercise the actual Responses completion transport with synthetic HTTP/SSE fixtures.

Co-authored-by: hannesrudolph <[email protected]>

* Publish openclaw/fix-clawrouter-luna-chat-183757

Worked on by:
- @hannesrudolph

Co-authored-by: hannesrudolph <[email protected]>
OpenClaw-Publication: 085b3e03-fec9-4455-933a-5e81acd845f7

---------

Co-authored-by: hannesrudolph <[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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. extensions: clawrouter Extension: clawrouter scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ClawRouter Luna utility calls rejected as chat-unsupported despite granted working Responses route

1 participant