Files
stonks-oracle/infra/migrations/031_fix_max_tokens_default.sql
T
Celes Renata e360b66c3e fix: beta trading pipeline — max_tokens default, approval re-enqueue, credentials
- Migration 031: change ai_agents/agent_variants max_tokens default
  from 32768 to 4096 (32768 exceeds vLLM context window, causing
  HTTP 400 on every extraction)
- API: re-enqueue approved orders to broker queue — previously
  approved orders sat in DB with nothing to execute them
- values-beta: enable TRADING_ENABLED, update Alpaca paper keys
2026-04-28 14:13:58 +00:00

16 lines
647 B
SQL

-- Fix max_tokens default: 32768 is the full context window, not a reasonable
-- output limit. vLLM rejects requests where max_tokens >= context_window
-- because there's no room left for the input prompt.
--
-- Change the column default to 4096 (sufficient for structured JSON extraction
-- output) and update any existing rows still at the old default.
ALTER TABLE ai_agents ALTER COLUMN max_tokens SET DEFAULT 4096;
ALTER TABLE agent_variants ALTER COLUMN max_tokens SET DEFAULT 4096;
UPDATE ai_agents SET max_tokens = 4096, updated_at = NOW()
WHERE max_tokens = 32768;
UPDATE agent_variants SET max_tokens = 4096
WHERE max_tokens = 32768;