Repository navigation
Use macOS 27's fm CLI as a free local LLM for housekeeping - #368
Merged
currentbits merged 6 commits intoAug 17, 2026
Merged
Conversation
electron/fm.js wraps macOS 27's fm CLI as a best-effort, never-throwing one-shot prompt runner. Not a providers.js entry: fm has no tool loop and no resumable session, so listing it there would surface it in the model picker as an agent it is not. Returns null off-Mac, pre-macOS-27, on timeout and on non-zero exit so every caller keeps its existing fallback path. Co-Authored-By: Claude Opus 5 <[email protected]>
suggestCommitMessage now runs the housekeeping prompt through fmRun before spawning the thread's billed provider CLI. A usable fm subject is cleaned and returned with no provider spawn; any fm miss, timeout, or non-zero exit is invisible and the existing print-mode path is unchanged. Provider-path tests pin CODER_FM_DISABLE=1 so a real fm cannot hijack them.
fm needs no CLI, no key and no account, so a thread whose provider binary is missing or has no print mode should still get a free subject rather than "CLI is not installed". Provider resolution now happens only on the fallback path; every existing error message survives, just reached later. The not-installed test gets CODER_FM_DISABLE=1 — without it a real macOS 27 fm would answer and leave nothing to reject. Co-Authored-By: Claude Opus 5 <[email protected]>
After the first completed assistant reply, ask the on-device fm CLI for a short title when the thread still has the default or first-prompt-line stamp. Reuses cleanSubject; never overwrites a user-set title; degrades to a no-op when fm is missing.
…into coder/use-macos-27-s-fm-cli-as-a-free-local-ll-78ef98
maybeApplyFmTitle stamped fmTitleAt on the failure path, so the first successful turn on any pre-macOS-27 or non-Mac machine permanently opted the thread out — every existing thread would stay untitled after an OS upgrade, and every thread paid a store write for a feature that did nothing. The marker is now written only when a title is actually applied. Retrying costs one uncached `which` miss per successful turn. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/use-macos-27-s-fm-cli-as-a-free-local-ll-78ef98
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #340.
macOS 27's
fmCLI gives on-device / Private Cloud Compute inference from the shell with no key, no account and no bill. This wires it in as the preferred backend for housekeeping prompts, falling back to what we do today whenever it is not there.The seam
electron/fm.js—fmAvailable(env)andfmRun(prompt, { env, timeoutMs }).fmRunreturns trimmed stdout, ornulloff-Mac, pre-macOS-27, on timeout, on non-zero exit and on empty output. It never throws and never rejects, so every caller keeps its existing path unchanged.Deliberately not a
providers.jsentry:fmhas no tool loop and no resumable session, so listing it there would surface it in the model picker as an agent it is not. It borrowsproviders.isBinAvailableso PATH/whichresolution matches every other CLI we spawn.Consumers
Commit messages (
electron/commitmsg.js) — the only housekeeping call that was already billing a cloud CLI.fmis tried before the provider is resolved, so a Mac with no billed CLI installed now gets a subject instead of"<provider> CLI is not installed". Every existing error message survives, just reached later on the fallback path.Thread titles (
electron/fm-title.js, hooked intoafterSuccessfulTurninrunner.js) — fire-and-forget, so it never blocks checkpoint or verify. Replaces the"New Thread"/ first-prompt-line stamp with a short generated title, once per thread, and never overwrites a title the user set. ReusescleanSubjectandTHREAD_TITLE_MAXrather than reinventing them. The run-once marker is written only when a title actually lands, so a machine withoutfmtoday is not permanently opted out after the macOS 27 upgrade.Verification
1025 pass / 1 failon the electron suite; the failure is the knownweb-integrationreconnect baseline, present onmain.npm run typecheckclean.Known gap
buildFmArgscould not be run against the real binary — this machine is macOS 26.5.2 andfmships in September. The guess (prompt positional, last, matching the convention every provider follows) is isolated to that one function, withCODER_FM_ARGSto prepend flags so a wrong guess is an env var rather than a release. #366 tracks verifying it, including whetherfm's offline path prints an error string our first-line-only callers would happily commit as a subject.Scope
Of the five targets in #340, only commit messages were an existing billed call. Notification batching and kanban triage do no LLM work today, and memory consolidation (#301) has no code yet — those would be net-new features, so they are left alone and the seam will be waiting.
🤖 Generated with Claude Code