feat: batch processing and performance improvements #90

Merged
jonas.hanisch merged 2 commits from feat/batch-processing-and-performance into main 2026-01-22 21:37:14 +00:00
Owner

Summary

  • Add batch observation processing to reduce API call overhead (configurable via CLAUDE_MEM_BATCH_SIZE, default: 5)
  • Add conversation history limiting to prevent token explosion (keep first 2 + last 10 messages max)
  • Add 120s request timeout for Mistral API calls to prevent hanging
  • Fix settings validation bugs (boolean handling, provider normalization)

Changes

Batch Processing

  • New buildBatchObservationPrompt() in src/sdk/prompts.ts for processing multiple tool events per API call
  • MistralAgent collects observations and processes them in batches instead of one-by-one
  • Configurable batch size via CLAUDE_MEM_BATCH_SIZE setting

Performance Fixes

  • Both MistralAgent and SDKAgent now limit conversation history to prevent exponential token growth
  • Added 120s timeout for Mistral API requests

Settings Validation Fixes

  • Accept actual boolean values, not just string "true"/"false"
  • Add 'openai' to valid providers list
  • Normalize 'anthropic' → 'claude' for backwards compatibility

Test plan

  • Verify batch processing works with MistralAgent (check logs for "Processing batch of X observations")
  • Verify conversation history doesn't grow beyond 12 messages
  • Test settings API accepts boolean values
  • Test settings API accepts 'openai' and 'anthropic' providers

🤖 Generated with Claude Code

## Summary - Add batch observation processing to reduce API call overhead (configurable via `CLAUDE_MEM_BATCH_SIZE`, default: 5) - Add conversation history limiting to prevent token explosion (keep first 2 + last 10 messages max) - Add 120s request timeout for Mistral API calls to prevent hanging - Fix settings validation bugs (boolean handling, provider normalization) ## Changes ### Batch Processing - New `buildBatchObservationPrompt()` in `src/sdk/prompts.ts` for processing multiple tool events per API call - MistralAgent collects observations and processes them in batches instead of one-by-one - Configurable batch size via `CLAUDE_MEM_BATCH_SIZE` setting ### Performance Fixes - Both MistralAgent and SDKAgent now limit conversation history to prevent exponential token growth - Added 120s timeout for Mistral API requests ### Settings Validation Fixes - Accept actual boolean values, not just string "true"/"false" - Add 'openai' to valid providers list - Normalize 'anthropic' → 'claude' for backwards compatibility ## Test plan - [ ] Verify batch processing works with MistralAgent (check logs for "Processing batch of X observations") - [ ] Verify conversation history doesn't grow beyond 12 messages - [ ] Test settings API accepts boolean values - [ ] Test settings API accepts 'openai' and 'anthropic' providers 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat: batch processing and performance improvements
All checks were successful
CI / build (pull_request) Successful in 21s
CI / validate-plugin (pull_request) Successful in 2s
4385a45184
- Add batch observation processing (CLAUDE_MEM_BATCH_SIZE setting, default: 5)
- Add buildBatchObservationPrompt() for processing multiple tool events per API call
- Add conversation history limiting (keep first 2 + last 10 messages) to prevent token explosion
- Add 120s request timeout for Mistral API calls
- Fix settings validation to accept boolean values (not just strings)
- Add 'openai' to valid providers and normalize 'anthropic' → 'claude'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: auto-register hooks in settings.json during install
All checks were successful
CI / build (pull_request) Successful in 21s
CI / validate-plugin (pull_request) Successful in 2s
c554ab7d8d
- Add registerHooks() function to smart-install.js
- Reads hooks.json from plugin and merges into user's settings.json
- Supports CLAUDE_CONFIG_DIR environment variable
- Creates backup of settings.json if parsing fails
- Non-blocking: hook registration failure doesn't stop plugin installation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jonas.hanisch deleted branch feat/batch-processing-and-performance 2026-01-22 21:37:14 +00:00
Sign in to join this conversation.
No description provided.