agentflow4j
agentflow4j copied to clipboard
BudgetPolicy auto-configuration via application.yml
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
AgentFlow4jBudgetPropertiesrecord with@ConfigurationProperties("agentflow4j.budget")- Auto-configured
BudgetPolicybean, 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