agentflow4j icon indicating copy to clipboard operation
agentflow4j copied to clipboard

BudgetPolicy auto-configuration via application.yml

Open ahmed-sekka opened this issue 5 months ago • 0 comments

Problem

Wiring a BudgetPolicy requires boilerplate Java config. Teams using Spring Boot should be able to declare budget limits in application.yml and get a pre-configured BudgetPolicy bean injected.

Proposed configuration

agentflow4j:
  budget:
    per-run: 2.00
    per-node: 0.50
    per-call: 0.05
    currency: USD

agentflow4j-starter auto-configures a BudgetPolicy bean when these properties are present, following standard Spring Boot @ConditionalOnProperty conventions.

Acceptance criteria

  • AgentFlow4jBudgetProperties record with @ConfigurationProperties("agentflow4j.budget")
  • Auto-configured BudgetPolicy bean, conditional on at least one limit being set
  • Bean is @ConditionalOnMissingBean — user-defined bean takes precedence
  • Properties appear in IDE auto-completion (spring-configuration-metadata.json)
  • Integration test: properties set → bean created with correct limits

ahmed-sekka avatar Jun 08 '26 07:06 ahmed-sekka