Skip to content

feat(ai): finish engine wiring — briefings via provider, flyer honors key - #84

Merged
NewWorldVenture merged 1 commit into
mainfrom
claude/funny-darwin-gkmptm
Jun 22, 2026
Merged

NewWorldVenture merged 1 commit into
mainfrom
claude/funny-darwin-gkmptm

Conversation

@NewWorldVenture

Copy link
Copy Markdown
Owner

What

Finishes the configurable AI-engine wiring (#79 follow-up, backlog item #2) so the /admin/ai engine setting takes effect across all AI features.

  • Provider interface: complete() now accepts an optional maxTokens (default 1024) — needed for the long JSON briefings.
  • Briefing (/api/ai/briefing) and Weekly briefing (/api/ai/weekly-briefing): migrated off the direct Anthropic SDK to resolveProvider() (maxTokens 2000 / 2600). They now honor the configured engine + key.
  • Flyer (/api/ai/flyer): PDF/vision input is Anthropic-specific, so it keeps the Anthropic SDK — but now reads the admin-configured Anthropic key/model via getAIConfig and returns a clear 503 if no Anthropic key is set (instead of silently using only the env var).

After this, the only @anthropic-ai/sdk usage is the intentional flyer path.

Verification

tsc ✅ · next lint ✅ · next build ✅ · full suite 363/363 ✅. No migration.

Note

If you switch the engine to OpenAI, flyer still needs an Anthropic key set in Admin → AI Engine (OpenAI chat can't ingest PDFs; an OpenAI-vision path for images would be a separate follow-up).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BVdGmgvtEjp4ZSqcES7ThJ


Generated by Claude Code

… key

Finishes the configurable-AI-engine wiring so the /admin/ai setting takes
effect everywhere:
- Adds optional maxTokens to the provider complete() interface (default 1024).
- Migrates the morning/evening briefing and weekly briefing off the direct
  Anthropic SDK to resolveProvider() (maxTokens 2000 / 2600).
- Flyer keeps the Anthropic SDK (PDF/vision is Anthropic-specific) but now
  reads the admin-configured Anthropic key/model via getAIConfig and returns
  a clear 503 if no Anthropic key is set.

No more direct @anthropic-ai/sdk usage except the intentional flyer path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVdGmgvtEjp4ZSqcES7ThJ
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
familyos Building Building Preview, Comment Jun 22, 2026 4:03pm

Request Review

@NewWorldVenture
NewWorldVenture merged commit 3385f36 into main Jun 22, 2026
3 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 30954b77 Deployed Jun 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants