Commit Graph

4 Commits

Author SHA1 Message Date
Loma Bot Ops bb840a54ff Fix Codex model and schema: revert to gpt-5.6-sol, strip $schema from Zod output
RCA:
- gpt-5.6-sol is the only model supported by this ChatGPT account; other models
  (gpt-4.1-mini, o4-mini, gpt-4o) all return model_not_in_accessible_catalog
- Zod v4 toJSONSchema emits a $schema meta field that gpt-5.6-sol rejects as an
  invalid schema keyword; strip it before passing to the automation worker

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-11-26 10:01:29 +07:00
Loma Bot Ops 7c4a24ce29 Fix Codex model: use o4-mini which is supported with ChatGPT accounts
gpt-4.1-mini is an API-only model and returns model_not_found when Codex
is authenticated via a ChatGPT account. o4-mini is verified to work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-11-26 09:44:25 +07:00
Loma Bot Ops 0ba3a5486c Improve automation worker error messages and inbox AI multi-bubble replies
- automation.ts: distinguish network/timeout errors from generic failures
- aiAutoReply.ts: upgrade to multi-bubble reply system with female particle enforcement
- codex-runtime.mjs: revert default model to gpt-4.1-mini

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-11-26 09:26:54 +07:00
Loma Bot Ops 6994ba1a4e Move AI to Codex CLI + ChatGPT browser workers with a durable post queue
Text generation now runs through a PM2 automation worker (codex exec) and
images through the ChatGPT Chrome extension, replacing the Anthropic API.
generateStructured keeps its signature; results are Zod-validated on the web
side and the worker is reached with a bearer secret.

- AI image assistant in the post editor: editable prompt step, then image
  (square or 3:2 only, since Instagram rejects 2:3), stored via putBlob
- Full-post queue (PostGenerationJob + migration): enqueue returns 202, FIFO
  claim under an advisory lock, heartbeat, stale-job failure, per-user
  request key, cancel while QUEUED; output is always a DRAFT with audit rows
- Separate 10 images/page/day quota; text quota excludes images
- Worker reports Codex usage-limit as 429 with a clear Thai message
- Docs: AI-AUTOMATION.md, ARCHITECTURE/README/.env.example updated

Known gap: the live FIFO queue check (scripts/check-post-queue.mjs) has not
passed yet; the last run hit the Codex account usage limit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:52:09 +07:00