xml-pipeline/tests
dullfig 8b11323a8b Add token budget enforcement and usage tracking
Token Budget System:
- ThreadBudgetRegistry tracks per-thread token usage with configurable limits
- BudgetExhaustedError raised when thread exceeds max_tokens_per_thread
- Integrates with LLMRouter to block LLM calls when budget exhausted
- Automatic cleanup when threads are pruned

Usage Tracking (for production billing):
- UsageTracker emits events after each LLM completion
- Subscribers receive UsageEvent with tokens, latency, estimated cost
- Cost estimation for common models (Grok, Claude, GPT, etc.)
- Aggregate stats by agent, model, and totals

Configuration:
- max_tokens_per_thread in organism.yaml (default 100k)
- LLMRouter.complete() accepts thread_id and metadata parameters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:07:43 -08:00
..
scripts Add thread registry, LLM router, console handler, and docs updates 2026-01-10 16:53:38 -08:00
conftest.py Add shared backend for multiprocess pipeline support 2026-01-20 20:18:22 -08:00
test_buffer.py Add Sequence and Buffer orchestration primitives 2026-01-25 14:56:15 -08:00
test_context_buffer.py Rename agentserver to xml_pipeline, add console example 2026-01-19 21:41:19 -08:00
test_crypto.py Add Ed25519 envelope signing infrastructure 2026-01-27 20:00:35 -08:00
test_hot_reload.py Add hot-reload for organism configuration 2026-01-27 20:38:48 -08:00
test_pipeline_steps.py Rename agentserver to xml_pipeline, add console example 2026-01-19 21:41:19 -08:00
test_pump_integration.py Add Sequence and Buffer orchestration primitives 2026-01-25 14:56:15 -08:00
test_sequence.py Add Sequence and Buffer orchestration primitives 2026-01-25 14:56:15 -08:00
test_server.py Add capability introspection REST endpoints 2026-01-27 20:51:17 -08:00
test_shared_backend.py Add shared backend for multiprocess pipeline support 2026-01-20 20:18:22 -08:00
test_todo_registry.py Archive obsolete docs and misc cleanup 2026-01-20 20:20:10 -08:00
test_token_budget.py Add token budget enforcement and usage tracking 2026-01-27 21:07:43 -08:00