Skip to content

refactor(decisions): separate OpenAI protocol from guarded execution - #188228

Merged
vincentkoc merged 4 commits into
mainfrom
refactor/decision-06-openai-protocol
Oct 31, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
refactor/decision-06-openai-protocol

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The shared OpenAI-compatible Decision helper mixes wire translation with a broad prepared host context and guarded HTTP execution.

User Impact

Provider behavior and the two existing SDK functions remain supported. This adds an explicit prepared-input executor on the existing SDK subpath; no new subpath, dependency, or configuration is introduced. Part 06 of the maintainer-directed stack, based on part 05.

Why This Change Was Made

Move protocol support, request encoding, and response decoding into a dependency-light Decision codec. Keep guarded execution in the existing SDK family runtime, with explicit route, auth, transport, and lifetime inputs. The supported context-based helper delegates to that executor. Existing HTTP boundary tests retain their interception point.

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 cb577ec3e0daee4a81dcc83cc402759ae9f3080c, 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: 85390caf12cfbdcfb39890af776f3b4b90465e3f; current-head CI passed at 85390caf12cfbdcfb39890af776f3b4b90465e3f. Native landing targets main after the preceding slice merged. After part04 landed, the remaining stack was replayed onto its actual protected-main commit 63dbee6a514580948082dc20cb930c7e748c019e to resolve the named CI/base-context gap in part05. All 20 commit ranges remain patch-identical by git range-diff; the allocation guard passes. Earlier CI/build evidence above remains historical. Each slice lands through the native main-targeted review, preparation, and merge workflow after its predecessor.

Earlier required-gate interruption

CI41071228246 failed its required aggregate job124119194233. The check annotation states check-lint-hosted-core-shard finished with abandoned (selected=true). Its missing check-lint-core-2 job/check124117307936 still projects queued, with no completion or annotations. The inspected56-job page contains24successful jobs and no failed test/lint/type shard; coverage for the missing lint shard is unproven. The failure classifier says the jobs have not all completed. The initiating platform condition remains unlocalized; no rerun or inherited-failure exception is claimed.

@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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: L labels Oct 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 30, 2026 09:48
@vincentkoc
vincentkoc force-pushed the refactor/decision-06-openai-protocol branch from 99fb786 to cb577ec Compare October 30, 2026 09:57
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR extracts the OpenAI Decisions codec and adds an explicit prepared-input executor while preserving the existing SDK helper.

Example: Evaluate a Boolean question about a damaged parcel.

  • Before: The context-based helper encodes the request, performs guarded HTTP execution, and decodes the probability.
  • After: The same helper delegates execution to the new executor, which uses the extracted codec and returns the same probability.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent, with green current-head CI; runtime proof and the explicitly required build/API validation remain limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor-proof gate and does not materially change authority; source comparison and green CI support it, but no live execution artifact is supplied.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction separates protocol translation from execution dependencies, has a concrete follow-up consumer, and preserves existing behavior.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored refactor open: the extraction preserves existing behavior, and no actionable code defect was found.

Priority: P3
Reviewed head: cb577ec3e0daee4a81dcc83cc402759ae9f3080c

Before merge

  • Complete next step - Complete pnpm build and the SDK export/API validation for cb577ec.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped-entry-point run exercises an OpenAI or ClawRouter Decision after this extraction.
Agent review details

How this fits together

OpenAI and ClawRouter Decision providers supply prepared route, credentials, transport policy, and lifetime facts to a shared SDK runtime that sends guarded HTTP requests and returns typed answers.

flowchart LR
  A[Decision provider] --> B[Prepared execution inputs]
  B --> C[Shared SDK executor]
  C --> D[OpenAI protocol codec]
  C --> E[Guarded HTTP transport]
  E --> F[Decision endpoint]
  F --> D
  D --> G[Typed outcome]
Loading

Technical review

Best possible solution:

Keep one protocol codec and one guarded executor, retaining the supported context helper as a projection into that executor.

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

No product bug is claimed; source comparison supports the stated extraction without establishing runtime execution.

Is this the best way to solve the issue?

The extraction is coherent and minimal: protocol logic moves once, guarded execution retains ownership, and the existing public helper preserves compatibility.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared protocol and guarded execution keeps the original intent (1217586: feat(clawrouter): support native typed Decisions #178886 established one supported shared OpenAI-compatible implementation for native OpenAI and ClawRouter while preserving prepared transport and authority.)
  • Protocol request bounds keeps the original intent (bf28212: fix(decisions): allow OpenAI batches up to 400 questions #180210 raised the V2 OpenAI batch ceiling to 400; the extracted predicate preserves that limit.)
  • Prepared auth and connection ownership keeps the original intent (621f574: Prepared image Decisions preserved capability-selected routes and request authority; connection reuse was subsequently owned by the guarded provider transport.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Raw commit 1217586 adds src/plugin-sdk/decisions-openai-runtime.ts:335 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 121758697b04; files: src/plugin-sdk/decisions-openai-runtime.ts)

PR surface

Source +48, Docs +7. Total +55 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 291 243 +48
Tests 0 0 0 0
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 298 243 +55

Review metrics

Metric Value Why it matters
Additive SDK surface 1 function and 1 type; no removed exports The prepared-input executor expands the existing public subpath while preserving its previous functions.

Labels

Label changes:

  • add P3: This is a behavior-preserving architectural refactor with no demonstrated user-facing incident.
  • add merge-risk: 🚨 compatibility: The PR adds a public SDK executor and type; the maintainer-authored direction, retained signatures, and documented delegation mitigate compatibility risk.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a behavior-preserving architectural refactor with no demonstrated user-facing incident.
  • merge-risk: 🚨 compatibility: The PR adds a public SDK executor and type; the maintainer-authored direction, retained signatures, and documented delegation mitigate compatibility risk.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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 30, 2026, 6:13 AM ET / 10:13 UTC.

@vincentkoc
vincentkoc force-pushed the refactor/decision-06-openai-protocol branch from cb577ec to 56e8dd6 Compare October 30, 2026 13:37
@vincentkoc
vincentkoc force-pushed the refactor/decision-05-consumer-coordination branch 2 times, most recently from 33fd5fd to b1049a6 Compare October 30, 2026 13:58
@vincentkoc
vincentkoc force-pushed the refactor/decision-06-openai-protocol branch from 56e8dd6 to 1404ebf Compare October 30, 2026 13:58
@vincentkoc
vincentkoc force-pushed the refactor/decision-06-openai-protocol branch from 1404ebf to 85390ca Compare October 30, 2026 14:22
@vincentkoc
vincentkoc force-pushed the refactor/decision-05-consumer-coordination branch from b1049a6 to 0ec7a48 Compare October 30, 2026 14:22
@vincentkoc vincentkoc closed this Oct 31, 2026
@vincentkoc vincentkoc reopened this Oct 31, 2026
Base automatically changed from refactor/decision-05-consumer-coordination to main October 31, 2026 02:35
@vincentkoc
vincentkoc merged commit f01f183 into main Oct 31, 2026
260 of 329 checks passed
@vincentkoc
vincentkoc deleted the refactor/decision-06-openai-protocol branch October 31, 2026 02:41
@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
…penclaw#188228)

* refactor(decisions): centralize scoped consumer execution

* refactor(decisions): keep consumer evaluation receipts opaque

* refactor(decisions): avoid shadowing consumer runtime names

* refactor(decisions): separate OpenAI protocol from guarded execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:feature Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant