Repository navigation
feat(typesafe): support prepared Decision V2 batches - #158565
Conversation
Keep task, protocol, modalities, reasoning, grounding, probability semantics, abstention and route billing distinct without changing chat Model types. Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Preserve V1 while moving typed decision execution, both bundled engines, catalog projection and physical credential ownership onto the shared runtime. Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Keep existing request/auth owners, first-class V1/V2 SDK contracts and actual provider USD precedence. Capture only legitimate effective-route prices; preserve missing usage and the established diagnostic scope. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]>
Preserve v1/v2 chat projections and standalone pricing while adding explicit v3 publication and consumption. Carry the reviewed upstream v2 publisher/wire/pricing prerequisites without rebasing the published stack or changing state-store lifecycle. Preserve source-qualified zeros and qualified tariffs. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]>
Apply only the +14 exports / +6 callables for the existing decisions data contract. Peter Steinberger explicitly approved the complete +18/+6 stack allowance on 2026-09-26; the remaining four execution types belong to the dependent PR. No additional API or guard exception. Co-authored-by: steipete <[email protected]>
Merge the updated data-layer prerequisite without rewriting its history, then allocate only the four approved execution/context types. Total allowance is exactly +18 exports / +6 callables, approved by Peter Steinberger on 2026-09-26. All implementation and generated SDK bytes remain unchanged. Co-authored-by: steipete <[email protected]>
Carry the budget approval from the existing data and execution layers without new surface growth or rewritten public history. Catalog, header/accounting and all other source bytes are unchanged. Co-authored-by: steipete <[email protected]>
Declare the documented versioned hosted route, native token tariff and request limits in the existing manifest. Keep moving aliases and local checkpoints monetarily unknown, reject foreign price fallbacks, and report the actual loopback route through existing normalization before shared accounting. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR connects TypeSafe to prepared Decision V2 execution and adds route-specific capability, limit, and billing metadata while preserving V1 SDK callers. Example: Hosted typesafe/jev-1.13.0 reports 100 input tokens.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review The previous benchmark finding is resolved, and the shared transport fixture retains V2 execution and hostile-input rejection. No actionable introduced defect remains; this maintainer-authored PR still provides work absent from main. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe TypeSafe plugin translates provider-neutral Decision batches and prepared model credentials into guarded System One HTTP requests, then returns validated answers and token usage. flowchart LR
A[Decision SDK caller] --> B[Prepared model runtime]
B --> C[TypeSafe V2 adapter]
C --> D[Existing TypeSafe client]
D --> E[Guarded HTTP transport]
E --> F[Hosted Jev or configured server]
F --> G[Validated answers and usage]
Technical reviewBest possible solution: Use the existing prepared runtime and TypeSafe transport as this PR does, retaining V1 SDK compatibility and route-bound accounting. Do we have a high-confidence way to reproduce the issue? This is a feature integration; source inspection confirms main still registers V1, and supplied qualification exercises the proposed V2 adapter without executing target code during review. Is this the best way to solve the issue? The implementation reuses existing prepared credentials, compatibility codecs, transport, and fixture owners; the simplification review found no unnecessary competing production path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c2fa320046af. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +339, Tests +785, Docs +58, Other +32. Total +1214 across 16 files. Added test files: 3. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 19, 2026, 1:48 PM ET / 17:48 UTC (Revision 5). |
Merge current main and reconcile the original Decision capability metadata with the canonical catalog. Preserve facts for matching hosted routes, clear stale facts on route changes, and retain chat:false. Validated 50 focused tests, planner replay, types, lint, formatting, and full build.
Integrate current model metadata while preserving the original decision-policy ancestry. Apply the reviewed shared completion authorization port without changing its six-file patch. Validated 112 focused tests, targeted typecheck/lint/format, and the strict plugin SDK smoke build. Original PR: #156621
* commit '00d93bb011fd8ac55d72623d1bd9e5bbcdb7d301': fix(models): include inference metadata in extracted tooling
Preserve contributor history while integrating physical credential ownership with the shared model policy. Plugin-owned routes bypass agent profile discovery and agent no-auth substitution; agent-owned routes retain explicit no-auth behavior. Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: steipete <[email protected]>
Baseline-Refresh: 4f6a7bac14a6c931d95e4e48c0dd0fbd1234ff80
|
@clawsweeper re-review Please review exact head 3e56cc2. The registered V2 benchmark correction is preserved; the actual main conflict is resolved through the shared transport fixture owner. Fresh proof:134 shared-helper transport cases +8 benchmark cases, compiled two-request smoke with zero sockets after drain, format/lint/scoped types. Prior authenticated native mixed-batch proof remains at unchanged6ea provider bytes, with provenance and limits in the updated PR body. |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
TypeSafe's prepared Decision V2 catalog (#158565) deliberately declares inference.chat=false and route-specific metadata. Preserve normalization and exact row counts for every bundled model, then validate conversational provider configs only for chat-capable rows, including mixed catalogs. The bundled catalog test now passes; malformed decision metadata and an incomplete chat row in a mixed catalog still fail their respective guards.
* feat: describe decision capabilities in model catalogs Keep task, protocol, modalities, reasoning, grounding, probability semantics, abstention and route billing distinct without changing chat Model types. Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> * fix: apply shared plugin model policy to decisions Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> * feat: support plugin-owned model credentials Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> * feat(decisions): preserve richer answers with versioned data codecs Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> * feat(decisions): run typed tasks with prepared model credentials Preserve V1 while moving typed decision execution, both bundled engines, catalog projection and physical credential ownership onto the shared runtime. Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> * fix(decisions): preserve native headers and route-aware accounting Keep existing request/auth owners, first-class V1/V2 SDK contracts and actual provider USD precedence. Capture only legitimate effective-route prices; preserve missing usage and the established diagnostic scope. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]> * feat(catalog): publish typed decisions on a versioned feed Preserve v1/v2 chat projections and standalone pricing while adding explicit v3 publication and consumption. Carry the reviewed upstream v2 publisher/wire/pricing prerequisites without rebasing the published stack or changing state-store lifecycle. Preserve source-qualified zeros and qualified tariffs. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]> * chore(sdk): record approved Decision V2 data allowance Apply only the +14 exports / +6 callables for the existing decisions data contract. Peter Steinberger explicitly approved the complete +18/+6 stack allowance on 2026-09-26; the remaining four execution types belong to the dependent PR. No additional API or guard exception. Co-authored-by: steipete <[email protected]> * fix(typesafe): estimate pinned hosted Jev token costs Declare the documented versioned hosted route, native token tariff and request limits in the existing manifest. Keep moving aliases and local checkpoints monetarily unknown, reject foreign price fallbacks, and report the actual loopback route through existing normalization before shared accounting. Co-authored-by: vincentkoc <[email protected]> Co-authored-by: steipete <[email protected]> * fix(models): include inference metadata in extracted tooling * fix(decisions): preserve explicit owner-agent selection * fix(decisions): resolve V2 credentials for the operation agent * test(decisions): align accounting fixtures with captured rates Declare free output in estimable native fixtures, keep decimal precision assertions numeric, and mark the injected catalog fetch for the existing hermetic transport guard. Keep the publisher validator bound to its validated bundle type. * fix(decisions): preserve prepared route and auth facts * test(model-catalog): verify retained caches with released readers * test(decisions): handle optional normalized catalog providers * chore(decisions): satisfy scoped runtime lint * fix(model-catalog): keep manifest auth ownership out of published feeds * fix(typesafe): keep decision facts within native contracts * fix(decisions): authorize model identity independently of auth profile * fix(typesafe): declare automatic reasoning capability * fix(auth): retain plugin credential authority through dispatch * fix(decisions): retain credential authority through prepared dispatch * refactor(decisions): assert resolved credential authority directly * test(auth): preserve health probe exports in lifecycle fixture * fix(decisions): distinguish plain record validation * fix(decisions): repair v2 CI integration * fix(decisions): align accounting ratchet evidence * docs(typesafe): clarify prepared V2 release compatibility * test(typesafe): add opt-in native decision validation * test(typesafe): retain prepared runtime in admission fixture * test(typesafe): retain prepared runtime across SDK assertions * fix(typesafe): migrate transport benchmark to Decision V2 * test(typesafe): preserve V2 fixtures through shared transport helpers --------- Co-authored-by: steipete <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: roboclaw-bot <[email protected]>
Keep provider option tags and PCM byte accounting local after openclaw#178002 and openclaw#178011 removed their external consumers. Keep the V1 TypeSafe evaluator local after openclaw#158565 moved registration to V2; exercise its retained cancellation and sanitized-error contract through the existing V2 fixture adapter.
TypeSafe's prepared Decision V2 catalog (openclaw#158565) deliberately declares inference.chat=false and route-specific metadata. Preserve normalization and exact row counts for every bundled model, then validate conversational provider configs only for chat-capable rows, including mixed catalogs. The bundled catalog test now passes; malformed decision metadata and an incomplete chat row in a mixed catalog still fail their respective guards.
What Problem This Solves
Connects TypeSafe to the prepared Decision V2 runtime while preserving V1 SDK callers and route-specific model capabilities.
User Impact
Supported requests use the existing transport with prepared credentials. Hosted billing and token limits apply only to matching routes; custom endpoints do not inherit hosted assumptions. Automatic reasoning is supported; explicit on/off modes remain rejected.
The setup guide and package README distinguish matching V2 source development from packaged support. Released OpenClaw v2026.10.4 is V1-only. Packaged use requires a supporting paired host/plugin release; normal release synchronization aligns plugin API and build metadata.
Current Integration and Proof
Signed head
3e56cc26f889f02d28dc8f45285f8d2e5ac6a639integrates the frozen main revision4ba34fdbb69fc1dbeafd93a2c946e362141ff0beafter GitHub reported actual conflicts in three TypeSafe transport tests. Main had extracted their registration and response/socket fixtures intotransport.test-support.ts; this PR changes registration to V2. The resolution preserves that shared owner and invokes the existing intentional V1 wire-fixture bridge once from the registered V2 helper. Hostile accessor/serializer input still rejects withDecisionContractErrorbefore user code or transport runs. No assertions or production guards were weakened.The native three-conflict successor and signed helper amendment produce the independently reviewed tree
5e4e9c6eb6d00e8cca8f5f11f04ec3ad67e9756e. The final amendment is test-only +4/-4, production unchanged. Provider, API client/transport, manifest, live fixture and the repaired benchmark worker retain their prior reviewed bytes.Fresh proof used frozen merged dependencies on Darwin arm64, Node 26.7.0 and pnpm 12.12.1:
responseBytes=714,socketsAfterPoolClose=0.The remote attempt failed during provider readiness observation before any payload ran; its owned lease was stopped and joined. The documented trusted local fallback supplied the results above. The builder's clean-HEAD requirement and lint's retained build-owner lock were resolved through their normal contracts; only the blocked surfaces resumed, with the 142 passing tests preserved. No Linux result is claimed for this attempt; current-head GitHub CI supplies that broad proof.
Against frozen main, production/tooling is +267/-24 (net +243) across the TypeSafe registration/execution owner and benchmark consumer; tests are +992/-207, counted separately. The growth supplies prepared Decision V2 capability/execution and contract validation plus explicit benchmark lifetime ownership. The registered entrypoint and benchmark no longer use V1 readiness, untagged state or string-only context assumptions. Intentional V1 wire fixtures and codec coverage remain test-only. Sibling coverage includes the generic V1/V2 host integration, registered TypeSafe admission, four transport suites and benchmark fault/drain paths; the authenticated API proof retains its stated structural-response scope.
The earlier Linux benchmark proof remains at 9ed, integration proof at 2784, and authenticated mixed-batch API proof at unchanged 6ea provider bytes, as labeled below. Current-head CI, security and ClawSweeper remain landing gates.
Earlier Benchmark Correction at 9ed9679
Signed head
9ed9679453d200ed29f9ff65ff657b4528b43ad9repairs the registered-transport benchmark consumer exposed by CI run 39238972922 and the exact-2784 ClawSweeper P2. The worker still expected V1 readiness, an untagged state and a string model after this PR registered a V2 provider. This was a PR regression; the failed CI is not waived.The benchmark now obtains validated Kev model facts from the actual manifest through
normalizeModelCatalog, calls the registered auth/transport hooks, passes tagged JSON and a typed V2 context, and owns a concrete active/server/signal/deadline admission predicate. It revokes that lifetime before draining the pool. This preserves the registered-transport component measurement and lazy-client boundary; no Gateway bootstrap or test-only V1 compatibility bridge was added.Only
scripts/bench-decision-transport-worker.tschanges from 2784: production tooling +53/-21 (net +32), tests unchanged. The growth supplies V2 prepared facts and explicit lifecycle ownership. Provider, API client/transport, manifest and live-fixture bytes remain unchanged.Remote proof run 39264381306 verified the exact source tree
1ba69a4413c5862da66b155f1965069d0c8eedf2, which is also the signed 9ed commit tree, with frozen Linux Node 24.19.0/pnpm 12.11.1 dependencies:build-decision-transport-bench.mtsbundle and two-request native smoke passed;socketsAfterPoolClose=0.The complete payload passed before the wrapper reported a cleanup timeout (overall exit 1). Native completion was settled, and the exact owned lease subsequently reported completed with no host. No proof was replayed. The prior 15+1 integration result remains attributed to 2784; authenticated API proof remains attributed to unchanged 6ea provider bytes below. The published 9ed head then encountered actual test-fixture conflicts; the current integration below supersedes that head for landing.
Earlier Integration at 2784c24
Signed head 2784c24 integrates frozen main 7d48769 through the native baseline-successor workflow. The sole conflict was adjacent imports in src/agents/decision-inference.integration.test.ts; both imports and both test groups are preserved. The actual full tree matches the independently reviewed resolution. TypeSafe adapter, client/transport, manifest, live fixture and admission fixture bytes remain identical to 6ea835e; main's package release floors are retained.
Fresh proof on the exact successor, using the native verified source capsule and reconciled Linux Node 24.19.0/pnpm 12.11.1 dependencies:
Remote proof run 39237263780 completed the test/typecheck payload successfully. The overall wrapper returned exit 1 because its subsequent cleanup timed out. The installed wrapper's exact cleanup-success branch and captured streams distinguish that failure from the payload; a separate native status reconciliation confirmed the owned lease completed with no host. No test was replayed.
The authenticated API result below remains attributed to 6ea835e, whose adapter and live fixture are unchanged. The successor requires its own hosted CI and exact-head ClawSweeper review; earlier green CI is not substituted.
Earlier Fixture Correction at 6ea835e
Signed candidate
6ea835ee97442de9122bdad7c438a3fc9e1ead6cintegrates captured maincc271f85709b3bea38fffecfc1c53ebc9a404109while preserving the original contributor ancestry. The admission fixture follows the current provider HTTP interception seam and retains its hermetic discovery, prepared runtime, revocation checks and cleanup.Focused proof exposed a second fixture lifetime issue: the source-plugin SDK test released its prepared runtime between calls and rebuilt cold catalog state inside each 5-second deadline. Two unchanged same-order runs failed before HTTP. A bounded phase trace confirmed repeated preparation consumed the budget. The test now retains the exact prepared runtime across its assertions and disposes it before teardown; deadlines, both SDK results, rejection checks and request counts remain unchanged. This correction changes tests only (+31/-1 lines), with no production change.
openclaw/ci-gate. The fresh ClawSweeper review covers this exact head, reports zero findings and no before-merge action. Its native-hosted rank-up scenario is now completed by the exact-head live qualification below.Historical feature proof includes 128 transport tests, registered-host integration, scoped types/lint, and a scoped package build. Prior CI run38991854961 at
4631018ahad only the attributed native-maintenance ratchet and aggregate failure; its separate repair was #174962. This historical proof does not replace current-head CI.Native Live Qualification
Live qualification at
6ea835ee97442de9122bdad7c438a3fc9e1ead6c:extensions/typesafe/src/decisions.live.test.tspassed (1 test, 1 file, 0 skipped). One mixed Boolean/Choice/Score text batch used the plugin-registered V2 adapter withjev-latestagainsthttps://api.typesafe.ai/v1/systemone. Assertions validate the V2 response, answer kinds, and numeric input/output-token usage.The source stayed unchanged. The source-reader and native test children joined, and isolated test state was removed. Credentials remained in private process pipes and memory.
This qualifies the registered adapter and external API using isolated prepared config/auth. It does not claim semantic answer correctness, installed-package loading, host SecretRef resolution, or deployed Gateway behavior. The unchanged-head ClawSweeper native-hosted rank-up move is complete; no rating-only re-review was requested.
Separate follow-up: compare the vendor's required-instructions documentation with requests omitting instructions before changing that input contract.
Accounting parent: #157492. Shared auth repair: #156799. Contributor ancestry is preserved.
Current CI disposition
Exact-head CI 39296200457/1 completed with 35 successful and 26 skipped jobs. The only failed root is the baseline-ratchet job, plus its aggregate. CI is not green.
The failure is inherited from main: #177499 removed the ACPX backend mock without pruning its exact entry from
config/test-mock-exports-baseline.txt. The actual CI merge3f460b2fcf125a6bb0ca12284ea2848d8c52362fhas ordered parents459ef416e1161408d878d0b3b284693063f4b292and3e56cc26f889f02d28dc8f45285f8d2e5ac6a639; the affected fixture, ledger, scanner/parser/resolver, package/lock/workspace, tsconfig and workflow are byte-identical to that main parent. Independent source review confirms the deleted factory cannot satisfy the stale ledger entry. No pristine-main execution is claimed; the scheduled-main classifier is only job-name evidence.All other ratchets, selected TypeSafe checks, and required security checks passed. Current-head ClawSweeper review has no findings, before-merge items or Rank-up moves. Landing uses the native inherited-only exception with the exact failed attempt retained; source remains unchanged.
Named follow-up: canonically prune the obsolete ACPX mock-export tuple on main containing #177499 and run its mock-export ratchet. This unrelated ledger repair is outside the TypeSafe feature diff.