Skip to content

Price the chunklaya route as chunklaya under a spending permit - #114

Merged
myxamediyar merged 1 commit into
mainfrom
chunklaya-spending-provider
Sep 23, 2026
Merged

myxamediyar merged 1 commit into
mainfrom
chunklaya-spending-provider

Conversation

@myxamediyar

Copy link
Copy Markdown
Owner

Follow-up to #113. postBeam sent every request through providerFetch under Beam's name, so a request routed to chunklaya was priced as beam:chunklaya/multilingual, which the price table does not have, and was refused with 400 unpriced_model. The function now names the provider it already receives.

Affected before this fix: only requests that route to chunklaya (inputs over 32,000 characters, or an explicit model: "chunklaya"), which answered 400 unpriced_model instead of being classified. Nothing else changed behaviour.

test/chunklaya.test.ts gains a test that runs the route under a spending Permit, as production does, and asserts it is priced as chunklaya at zero.

Checks — npm run typecheck clean; npm test 801 pass / 0 fail.

🤖 Generated with Claude Code

postBeam sent every request through providerFetch under Beam's name, so a
request routed to chunklaya was priced as beam:chunklaya/multilingual,
which the price table does not have, and was refused as unpriced_model.
The provider the function already receives is now the one it names.

test/chunklaya.test.ts runs the route under a Permit, as production does,
and asserts it is priced as chunklaya at zero.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 91471ff4-9f7b-4955-98a7-6ff064fd959d

📥 Commits

Reviewing files that changed from the base of the PR and between 4b40984 and 29961c6.

📒 Files selected for processing (2)
  • src/jev.ts
  • test/chunklaya.test.ts
 ________________________________________________________________________________
< A bunny is never late, nor is he early, he reviews precisely when he means to. >
 --------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@myxamediyar
myxamediyar merged commit 5f69538 into main Sep 23, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant