headroom/tests
chopratejas 729cc035a4 Add compression summaries, multi-provider headers, Dockerfile fix
Compression Summaries:
- New: headroom/transforms/compression_summary.py
  - summarize_dropped_items(): categorizes compressed JSON items by
    field values (status, type, level, etc.), highlights errors/failures
  - summarize_compressed_code(): extracts function names from AST
    signatures (language-agnostic: Python, JS, Go, Rust, Java)
  - Newline-safe: strips \n from field values to keep markers single-line
- SmartCrusher: CCR markers include categorical summary of dropped items
  e.g. "[500 items compressed to 20. Omitted: 87 passed, 2 failed.
  Retrieve more: hash=abc123. Expires in 5m.]"
- CodeCompressor: CCR markers list compressed function names from AST
  e.g. "[180 tokens compressed. 5 bodies compressed: authenticate().
  Retrieve more: hash=abc123. Expires in 5m.]"
- Markers include TTL so LLM knows retrieval window
- Summary escapes { } to prevent .format() crashes
- Uses index-based dropped detection (not id()) for .copy() correctness

Proxy Response Headers:
- Anthropic, OpenAI, and Gemini handlers inject x-headroom-tokens-*
  headers for SaaS metering

Multi-Provider Passthrough Routing:
- Detect x-goog-api-key (Gemini) and api-key (Azure OpenAI)
- X-Headroom-Base-URL for explicit upstream URL override

Dockerfile: add build-essential + g++ for hnswlib compilation
Bump version to 0.3.5

