singularity-forge/packages
frizynn 1c5fdc9144 refactor: consolidate shared code between OpenAI providers
Extract duplicated patterns from openai-completions.ts,
openai-responses.ts, and azure-openai-responses.ts into a new
openai-shared.ts module:

- getOpenAIClass: unified lazy SDK loading (was duplicated in both)
- createOpenAIClient: shared client creation with Copilot headers,
  options header merging, and lazy loading (was ~30 lines each)
- buildInitialOutput: AssistantMessage initialization (was ~15 lines x3)
- assertStreamSuccess / finalizeStream / handleStreamError: stream
  lifecycle helpers (was ~10 lines each x3)
- clampReasoningForModel: reasoning effort clamping for gpt-5.x models
  (was duplicated in openai-responses.ts and azure-openai-responses.ts)

Net reduction: ~185 lines removed across the three provider files.
2026-03-19 16:39:12 -03:00
..
native fix: graceful fallback when native addon is unavailable on unsupported platforms (#1225) 2026-03-18 13:28:01 -06:00
pi-agent-core fix: add exports fields to pi-tui and pi-agent-core packages (#991) 2026-03-17 17:05:47 -06:00
pi-ai refactor: consolidate shared code between OpenAI providers 2026-03-19 16:39:12 -03:00
pi-coding-agent fix: emit agent_end after abort during tool execution (#1414) (#1417) 2026-03-19 10:24:39 -06:00
pi-tui fix: add JS fallbacks for wrapTextWithAnsi and visibleWidth when native addon unavailable (#1418) (#1428) 2026-03-19 10:49:13 -06:00