iachat/enterprise/app/jobs/captain
Rodribm10 928b1ec6b9 feat(captain): Codex OAuth auth module + proxy controller
Implementa Fases 1+2 do plano Captain Codex OAuth.

Fase 1 — Auth módulo:
- Migration captain_codex_credentials (tokens AR-encrypted)
- Model Captain::CodexCredential (singleton-ish com .current)
- Captain::Codex::AuthService com device flow completo:
  start_device_login, poll_once, exchange_for_credential,
  valid_access_token (auto-refresh), refresh!
- Rake task captain:codex:{login,status,refresh}
- Sidekiq job Captain::Codex::RefreshTokensJob rodando a cada 30min

Fase 2 — Proxy Chat Completions → Responses:
- Captain::Codex::Translator (chat ↔ responses, tools, tool_calls)
- Captain::Codex::Client (streaming SSE → agregado)
- Api::Internal::CodexProxyController expondo
  POST /codex/v1/chat/completions
- 10 specs do Translator passando

Próximo: Fase 3 (feature flag + fallback) e reconfiguração dos
clientes RubyLLM/Agents/ruby-openai pra apontarem pro proxy quando
CAPTAIN_LLM_PROVIDER=openai_codex_oauth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 15:07:01 -03:00
..
codex feat(captain): Codex OAuth auth module + proxy controller 2026-04-22 15:07:01 -03:00
contact_memories feat(captain-memory): add HardDeleteExpiredJob with daily cron (LGPD) 2026-04-19 01:09:28 -03:00
conversation feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
copilot feat: Instrument captain (#12949) 2025-11-28 15:12:55 +05:30
documents chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00
lifecycle feat(lifecycle): implement DispatcherJob 2026-04-15 09:20:32 -03:00
llm feat: legacy features to ruby llm (#12994) 2025-12-11 14:17:28 +05:30
notifications refactor: move notification templates de units para inboxes 2026-03-01 22:17:27 -03:00
payments feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
reports feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
retention feat(retention): foundation for customer retention metrics 2026-04-22 09:50:23 -03:00
roleta feat(captain): semantic memory fixes + roleta + reclamações + analytics 2026-04-21 15:36:25 -03:00
tools fix: Captain response builder not getting triggered (#12729) 2025-10-28 18:31:08 -07:00
inbox_pending_conversations_resolution_job.rb feat: Improve Captain interactions, activity messages (#11493) 2025-05-16 19:27:57 -07:00