Repository navigation
feat(openai): support Decisions API - #277
Conversation
|
🦞👀 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 adds OpenAI Decisions routing for GPT-6 Luna with endpoint-specific input-only pricing. Example: POST /v1/decisions with model openai/gpt-6-luna and a damaged-product predicate.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: current main lacks Decisions support, and this maintainer-directed PR provides a focused implementation with no concrete correctness finding. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Worker accepts authenticated client requests, selects manifest endpoints and credentials, enforces budgets, forwards provider traffic, and constructs usage events. flowchart LR
Client --> Worker
Worker --> PolicyChecks
PolicyChecks --> EndpointSelection
EndpointSelection --> BudgetLedger
BudgetLedger --> OpenAI
OpenAI --> UsageSettlement
UsageSettlement --> Client
Technical reviewBest possible solution: Land the manifest-based endpoint and shared endpoint-price selection while preserving existing authorization, ledger ownership, and Chat/Responses tariffs. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that /v1/decisions has no unified routing entry; no target code was executed. Is this the best way to solve the issue? The implementation fits the manifest-first architecture and resolves endpoint pricing through existing selection and affordability owners without adding another proxy path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c153989041f0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 20, 2026, 5:11 PM ET / 21:11 UTC. |
cc31b93 to
fbc6e67
Compare
Route GPT-6 Luna Decisions requests with endpoint-specific input-only pricing and existing policy, grant, and budget enforcement. Cover typed answer forwarding, conservative failure accounting, discovery, and omitted cache-write counters in reserve and soft modes. Co-authored-by: hannesrudolph <49103247+hannesrudolph@users.noreply.github.com>
Worked on by: - @hannesrudolph Co-authored-by: hannesrudolph <49103247+hannesrudolph@users.noreply.github.com> OpenClaw-Publication: d4c4ba0e-1810-45fd-a994-20a9227565aa
fbc6e67 to
09a2974
Compare
Summary
Add OpenAI Decisions for GPT-6 Luna through unified
/v1/decisions, native/v1/native/openai/v1/decisions, and manifest/v1/proxy/openai/decisionsroutes. Preserve complete upstream JSON (model, typed answers, probabilities, confidence, refusals and usage), typed Boolean/string choices, input images, cache controls, safety identifiers and upstream errors.Rebased original Hannes/RoboClaw commits faithfully onto main
9de791922fe6f2f7580b15b3073d229a07697a91, including landed redirect protection #288 and previous #292/#293/#297 behavior. No merge or deployment.openai-gpt-6-luna-decisions-2026-10-21: all input tokens, including cached and cache-written input, cost $0.10/M; the entire request costs $0.20/M above272K. No output charge. Ordinary Luna Chat/Responses tariffs are unchanged.Billing review correction (B1)
The prior head
fbc6e673incorrectly interpreted “no cache-read/write charge” as free cached input. That undercharged all-cache-read/all-cache-write requests and is corrected here. Removed all four zero cache rates so both buckets fall back to the Decisions input rate; versioned the price reference. Removed the no-longer-needed generic settlement relaxation, restoring main's cache-counter requirements. Documentation and this body now state the full-input charge explicitly.New handler-plus-SQL regressions cover all-cache-read and all-cache-write usage at100,000,272,000 and272,001 input tokens. Both policy and provider ledgers settle respectively10,000,27,200 and54,401micros. The mixed-cache unit case settles100micros, not70.
Cheap review follow-ups also addressed: lifecycle tests assert exact status/error codes and no open reservation; the previously external-only cancel/ingress fixture now has an in-repository real-workerd cancellation regression checking upstream abort, original caller cancellation and conservative settled reservation.
Verification — head
a655d746d7deda512287b00df43dc487731163a6Tree:
9a01a018a61daa247ae64e788872a70acfa1e9d5.pnpm check: PASS —1,862Worker,228admin,441script tests;18environment-gated skips. Command-localumask022preserves the existing load-test permission fixture; no assertion was weakened.pnpm build: PASS — all22provider manifests compiled/validated, admin production build, Worker typecheck and1,862tests.09a29742, P0–P2: scoped-clean; final follow-up changes only the cancellation assertion described below. Static review, not independent test execution.Composed native proof and its scope
Previously executed at service
fbc6e673with unchanged OpenClaw main4d86333f6a82117ede1c530fa0b2a3b70341bcab: actual registered/prepared ClawRouter decision host → real local workerd → synthetic OpenAI, private authority/queue/SQLite ledgers, no mocked Worker/native transport. Required response.model, Boolean/choice/score distributions, refusal sibling and inlinePNG succeeded; distinct router/upstream credentials stayed at their boundaries. A positive evaluation sent exactly one catalog GET and one native POST and settled100micros for1,000uncached input tokens in both ledgers.422 mapped to unsupported-input with no charge; denied catalog and disabled selector dispatched no inference; caller cancel drained activeRequests to0 and retained its dispatched reservation. Local physical cancel propagation was approximately7seconds, not a low-latency guarantee.This billing repair does not alter that wire/consumer contract. Its new real-workerd and SQL tests above requalify the changed settlement and cancellation paths; the earlier composed run is explicitly prior-head evidence, not falsely claimed as rerun on this head. Native main's200-question cap and256-question V2 host cap have a separately prepared400-question repair at
076d38562a492ae6d1c920118fe22e6c3a6bf85e; the composed400-question call passed with that repair. Native publication/CI is outside this service PR.Deployment and remaining risk
Not deployed; no paid/live provider call. Exact-head CI is green; maintainer re-review remains the landing gate. Synthetic composition does not qualify hosted deployment, live key grants, real vendor behavior or regional premiums. Missing/oversized/interrupted usage retains reservations; ingress retains its existing8MiB JSON limit. Original native-before-service merge ordering is not retroactively repaired by this work.
Implementation by RoboClaw for Hannes’s request.
Worked on by
Work sessions