Skip to content

refactor(openrouter): isolate native Decision request policy - #188235

Merged
vincentkoc merged 2 commits into
mainfrom
refactor/decision-10-openrouter-protocol
Oct 31, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
refactor/decision-10-openrouter-protocol

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

OpenRouter native Decision wire translation and input restrictions are mixed with routing configuration and HTTP execution.

User Impact

No user-visible behavior or configuration change. Part 10 of the Decision refactor stack, based on part 09.

Why This Change Was Made

Move native model/input checks, request framing, and result decoding into one plugin-local codec. Keep routing and inherited privacy merging in the adapter. Migrate both private model-predicate callers directly; no compatibility wrapper or SDK export is needed.

Three production files, +107/-80 lines. Existing provider/index/catalog/System One and registered integration tests are retained; the fixture includes the new module.

Evidence

  • Independent fresh source review and local committed-range ClawSweeper review completed with no unresolved actionable findings. Corrective changes were reviewed separately; mechanical restacks were checked with git range-diff.
  • Exact-head ordinary CI passed at 6c1a53e6980dfeb61f5f426edf8d2479ddf8e231, including the configured runtime, type, lint and guard lanes.
  • Aggregate production build passed at final production head 5b235dd694af030aeb75e1ec6e831b71ce4b745c. Shared SDK source-audit evidence, the advisory API-report timeout and broader manual-campaign limitations are recorded in part01.
  • Pinned local formatting, limited standalone lint, content hooks and diff checks passed. Local dependencies failed qualification, so no local project runtime pass is claimed.

Landing update

Current head: 94d220f4e1d0c35e91d5891765daff3442817515; current-head CI passed at 94d220f4e1d0c35e91d5891765daff3442817515. Native landing targets main after the preceding slice merged. The own-slice commit range is patch-identical after replay onto verified landed part08 dda109cacbbefd3a6dfcc442ac97e2107b6c62c8. This resolves the part09 squash-ancestry conflict and gives fresh CI a protected-main baseline. All16 replayed ranges were checked with git range-diff and valid commit signatures. Prior CI is historical evidence at its recorded head; native review, preparation and merge checks remain required.

Earlier landing evidence

Conflict-driven restack against main fdba74e2a71. First landing head: defb3853cf56e6efd78340cba45f1f16fbd0901a. Prior CI/build evidence above records the earlier heads; previous landing-head CI is pending. The slice is patch-identical to its previously reviewed implementation; its ancestry now preserves the current main reconciliation.

Restack after part01 landed

Part01 merged as e5b24c1b164a1a57f49e80f676a99f5dd96db865. Main-targeted part02 then exposed a stacked squash ancestry conflict before merge dispatch. Replaying its commits onto pinned main 3d7b4c47e9c8eab5c10dc98e9d9c6d316dc9c7c2 and restacking the suffix resolved it without code edits. Every commit patch remains identical by git range-diff; the allocation guard passes. Earlier head: 44028d8eb1d26784d141334c1c2d0bddd4f2d1b2; that head's CI is pending. Earlier CI above remains historical evidence.

@vincentkoc vincentkoc self-assigned this Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review October 30, 2026 10:04
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves OpenRouter Decision model eligibility, input restrictions, request framing, and result decoding into a plugin-local codec.

Example: A Boolean decision uses typesafe/jev-1.13 with the instruction “Is this urgent?”

  • Before: The provider adapter translates the Boolean question to the native noul format and validates the returned probability.
  • After: The extracted codec performs the same translation and validation, with the same user-visible result.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-verified extraction with passing exact-head CI and no findings; runtime evidence is limited to the retained test boundary.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; retained adapter and registered-plugin tests cover the moved behavior, while historical live evidence does not prove execution of this head.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: Maintainer authorship supplies direction for this focused separation of provider policy from transport, with no new public contract or product choice.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a coherent, maintainer-authored refactor with no introduced correctness or security defect found, and exact-head CI passes.

Priority: P3
Reviewed head: 6c1a53e6980dfeb61f5f426edf8d2479ddf8e231

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No current-head shipped-entry-point Decision trace is supplied; retained integration tests and green CI support the refactor but do not establish a live provider run.
Agent review details

How this fits together

The OpenRouter plugin receives prepared Decision batches and model context from the host, applies provider-specific restrictions and routing, sends guarded System One HTTP requests, and returns validated outcomes and usage.

flowchart LR
  A[Decision host] --> B[OpenRouter adapter]
  B --> C[Plugin local codec]
  C --> D[Shared System One codec]
  B --> E[Guarded HTTP transport]
  E --> F[OpenRouter System One]
  F --> C
  C --> A
Loading

Technical review

Best possible solution:

Retain one plugin-local codec for native policy and translation while the existing adapter continues to own routing and guarded transport.

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

No user-facing bug is claimed; source comparison supports the stated behavior-preserving extraction, and no target code was executed during this review.

Is this the best way to solve the issue?

The extraction establishes a focused native-policy owner, reuses shared encoding and validation, migrates all predicate callers, and removes the replaced implementation without compatibility machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +27. Total +27 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 107 80 +27
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 107 80 +27

Labels

Label changes:

  • add P3: This is an internal ownership refactor with no intended user-visible behavior or configuration change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is an internal ownership refactor with no intended user-visible behavior or configuration change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 30, 2026, 6:18 AM ET / 10:18 UTC.

@vincentkoc
vincentkoc force-pushed the refactor/decision-10-openrouter-protocol branch from 6c1a53e to defb385 Compare October 30, 2026 13:37
@vincentkoc
vincentkoc force-pushed the refactor/decision-09-liquid-execution branch 2 times, most recently from 0e38dad to 15f8b35 Compare October 30, 2026 13:58
@vincentkoc
vincentkoc force-pushed the refactor/decision-10-openrouter-protocol branch from defb385 to 44028d8 Compare October 30, 2026 13:58
@vincentkoc
vincentkoc force-pushed the refactor/decision-09-liquid-execution branch from 15f8b35 to 32fb243 Compare October 30, 2026 14:22
@vincentkoc vincentkoc closed this Oct 31, 2026
@vincentkoc vincentkoc reopened this Oct 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: openai extensions: liquid-ai Plugin: liquid-ai size: XL and removed size: S labels Oct 31, 2026
@vincentkoc
vincentkoc force-pushed the refactor/decision-10-openrouter-protocol branch from 44028d8 to 196c913 Compare October 31, 2026 02:19
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation agents Agent runtime and tooling extensions: openai extensions: liquid-ai Plugin: liquid-ai size: XL labels Oct 31, 2026
@vincentkoc
vincentkoc changed the base branch from refactor/decision-09-liquid-execution to main October 31, 2026 03:03
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: openai extensions: liquid-ai Plugin: liquid-ai size: XL and removed size: S labels Oct 31, 2026
@vincentkoc
vincentkoc force-pushed the refactor/decision-10-openrouter-protocol branch from 196c913 to 94d220f Compare October 31, 2026 03:06
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed docs Improvements or additions to documentation extensions: openai size: XL labels Oct 31, 2026
@vincentkoc
vincentkoc merged commit 70ceaa1 into main Oct 31, 2026
119 of 120 checks passed
@vincentkoc
vincentkoc deleted the refactor/decision-10-openrouter-protocol branch October 31, 2026 03:22
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…w#188235)

* refactor(liquid-ai): separate Decision preparation and execution

* refactor(openrouter): isolate native Decision request policy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: liquid-ai Plugin: liquid-ai extensions: openrouter P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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