Skip to content

feat(cli): add Morphfactory (BETA) provider selection - #45

Merged
TaewoooPark merged 1 commit into
mainfrom
codex/morphfactory-provider
Oct 15, 2026
Merged

TaewoooPark merged 1 commit into
mainfrom
codex/morphfactory-provider

Conversation

@TaewoooPark

@TaewoooPark TaewoooPark commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Motifcode previously assumed an Infron key at first launch. This adds Morphfactory (BETA) as a selectable Motif-3 provider while keeping existing Infron connections and accounting behavior intact.

  • First launch offers Infron or Morphfactory (BETA). /provider, the Provider row in /config, and /config provider <id> switch the running session and save the endpoint/model through the existing settings path. --provider selects a preset for scripts; explicit endpoint/model flags still override it.
  • Store the Morphfactory key separately as MOTIF_MORPHFACTORY_API_KEY. Infron keeps MOTIF_API_KEY; switching and logout preserve the other provider's key. Both credentials are withheld from child processes. Endpoint/key changes are synchronous, and a pending login cannot verify its submitted key against a newly selected provider.
  • Reuse the existing OpenAI-compatible transport with the console's documented https://api-cbt.morphfactory.io/v1 endpoint and motif/motif-3 model. Login, status and authentication errors identify the selected provider. No dependency, model protocol, version or Infron accounting changes.

Validation:

  • Frozen install, typecheck, build, tool-schema lint and diff checks pass. 1,671 tests across 97 files pass locally. The packed CLI recognizes the Morphfactory preset. Four provider UI regressions fail on base 9c34b45 and pass here; additional cases cover credential round trips, logout, canonical URLs and batched-input login/switch races.
  • CI for head e1abed9 passes all five jobs: TypeScript on Node 20/22, Linux ARM64, Python and template goldens.
  • Actual built CLI in visible Chrome xterm.js 6.0.0 over a macOS PTY, with isolated HOME and dummy credentials: first-run selection and masked login, existing Infron startup, provider switching through slash commands and Config, returning to the retained Infron credential, and persistence across restart. Provider controls remain usable at 80×12 as well as 110×34. UI fixtures are separate from the live checks below.
  • Live Morphfactory: authentication and model discovery, structured tool calls, separate reasoning, read/write/patch/bash/terminal/skill/subagent/local MCP paths, token usage and prefix caching. A patch → terminal → done task completes with exit 0. Compaction of an actual successful CLI transcript and subsequent recall pass. Actual SSE streaming, cancellation after the first delta and a subsequent request also pass. Synthetic workspaces only; no project content or credentials are committed.

Boundaries: Morphfactory returns 404 for /v1/completions, so the existing experimental object/raw channels are unavailable. Account balance and reported credit costs remain Infron-only; local token usage works with either provider. Infron is currently unavailable and was checked through existing protocol/accounting tests and UI fixtures, not a live call. One deliberately capped broad live task reached its turn limit after executing its tools; a narrower task completed cleanly. This PR does not claim to change model reliability or serving speed. No merge or release is included.

@TaewoooPark

Copy link
Copy Markdown
Owner Author

Validated the final head e1abed9b4425914ac54a8148888acf7f2964a899 and the provider-switching paths before merging.

  • Local gates passed: frozen install, typecheck, build, all 1,671 tests across 97 files, tool-schema lint, and diff check.
  • All five CI jobs passed, including Node 20/22, Linux ARM64, Python, and goldens.
  • Visible PTY checks covered first-run selection, existing-user switching, separate credentials, narrow terminals, persistence after restart, and clean exit.
  • Live Morphfactory checks covered authentication, streaming, tool calls, subagents, MCP, compaction/recall, cancellation, and retry. Existing Infron wiring was preserved; its live service was unavailable.

Morphfactory's experimental raw/object completion path remains unavailable because /v1/completions returns 404; balance/credit reporting remains Infron-specific. These limits are documented. The requested 0.4.2 release will follow in a separate version-only change.

@TaewoooPark
TaewoooPark merged commit 62702c4 into main Oct 15, 2026
5 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.

1 participant