Skip to content

Add Formal AI dispatch for every agentic CLI - #2108

Merged
konard merged 7 commits into
mainfrom
issue-2059-63566327c7b1
Jul 26, 2026
Merged

Add Formal AI dispatch for every agentic CLI#2108
konard merged 7 commits into
mainfrom
issue-2059-63566327c7b1

Conversation

@konard

@konard konard commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #2059.

Problem

solve <issue> --tool agent --model formal-ai --only-prepare-command was rejected during model validation. Formal AI was not registered for any Hive Mind tool, and there was no supported persistent Formal AI service for host or Docker-isolated runs.

Solution

  • register formal-ai for Agent, Claude, OpenCode, Codex, Qwen, and Gemini
  • route the selected tool through formal-ai with, using formalai/formal-ai where Agent/OpenCode require a provider-qualified model
  • preserve every tool's native execution path and existing default model
  • make --only-prepare-command assemble the real wrapped executor command without invoking a CLI or mutating OpenCode configuration
  • validate both the Formal AI wrapper and selected native CLI during connection checks
  • install pinned Formal AI 0.305.0 binaries in all Hive Mind runtime images
  • add a separate privileged Dockerfile.formal-ai service with standard port 8080 and persistent /home/box/.formal-ai memory
  • connect Hive Mind and the sidecar on the explicit link-assistant-formal-ai Docker network/hostname
  • forward the persistent endpoint into nested Docker isolation, resolving the outer Compose hostname before crossing Docker-daemon boundaries
  • document requirements, architecture, benchmark evidence, and the measurable gate for any future default-model promotion under docs/case-studies/issue-2059/

Reproduction and regression coverage

Before this change, the minimal reproduction was rejected:

solve https://github.com/owner/repo/issues/1 \
  --tool agent \
  --model formal-ai \
  --only-prepare-command

tests/test-issue-2059-formal-ai-dispatch.mjs now covers:

  • both Formal AI model identifiers
  • wrapper dispatch and public prepared-only execution for all six tools
  • native command preservation
  • external server flags and wrapper override path
  • connection preflight
  • nested Docker endpoint propagation and hostname resolution
  • Docker image, network, hostname, port, and persistent-memory contracts

Verification

  • npm test — all 352 selected test files passed
  • focused issue suite — 31/31 passed
  • ESLint — passed with zero warnings
  • Prettier, MJS syntax, file-line limits, duplication threshold, documentation validation, and language synchronization — passed
  • changeset and version checks — passed
  • all four Dockerfiles passed docker build --check
  • Compose configuration rendered successfully
  • Formal AI 0.305.0 built in the pinned Rust 1.96 builder, ran in the Ubuntu 24.04 Hive Mind base, and reported a compatible maximum GLIBC requirement of 2.34
  • real wrapper smoke tests accepted all six target CLIs
  • live Formal AI server /health returned OK on port 8080

This is not a visual/UI change, so screenshots are not applicable.

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

Issue: #2059
@konard konard self-assigned this Jul 26, 2026
@konard konard changed the title [WIP] Allow --tool agent --model formal-ai dispatch and for all other tools also Add Formal AI dispatch for every agentic CLI Jul 26, 2026
@konard
konard marked this pull request as ready for review July 26, 2026 19:30
@konard

konard commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Working session summary

Completed and ready for review: PR #2108 — Add Formal AI dispatch for every agentic CLI.

Implemented:

  • Formal AI dispatch for Agent, Claude, OpenCode, Codex, Qwen, and Gemini.
  • Persistent Formal AI sidecar, port 8080, named Docker network, and nested-container routing.
  • Runtime-image installation, validation, documentation, changeset, and detailed case study.
  • Existing default models remain unchanged pending the documented capability gate.

Verification:

  • Focused tests: 31/31 passed.
  • Full local suite: all 352 files passed.
  • Fresh CI run: all required checks passed, including Docker runtime verification.
  • PR is mergeable, CLEAN, current with main, and the worktree is clean.

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

@konard

konard commented Jul 26, 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.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $94.000600

📊 Context and tokens usage:

  • 1.6M / 200K (784%) input tokens, 177.6K / 128K (139%) output tokens

Total: (1.6M + 70.3M cached) input tokens, 177.6K output tokens, $94.000600 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (21248KB)


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

@konard

konard commented Jul 26, 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 2c9bf28 into main Jul 26, 2026
25 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.

Allow --tool agent --model formal-ai dispatch and for all other tools also

1 participant