Skip to content

refactor(decisions): isolate SDK transport from host bundles - #189404

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/inference-x37-decision-runtime-imports
Oct 31, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/inference-x37-decision-runtime-imports

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Related: #188252

What Problem This Solves

The OpenAI-compatible Decision SDK entry imports broad host and extension bundles for two operations already owned by smaller modules.

User Impact

Decision execution and the public SDK contracts remain unchanged. The SDK entry can load and execute without initializing those two broad bundles. Bundled providers still retain their own other host imports; this makes no whole-provider startup claim.

Why This Change Was Made

Import request-transport projection and timeout construction directly from their existing owners. Keep the public entry, prepared-context compatibility adapter, executor, authentication, authority, deadlines, HTTP guards and result translation intact. Retain both broad public barrels for their other consumers.

The existing SDK test gains an independent cold-entry case while retaining its codec and type assertions. Its30 added lines have a separate30-line allocation; production line count is unchanged.

Evidence

  • With the same committed cold-entry test and the pinned baseline production file, execution fails at the old host-harness import. Restoring the candidate removes that failure. All64 candidate tests across the SDK, OpenAI and Clawrouter suites pass (60.733s).
  • Core and SDK test types, targeted production/test lint, formatting, whitespace checks, normal signed hooks and the test-line ratchet passed. Public SDK export checks passed; exported names and signatures are unchanged.
  • The normal full pnpm build passed (237.937s), including declarations, runtime/plugin outputs and UI. No reduced build profile or skipped phases were used.
  • A fresh Node process imported the actual built public SDK subpath and completed one guarded request against an owned ephemeral loopback server. Independent assertions checked method/path, authorization, complete JSON body and served-model/answer/token output. The server was closed; no live provider or paid API was called.
  • Fresh independent full-range review against the pinned base found no actionable correctness or security findings (confidence0.94).

Broad exact-head PR CI remains required. These are cold-boundary and behavior proofs, not measured startup-latency or memory claims.

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

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

@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 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR imports two Decisions transport helpers directly from their existing owners instead of broad SDK facades.

Example: Load the standalone Decisions executor and evaluate a Boolean question without an API key.

  • Before: Loading the executor also imports the host-harness and extension-helper facades before returning credentials-unavailable.
  • After: The executor imports the helpers directly and retains the credentials-unavailable result.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is small and coherent, but current-head runtime, type and package validation have not been established.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored refactor is outside the ordinary contributor proof gate; its explicitly declared SDK build and compiled cold-entry validation remain unfulfilled and are tracked in testingReview.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Partial
User problem: Standalone SDK consumers load unrelated host bundles to obtain two transport helpers.
Reason: The maintainer-authored change follows the linked campaign's direction, uses existing owners and preserves supported SDK behavior; Related correctly describes its limited campaign scope.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: the focused import substitution preserves existing owners and contracts, and no introduced correctness defect was found.

Priority: P3
Reviewed head: d032adfc8674a05537fa4a3978a8363568ac1e08

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The declared compiled SDK cold-entry validation, base-failing/head-passing import regression, build and affected OpenAI/ClawRouter suite results remain pending.
Agent review details

How this fits together

The shared Decisions SDK executor accepts prepared provider credentials, transport settings, deadlines and admission checks, sends guarded HTTP requests, and returns typed outcomes to OpenAI-compatible providers.

flowchart TD
  A[Provider or SDK caller] --> B[Decisions executor]
  C[Request transport owner] --> B
  D[Timeout owner] --> B
  B --> E[Guarded HTTP transport]
  E --> F[Decisions endpoint]
  F --> G[Typed outcome]
Loading

Technical review

Best possible solution:

Retain the two direct imports and focused boundary regression, then complete the already-declared SDK validation before landing.

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

Source inspection confirms the two broad import edges on current main; this refactor does not report a separate runtime failure, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

The smallest complete change is the proposed import substitution: keep helper identity and execution semantics intact while removing the unnecessary facade edges.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Pinned change: The introduced production diff only substitutes two import sources; executor logic and public exports remain unchanged. (src/plugin-sdk/decisions-openai-runtime.ts:2, d032adfc8674)
  • Existing helper identity: The harness facade re-exports getModelProviderRequestTransport from agents/provider-request-config, and extension-shared re-exports buildTimeoutAbortSignal from utils/fetch-timeout; this PR uses those same implementations. (src/plugin-sdk/agent-harness-runtime.ts:377, d032adfc8674)
  • Current main still has the broad imports: Fetched main retains both facade imports, so this PR's central dependency reduction is not already implemented there. (src/plugin-sdk/decisions-openai-runtime.ts:12, 40b332d1a8a9)
  • Distinct import-boundary regression: Throwing isolation mocks reject loading either unrelated facade while the real executor returns its existing missing-credential outcome; this does not exercise successful HTTP execution or compiled packaging. (src/plugin-sdk/decisions.test.ts:14, d032adfc8674)
  • SDK verification contract: The complete SDK policy requires pnpm build for import-topology changes; no applicable maintainer-notes directory or additional config ancestor policy was present. (src/plugin-sdk/AGENTS.md:45, d032adfc8674)
  • Validation remains pending: The full live body explicitly leaves runtime tests, types, lint, SDK build, API checks, base/head regression execution and compiled cold-entry proof pending; discussion supplies no additional behavior evidence. (d032adfc8674)

Likely related people:

  • Vincent Koc: Raw commit f01f183 adds src/plugin-sdk/decisions-openai-runtime.ts:31 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f01f18384b9d; files: src/plugin-sdk/decisions-openai-runtime.ts)

PR surface

Source 0, Tests +30, Other +1. Total +31 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 31 1 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 3 34 3 +31

Review metrics

Metric Value Why it matters
Production versus test LOC Production net 0; tests net +30 Production changes replace imports without adding machinery; the test growth protects a distinct SDK loading boundary.

Labels

Label changes:

  • add P3: This is a focused behavior-preserving dependency cleanup without an established urgent user-facing failure.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a focused behavior-preserving dependency cleanup without an established urgent user-facing failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the declared SDK build, compiled cold-entry validation and focused regression suites on the reviewed head.

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 31, 2026, 9:20 AM ET / 13:20 UTC.

@vincentkoc
vincentkoc marked this pull request as ready for review October 31, 2026 13:37
@vincentkoc
vincentkoc enabled auto-merge (squash) October 31, 2026 13:40
@vincentkoc
vincentkoc merged commit 7485abc into main Oct 31, 2026
204 of 205 checks passed
@vincentkoc
vincentkoc deleted the refactor/inference-x37-decision-runtime-imports branch October 31, 2026 13:46
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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