Tests: 27 new tests (unit, eval, integration with real API, tool invocation)
2026-02-18 16:54:20 -08:00
..
cli Add Click-based CLI with memory management commands 2026-01-29 21:30:21 -08:00
integrations/test_strands feat: Add AWS Strands Agents SDK integration 2026-01-31 00:31:37 -08:00
test_cache Add pluggable storage backend abstraction for CompressionStore 2026-01-20 23:25:28 -08:00
test_cli Fix MCP tests to work when MCP SDK is not installed 2026-02-02 11:23:26 -08:00
test_compression Fix flaky JavaScript signature preservation test threshold 2026-01-15 15:38:25 -08:00
test_evals fix(tests): skip HTML extractor tests when trafilatura not installed 2026-01-31 15:39:55 -08:00
test_integrations fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_memory Add centralized ML model configuration 2026-02-01 23:47:42 -08:00
test_providers Fix mypy type errors in LiteLLM and OpenAI providers 2026-01-16 16:42:11 -08:00
test_storage Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_transforms test: Update LLMLingua default model test to match new default 2026-02-02 20:38:02 +05:30
__init__.py Initial commit: Headroom SDK - LLM context optimization toolkit 2026-01-06 23:16:58 -08:00
conftest.py Add global httpx.ReadTimeout handler for all tests 2026-01-30 16:37:34 -08:00
test_acceptance.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_adapter_hooks.py Add pluggable adapter hooks for CCR, Storage, and TOIN backends 2026-02-15 17:47:30 -08:00
test_ccr.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_ccr_batch_processor.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_ccr_context_tracker.py v0.2.2: Add CCR Response Handler, Context Tracker, and restructure docs 2026-01-14 13:03:41 -08:00
test_ccr_feedback.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_ccr_response_handler.py Fix security vulnerabilities in memory and CCR systems 2026-02-04 12:05:50 -08:00
test_ccr_tool_injection.py Fix security vulnerabilities in memory and CCR systems 2026-02-04 12:05:50 -08:00
test_compression_store.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_compression_summary.py Add compression summaries, multi-provider headers, Dockerfile fix 2026-02-18 16:54:20 -08:00
test_compression_summary_eval.py Add compression summaries, multi-provider headers, Dockerfile fix 2026-02-18 16:54:20 -08:00
test_compression_summary_hard_eval.py Add compression summaries, multi-provider headers, Dockerfile fix 2026-02-18 16:54:20 -08:00
test_compression_summary_integration.py Add compression summaries, multi-provider headers, Dockerfile fix 2026-02-18 16:54:20 -08:00
test_compression_summary_tool_eval.py Add compression summaries, multi-provider headers, Dockerfile fix 2026-02-18 16:54:20 -08:00
test_config.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_critical_fixes.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_critical_gaps.py Update test for lowered TOIN confidence threshold default 2026-01-21 21:40:11 -08:00
test_crushability.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_google_multimodal.py Fix Google Gemini conversion to preserve non-text content (Gap #4) 2026-01-24 12:20:13 -08:00
test_google_multimodal_e2e.py Add E2E tests for Google multimodal content preservation 2026-01-24 21:01:25 -08:00
test_hnsw_only.py Add bounded memory support to HNSWVectorIndex with LRU eviction 2026-02-01 21:12:06 -08:00
test_image_compressor.py Fix test_router_is_available_with_models after MLModelRegistry refactor 2026-02-01 22:42:11 -08:00
test_log_compressor.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_memory_eval.py Add hierarchical memory system with graph + vector storage 2026-01-26 21:58:47 -08:00
test_memory_integration.py Add centralized ML model configuration 2026-02-01 23:47:42 -08:00
test_memory_system.py fix(tests): add missing skip decorator and tests for exclude_tools 2026-01-31 17:44:03 -08:00
test_memory_tracker.py Add memory observability system (Phase 1) 2026-02-01 19:49:53 -08:00
test_memory_tracker_integration.py Add SQLite vector backend as default and fix HNSW test skipping 2026-02-01 22:12:45 -08:00
test_memory_usage_integration.py Add SQLite vector backend as default and fix HNSW test skipping 2026-02-01 22:12:45 -08:00
test_models.py Use LiteLLM for model pricing instead of hardcoded values 2026-01-16 00:35:04 -08:00
test_parser.py Add multi-provider memory system with auto-detection 2026-02-01 14:42:50 -08:00
test_provider_model_fallback.py Add AST-based code compression and custom model configuration 2026-01-14 13:46:55 -08:00
test_proxy_batch_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_ccr.py Fix ruff formatting 2026-01-17 17:14:12 -08:00
test_proxy_compression_headers.py Remove unused ProxyConfig import from compression tests 2026-01-14 20:27:08 -06:00
test_proxy_count_tokens_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_gemini_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_gemini_native_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_intelligent_context.py feat(toin): add TOIN + CCR integration to IntelligentContextManager 2026-01-27 16:08:36 -08:00
test_proxy_llmlingua.py Fix mypy type errors in LiteLLM and OpenAI providers 2026-01-16 16:42:11 -08:00
test_proxy_memory_integration.py fix: correct cost calculation for cache tokens and simplify memory DevEx 2026-01-26 22:49:31 -08:00
test_proxy_openai_responses_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_passthrough_integration.py Add multi-provider batch API support with CCR post-processing 2026-01-24 11:41:18 -08:00
test_proxy_scalability.py fix: resolve CI failures 2026-01-27 16:17:24 -08:00
test_proxy_streaming_resilience.py Add tests for streaming resilience and concurrent session safety 2026-02-11 11:24:12 -08:00
test_quality_retention.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_relevance.py Fix all mypy type errors and flaky embedding test 2026-01-10 18:27:33 -08:00
test_search_compressor.py fix: improve error handling and add comprehensive test coverage 2026-01-27 16:08:36 -08:00
test_security_validations.py Fix security vulnerabilities in memory and CCR systems 2026-02-04 12:05:50 -08:00
test_sqlite_graph_store.py Add SQLiteGraphStore for bounded, persistent graph storage 2026-02-01 20:48:57 -08:00
test_sqlite_vector_index.py Add SQLiteVectorIndex using sqlite-vec for bounded vector search 2026-02-01 21:23:09 -08:00
test_telemetry.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_text_compressors.py Fix lint errors in text compression utilities 2026-01-12 17:32:51 -08:00
test_toin.py Add comprehensive evaluation framework for compression accuracy 2026-01-22 09:31:54 -08:00
test_toin_field_learning.py Fix ruff formatting 2026-01-17 17:14:12 -08:00
test_toin_fixes.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00
test_toin_full_integration.py Update test for lowered TOIN confidence threshold default 2026-01-21 21:40:11 -08:00
test_toin_integration.py Add pluggable storage backend abstraction for CompressionStore 2026-01-20 23:25:28 -08:00
test_tokenizers.py Fix all ruff lint and format errors for CI 2026-01-10 15:33:44 -08:00