## TODO

<!-- - SYSTEM PROMPT URGENT FIXES:
  + Make it smaller
  + Remove full date+time, just date (Breaks cache at every call) -->
- API do not support generating/receiving multi modal (images, audio, video, ...)
<!-- - Create a Models.json file with all the models and their data to be used as default, until we build a dedicated endpoint to get models data from main domain veil.com (Use OpenRouter API to get the default models data) -->
<!-- - Expose the chat completion endpoint as a standalone function, so apps based on Veil can use it for independent AI usage -->
- Compaction, it should be more robust, clear and configurable with Multi methods compaction, Methods:
  + Context summarization (based on Claude's Automatic Context Compaction approach):
    > **How it works:**
      - Monitor token usage per turn via `context_token_threshold`
      - When threshold exceeded, inject a summary prompt as a user turn
      - Model generates a summary wrapped in `<summary></summary>` tags
      - Clear conversation history and resume with only the summary
      - Continue task with compressed context
    > **Configuration options:**
      - `enabled`: Boolean to enable/disable compaction
      - `context_token_threshold`: Token count that triggers compaction (default: 100k, low: 5k-20k for sequential tasks, medium: 50k-100k for multi-phase, high: 100k-150k for context-heavy tasks)
      - `model`: Optional cheaper/faster model for summarization (e.g., `claude-haiku-4-5`)
      - `summary_prompt`: Custom prompt to guide what info to preserve in summaries
    > **Config hierarchy (lowest wins):**
      - Main level: `~/.veil/settings.json`
      - Project level: `PROJECT/.veil/settings.json`
      - Agent level: `AGENT/agent.json`
      - NOTE: All used variables should be configurable (including summary prompt, model, ...)
    > **When to use:**
      - Sequential processing (multiple items one after another)
      - Multi-phase workflows with natural checkpoints
      - Batch operations with independent items
      - Extended analysis sessions
    > **When NOT to use:**
      - Short tasks (<50k-100k tokens)
      - Tasks requiring full audit trails
      - Highly iterative refinement needing exact details from all steps
    > **Limitations:**
      - Information loss is inherent (mitigate via custom summary prompts)
      - Higher thresholds preserve more detail but cost more per call
    > Add Compaction endpoint to the sessions API to force run this method (usually for testing)
  + Files Clearing:
    > Clearing attached files after a specific negative index threshold (exp: Truncate all tool calls before last 10 messages)
  + Long Tool Call results truncation:
    > Truncating long toolcall results after a specific negative index threshold (exp: Truncate all tool calls before last 10 messages)
    > Can be configured with a custom threshold per tool type (per tool key)
  + NOTE: Clear code to be able to add new methods easily