Files
superbrain/db/migrations/016_ai_instructions.sql
T
Andrew S Erwin 09f8a5d933
release gate / check (push) Failing after 6m26s
release / smoke (push) Successful in 10m16s
release / publish (push) Failing after 9m57s
BYO AI settings: custom instructions, model picker, key show/hide
Mirrors the BYOK dialog suggested in issue #2:
- UserAiConfig gains an optional instructions column (schema.sql +
  migration 016); PUT validates (<=4000 chars) and full-replaces it.
- Instructions ride along on the assistant chat system prompt only
  (chatSystemWith); the automation compiler and page-extraction prompts
  stay server-owned contracts.
- Settings -> AI: labeled fields, per-provider suggested-model dropdown
  with a custom-model escape hatch, API key show/hide toggle, and the
  instructions textarea.
- Tests: projection echo, omission clears, cap validation, and the
  system-prompt assertion via a recorded fake provider body.
2026-10-31 19:09:44 -05:00

12 lines
607 B
SQL

-- 016_ai_instructions.sql — optional custom system instructions per user
-- (Settings → AI, mirroring the BYOK "instructions" field). Additive and
-- idempotent; schema.sql carries the identical column, so db-converge lands
-- the same shape on both paths.
--
-- Applied ONLY to the in-app assistant chat prompt. The server-owned
-- automation compiler and page-extraction prompts deliberately never
-- include user instructions: those are contracts (ValidateSpec, untrusted
-- fetched content), not personas.
ALTER TABLE "UserAiConfig" ADD COLUMN IF NOT EXISTS instructions text NOT NULL DEFAULT '';