feat(quotes): allow a per-transaction platform fee override on POST /quotes - #797
feat(quotes): allow a per-transaction platform fee override on POST /quotes#797jacklatourette wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs.
|
| 💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee` |
✅ grid-openapi studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
✅ grid-ruby studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅→build ✅(prev:build ⏭️) →lint ✅→test ✅New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
✅ grid-go studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅→build ✅(prev:build ⏭️) →lint ❗→test ❗go get github.com/stainless-sdks/grid-go@9194f74b16de98cfce96d6c5a2281aedd117bd19New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
✅ grid-kotlin studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️→build ✅→lint ✅→test ❗New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
⚠️ grid-python studio · code · diff
Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅→build ✅(prev:build ⏭️) →lint ❗(prev:lint ⏭️) →test ❗pip install https://pkg.stainless.com/s/grid-python/901afce32b8bf5a4a5e9e6ef36bf92c960d6250f/grid-0.0.1-py3-none-any.whlNew diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
✅ grid-php studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅→lint ✅→test ✅New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
✅ grid-cli studio · code · diff
Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️→build ❗→lint ❗→test ❗New diagnostics (1 note)
💡 Model/Recommended: We recommend you use a model for `#/components/schemas/FixedFee`
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-08-10 15:11:13 UTC
Greptile SummaryThe PR adds an optional per-transaction platform fee override to quote creation and regenerates both committed OpenAPI bundles.
Confidence Score: 4/5The agent-facing fee-control exposure should be resolved before merging because the shared request schema bypasses the intended platform-only contract boundary. POST /agents/me/quotes consumes the modified QuoteRequest, so agents with only CREATE_QUOTES are now advertised as able to select platform fees even though the permission model provides no corresponding fee-control authority. Files Needing Attention: openapi/components/schemas/quotes/QuoteRequest.yaml
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/quotes/QuoteRequest.yaml | Adds the fee override to a request shared by platform and agent quote endpoints, unintentionally broadening the advertised capability. |
| openapi/components/schemas/quotes/PlatformFeeOverride.yaml | Defines the required fixed and variable fee override fields consistently with the stated optional request feature. |
| openapi.yaml | Correctly bundles the new schema but consequently exposes it on every endpoint using QuoteRequest, including agent quote creation. |
| mintlify/openapi.yaml | Mirrors the generated root bundle and publishes the same over-broad agent request contract. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
P[Platform caller<br/>BasicAuth] --> PQ[POST /quotes]
A[Agent caller<br/>CREATE_QUOTES] --> AQ[POST /agents/me/quotes]
PQ --> QR[Shared QuoteRequest]
AQ --> QR
QR --> F[platformFeeOverride]
F --> C[Platform fee calculation]
Prompt To Fix All With AI
### Issue 1
openapi/components/schemas/quotes/QuoteRequest.yaml:70-71
**Agent fee authority is unguarded**
When an agent with `CREATE_QUOTES` calls `POST /agents/me/quotes`, the shared `QuoteRequest` advertises `platformFeeOverride` even though no agent permission grants fee control, causing either unauthorized platform-fee changes when honored or a broken generated-client contract when rejected. **How this was verified:** The agent endpoint references this shared request schema, while the complete agent permission enum contains no fee-management permission.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(quotes): allow a per-transaction pl..." | Re-trigger Greptile
gcamata
left a comment
There was a problem hiding this comment.
a couple minor things but otherwise looks good!
| Overrides the platform fee for this transaction. When present, it replaces | ||
| all platform fees that would otherwise apply to the transaction — no standing | ||
| fee config is required. Only supported when the quote's source currency is | ||
| USD today; the fixed fee must be denominated in the source currency. | ||
|
|
||
| Only honored on platform-authenticated requests to `POST /quotes`. Agent | ||
| tokens carry no fee-control permission, so this field must be omitted on | ||
| agent-authenticated requests such as `POST /agents/me/quotes`. |
There was a problem hiding this comment.
| Overrides the platform fee for this transaction. When present, it replaces | |
| all platform fees that would otherwise apply to the transaction — no standing | |
| fee config is required. Only supported when the quote's source currency is | |
| USD today; the fixed fee must be denominated in the source currency. | |
| Only honored on platform-authenticated requests to `POST /quotes`. Agent | |
| tokens carry no fee-control permission, so this field must be omitted on | |
| agent-authenticated requests such as `POST /agents/me/quotes`. | |
| Overrides the platform-collected fee for this transaction. When present, | |
| it replaces any configured platform-collected fees that would otherwise | |
| apply to the transaction. Currently only supported when the quote's source | |
| currency is USD; the fixed fee must be denominated in the source currency. |
There was a problem hiding this comment.
Applied your wording for the first paragraph. I kept the second paragraph about agent-authenticated requests since it addresses an earlier review finding — happy to drop it if you'd prefer.
There was a problem hiding this comment.
ya please drop it, I think it is confusing to talk about agents here
|
🦣 Congratulations @gcamata - your substantive review earned a Bear-dog! (uncommon)
View your Frost-dex: https://zeus.dev.dev.sparkinfra.net/#/dinodex/gcamata?section=ice-age |
…quotes Optional platformFeeOverride on QuoteRequest: when present it replaces all platform fees that would otherwise apply — no standing fee config required and no cap relative to one. platformFixedFee and platformVariableFeeBps are both required within the object; negatives are rejected at schema level. USD source currency only today (including same-currency USD transfers); the fixed fee currency must equal the quote's source currency (AT-6193). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Agent tokens carry no fee-control permission, so note that the field must be omitted on agent-authenticated requests like POST /agents/me/quotes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
829c5e1 to
7a9c7e0
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7a9c7e0 to
6ecfcf4
Compare
…platformVariableFeeBps at 10000 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6ecfcf4 to
723b1ee
Compare

What
Adds an optional
platformFeeOverrideobject to theQuoteRequestschema (newcomponents/schemas/quotes/PlatformFeeOverride.yaml, bundles regenerated).When present, the override replaces all platform fees that would otherwise apply to the transaction:
platformFixedFee({amount, currency}) andplatformVariableFeeBpsare both required within the object; negatives rejected at schema level (minimum: 0)INVALID_INPUTotherwiseTRANSACTION_OVERRIDEis deliberately NOT added toconfig/FeeType.yaml: platforms must not create standing override configs viaPATCH /configNo response-shape changes. Optional-field addition — passes the oasdiff breaking-change check.
Why
Grid Fees Phase 2d (AT-6193, epic AT-6136): platforms need per-transaction control of their own fee (promos, VIP pricing, negotiated rates) without editing standing config.
Sparkcore implementation: lightsparkdev/webdev stack for AT-6128 / AT-6194 (vendored client regen included there).
🤖 Generated with Claude Code