Skip to content

feat(kernel): implement token budget tracking helpers (#1475)#1532

Open
SH20RAJ wants to merge 1 commit intomofa-org:mainfrom
SH20RAJ:fix/1475-budget-status-token-helpers
Open

feat(kernel): implement token budget tracking helpers (#1475)#1532
SH20RAJ wants to merge 1 commit intomofa-org:mainfrom
SH20RAJ:fix/1475-budget-status-token-helpers

Conversation

@SH20RAJ
Copy link
Copy Markdown

@SH20RAJ SH20RAJ commented Mar 28, 2026

This PR implements missing token-based helper methods for BudgetStatus as identified in the GSoC 2026 ideas list (General Framework Improvements).

Changes

  • Implemented remaining_session_tokens(), remaining_daily_tokens(), remaining_monthly_tokens(), and remaining_total_tokens().
  • Added comprehensive unit tests for token budget tracking logic.
  • Standardized API for token-based tracking to improve developer experience.

Verification

  • cargo test -p mofa-kernel --lib budget::tests passed.

Motivation

Part of the effort to improve framework-level cost attribution and budget management for AI agents.

@SH20RAJ
Copy link
Copy Markdown
Author

SH20RAJ commented Mar 28, 2026

Hi! I've implemented the missing token-based helper methods for BudgetStatus. This allows agent designers to easily track token consumption across session, daily, and monthly boundaries, providing finer-grained cost control as suggested in Idea 31. (Fixes #1475)

@SH20RAJ
Copy link
Copy Markdown
Author

SH20RAJ commented Mar 29, 2026

Supporting 'General Framework Improvements', this PR implements missing token budget helper methods (remaining_session_tokens, etc.) in BudgetStatus. These additions are crucial for fine-grained cost attribution and usage tracking for AI agents, as outlined in the GSoC ideas list. 💰

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