Skip to content

Fix #85: Support provider cost metering and accumulate in ledger - #111

Closed
AnandkumarMall wants to merge 4 commits into
sapientinc:mainfrom
AnandkumarMall:fix-issue-85
Closed

AnandkumarMall wants to merge 4 commits into
sapientinc:mainfrom
AnandkumarMall:fix-issue-85

Conversation

@AnandkumarMall

Copy link
Copy Markdown

Fixes #85. Extends the usage-reporting contract so an API provider adapter can return a cost field alongside tokens. This includes updating ModelResult and AgentRunResult to carry a cost payload, extracting cost from CodexEventCollector and ModelProviderAdapter, and updating the RuntimeUsageCollector and execution_guards to allow informational cost units (like cost_usd or neurons) to be recorded in the BudgetLedger without raising unapproved grant exceptions. The metrics are fully additive and correctly surface in system_run_summary.

@electrixoul

Copy link
Copy Markdown
Collaborator

Thank you, @AnandkumarMall, for contributing provider cost metering and ledger accumulation.

We transferred the cost-reporting work into validation/budget-and-cost-accounting and reconciled it with the active budget-admission contribution. The combined implementation preserves positional runtime/plugin compatibility, records provider-reported cost as an informational ledger unit, and does not silently convert every token-detail field into an unapproved budget unit. The branch passed the complete offline test suite (3,084 tests, 6 skipped), local CI/guardrails, coverage gates, documentation checks, and compile/diff hygiene before it was pushed.

Our maintainer workflow is documented here: https://github.com/sapientinc/PRAXIST/blob/main/docs/guides/contributing.md#what-happens-after-submission

This branch is now ready for a separately scheduled real-task experiment stage. Please allow us time to complete that validation; if it passes, the maintainers will submit the validated change to main with your authorship retained. We are closing this source PR only because its contribution has been transferred to the shared validation branch, not because the contribution was rejected.

@electrixoul electrixoul closed this Sep 3, 2026
@Glen-SP

Glen-SP commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Update: this shipped. Your provider cost metering and ledger accumulation are now
on main in 9d6932d, merged via #199, with your authorship retained as a
co-author trailer.

Thank you for your contribution, @AnandkumarMall

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.

[Bug]: Run cost is never recorded — no neuron or USD figure appears in any run artifact

3 participants