Files
OmniRoute/src/lib/db/migrations/005_combo_agent_fields.sql
diegosouzapw d56fae0a7b feat: combo agents, auto-update UI, detailed logs, MITM Kiro (#399 #401 #320 #378 #336)
DB Migrations (zero-breaking, ADD COLUMN DEFAULT NULL + new table):
- 005_combo_agent_fields.sql: system_message, tool_filter_regex, context_cache_protection on combos
- 006_detailed_request_logs.sql: ring-buffer table (500 entries) for full pipeline body capture

Features:
- #399 System Message Override + Tool Filter Regex per Combo
  - applyComboAgentMiddleware() injected into handleComboChat/handleRoundRobinCombo
  - Supports both OpenAI and Anthropic tool name formats
- #401 Context Caching Protection (Stateless)
  - injectModelTag() appends <omniModel>provider/model</omniModel> to responses
  - extractPinnedModel() reads tag from history and pins model for session
- #320 Auto-Update via Settings
  - GET /api/system/version — current vs latest npm
  - POST /api/system/update — fire-and-forget npm install + pm2 restart
- #378 Detailed Request Logs
  - saveRequestDetailLog() captures bodies at 4 pipeline stages (opt-in toggle)
  - GET/POST /api/logs/detail — list logs + enable/disable toggle
- #336 MITM Kiro IDE
  - src/mitm/targets/kiro.ts: MitmTarget profile for api.anthropic.com interception
2026-03-17 08:53:41 -03:00

20 lines
1.1 KiB
SQL

-- 005_combo_agent_fields.sql
-- Safe migration for existing users: adds optional agent fields to combos.
-- Uses ADD COLUMN with DEFAULT NULL (SQLite compatible) — existing rows are untouched.
-- New fields are read as NULL by old code versions (backward compatible).
-- System prompt override: when set, injected as the first system message before
-- forwarding to the provider. Overrides any system message from the client.
ALTER TABLE combos ADD COLUMN system_message TEXT DEFAULT NULL;
-- Regex-based tool filter: when set, only tool calls whose "name" matches this
-- regex pattern are forwarded to the provider. Others are stripped silently.
-- Example: "^(gh_|create_file|web_fetch)" — allows only GitHub and web tools.
ALTER TABLE combos ADD COLUMN tool_filter_regex TEXT DEFAULT NULL;
-- Context caching protection: when 1, the proxy tags assistant responses with
-- <omniModel>provider/model</omniModel> and pins the model for the session.
ALTER TABLE combos ADD COLUMN context_cache_protection INTEGER DEFAULT 0;
CREATE INDEX IF NOT EXISTS idx_combos_cache_protection ON combos(context_cache_protection);