Repository navigation
Show Modal credit left so runs can be budgeted - #17
Merged
Merged
Conversation
Modal reports spend but not the credit left, so the user enters it once (settings card or `orx compute configure modal --credit-usd`) and orx subtracts Modal's billing report since then, falling back to an estimate from orx's Modal runs. compute prices now carries a Modal balance and per-GPU runway. Also lets `configure gcp` take --credit-usd and --billing-export-table, which the CLI rejected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011myrc9HRRr9A7ENDiTNR4i
tuandang304
marked this pull request as ready for review
October 14, 2026 13:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tuna · project thread
Before: Modal in Compute showed only this month's spend.
orx compute priceshad no Modal balance or runway, so an agent could not tell whether a run would outlast the workspace's credit.After: the Modal settings card has a "Credit left (USD)" field and shows "Available to spend ≈ $X".
orx compute prices(and--json, which agents read) reports a Modal USD balance and hours of runway per GPU.orx compute configure modal --credit-usd 30/--clear creditset it from the CLI.Modal's API reports spend but not the credit left, so the user copies it once from the Modal dashboard, the same way the Google Cloud credit works.
How:
ModalSettings(~/.openresearch/modal.json) stores the credit and when it was entered. The launcher'sbillingsubcommand takes that timestamp and sumsWorkspace.billing.report(start=…, resolution="h"), so spend comes from Modal itself. If the report cannot be read, it falls back to orx's own Modal runs at list price and shows why. Also fixesorx compute configure gcp --credit-usd/--billing-export-table, which the CLI rejected as unknown settings, and clears the prices cache when a credit is saved.🤖 Generated with Claude Code
https://claude.ai/code/session_011myrc9HRRr9A7ENDiTNR4i
Generated by Claude Code