Skip to content

Add Formal AI provider defaults and setup docs#277

Merged
konard merged 3 commits into
mainfrom
issue-270-377e5a73eb84
Jul 3, 2026
Merged

Add Formal AI provider defaults and setup docs#277
konard merged 3 commits into
mainfrom
issue-270-377e5a73eb84

Conversation

@konard

@konard konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #270

Summary

  • Add built-in Formal AI OpenAI-compatible provider defaults for formal-ai, formal-ai/formal-ai, @link-assistant/formal-ai, and formalai/formal-ai.
  • Add FORMAL_AI_BASE_URL and FORMAL_AI_API_KEY support for local, remote, and bearer-token-protected Formal AI servers.
  • Document Formal AI setup, server checks, wrapper context, and troubleshooting in docs/formal-ai.md, with links from the main docs.
  • Add a regression test, changeset, and issue case study data for the investigated setup.

Reproduction

Before this change, agent --model formal-ai failed with:

ProviderModelNotFoundError: Model "formal-ai" not found in any provider.

Users had to supply a manual OpenAI-compatible provider config. With this PR, Agent resolves the Formal AI selectors by default and sends requests to the canonical server model id formal-ai.

Verification

  • cd js && bun test ./tests/formal-ai-provider.ts
  • cd js && bun test ./tests/formal-ai-provider.ts ./tests/compaction-model.ts
  • cd js && npm test (605 pass, 4 todo, 0 fail)
  • cd js && npm run check
  • Live Formal AI smoke test against formal-ai serve --agent-mode --host 127.0.0.1 --port 18080, including:
    • GET /health
    • GET /api/openai/v1/models
    • OpenAI chat completion using model @link-assistant/formal-ai
    • Agent CLI runs with --model formal-ai and --model @link-assistant/formal-ai

Notes

link-assistant/formal-ai remains intentionally undocumented as an Agent selector because link-assistant is already an internal Agent provider namespace. The documented scoped selector is @link-assistant/formal-ai.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #270
@konard konard self-assigned this Jul 3, 2026
@konard konard changed the title [WIP] Add instructions on how to setup Formal AI with Agent CLI Add Formal AI provider defaults and setup docs Jul 3, 2026
@konard konard marked this pull request as ready for review July 3, 2026 22:02
@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Implemented and pushed the fix for issue #270.

PR: #277
Commit: f01c632 Add Formal AI provider defaults

What changed:

  • Added built-in Formal AI provider support for formal-ai, formal-ai/formal-ai, @link-assistant/formal-ai, and formalai/formal-ai.
  • Added FORMAL_AI_API_KEY and FORMAL_AI_BASE_URL handling.
  • Added docs/formal-ai.md, linked it from main docs, and added issue case-study data.
  • Added a regression test and changeset.

Verification:

  • bun test ./tests/formal-ai-provider.ts
  • bun test ./tests/formal-ai-provider.ts ./tests/compaction-model.ts
  • npm test passed: 605 pass, 4 todo, 0 fail
  • npm run check passed
  • Live Formal AI local server smoke test passed
  • GitHub PR checks are green; release-only jobs are skipped as expected.

PR #277 is marked ready for review, and the local worktree is clean.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $14.257055

📊 Context and tokens usage:

  • 445.4K / 200K (223%) input tokens, 39.2K / 128K (31%) output tokens

Total: (445.4K + 8.0M cached) input tokens, 39.2K output tokens, $14.257055 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Thinking level: max (~31999 tokens)
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (7070KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 71dfe8d into main Jul 3, 2026
9 checks passed
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.

Add instructions on how to setup Formal AI with Agent CLI

1 participant