fabiotaroc adds OpenAI as a third LLM provider
fabiotaroc wired the OpenAI Responses API into Mike's provider abstraction, adding streaming, tool calling, and per-user key storage. The plumbing is additive and isolated - existing Claude and Gemini paths are untouched.
A new backend/src/lib/llm/openai.ts (167 lines) handles streaming, tool calls, and optional reasoning summaries via the OpenAI Responses API. index.ts routes gpt-* model IDs to it, and tools.ts gets a toOpenAIResponsesTools adapter parallel to the existing Gemini one. The Provider union and UserApiKeys type gain an "openai" arm.
Per-user key storage follows the same pattern as Claude and Gemini. Migration 001_add_openai_api_key.sql adds openai_api_key text to user_profiles. There's a minor issue: the one-shot baseline 000_one_shot_schema.sql is also patched to include the column. Fresh installs and existing DBs now have ambiguous migration paths - 001_*.sql adds the column, but so does the patched baseline. On a new install, applying 001_*.sql after the baseline will hit the IF NOT EXISTS guard silently, but the intent is muddled. Worth reverting the baseline edit in favor of a pure additive migration.
The registered model IDs - gpt-5.5, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano - are forward-dated and don't correspond to currently available models. They'll need to be updated before this is usable.
One thing worth borrowing regardless: the updateApiKey refactor in UserProfileContext (lines 252-267) replaces a chain of binary ternaries with a per-provider lookup table. Cleaner pattern for any fork managing multiple provider keys.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?