Skip to content

feat(config): let Fabric customers add, edit and remove their own AI models - #2114

Merged
dawsontoth merged 3 commits into
stagefrom
claude/fabric-customer-models-2013
Nov 17, 2026
Merged

dawsontoth merged 3 commits into
stagefrom
claude/fabric-customer-models-2013

Conversation

@dawsontoth

@dawsontoth dawsontoth commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
A badger and a squirrel share one shelf of lanterns, as Fabric and a customer share an instance's AI models

⊙ Problem

On Fabric, Studio's AI Models page lists an instance's models but can't add, edit or remove one (#2013). Where Fabric supplies an instance with models, host manager used to replace the whole models block on each setup pass, so a saved model would have vanished. HarperFast/host-manager#363, now merged, keeps the customer's entries.

💡 Solution

⚖️ Alternatives

  • Set the constant to true — it would leave a branch and a notice that can never run.
  • Ask each host whether its host manager merges — nothing reports that to Studio.
  • Pass the cluster id to the save hook as an argument — the hook reads it from the route, so its two callers stay unchanged.

🤔 Is host-manager#363 running on every Fabric host?

This PR assumes so, on @dawsontoth's word. Studio can't check it. A host still running the old host manager would drop a saved model at its next setup pass, on instances Fabric supplies with models. Reverting this PR turns the feature off again.

✅ Verification

  • The page test covers both Fabric cases: add, edit and remove are offered for the customer's own models only, and below 5.4 the notice names no config file. Each case fails when its old branch is put back.
  • The save test covers a name Fabric took over after the page loaded, on a cluster and on one instance, and that nothing is managed off Fabric. Each case fails without its line of the fix. The hook test covers the cluster id reaching the save.
  • npx vitest run passes (730 files, 8,745 tests). tsc -b, oxlint and dprint check are clean.
  • In a browser, on a Fabric cluster on stage running this branch: a test model was added, was still listed five minutes and two reloads later, and was then removed. That cluster gets no models from Fabric, and there the old host manager left the block alone too, so this shows the save works through Fabric, not that host-manager#363 is deployed.

🤖 Generated by Anthropic Claude (Claude Code); posted via @dawsontoth.

Related PRs: #2099 overlaps (merged; it added this page and left Fabric read-only)
Complexity: easy

Review-Coverage: authored=claude; ran=gemini,cursor-composer,codex; adjudicated=domain; declined=cursor-grok,muse; rounds=3; full=2 @ 47bfca4

Review-Attention: read ~3m (decisions: trust-hm-deployment, cluster-id-from-route) @ 47bfca4

dawsontoth and others added 3 commits November 17, 2026 09:31
…models

Host manager used to replace an instance's whole models block on each
setup pass, so Studio offered no add, edit or remove on Fabric. Since
HarperFast/host-manager#363 it merges Fabric's entries by name and
leaves the customer's alone, so the page now offers them there too.

- Remove FABRIC_KEEPS_CUSTOMER_MODELS and the "isn't available on
  Fabric yet" notice it guarded.
- A Fabric instance below Harper 5.4 now gets the "needs Harper 5.4"
  notice, without the config-file hint a Fabric customer can't use.
- DESIGN.md describes how the block is shared with host manager.

Part of #2013

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ge loaded

A cluster save checked Fabric's names as the page loaded them, and it
has no stale check across several instances. So if central manager
began routing a name in between, the save could write the customer's
entry over Fabric's on that instance until host manager's next pass.

The save already reads the cluster again to plan its targets. It now
adds the names that read holds to the ones the page passed in, and
refuses before any write. Off Fabric nothing is managed, as before.

Part of #2013

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…stance

A save to one Fabric instance used only the names the page loaded. If
central manager began routing a name after that, and host manager had
not yet written it, the stale check saw nothing and the customer's
entry was saved, to be replaced at host manager's next pass.

On a Fabric instance route the save now reads the cluster and adds
that instance's names, as a cluster save already does. Off Fabric it
makes no cluster read. The save hook passes the route's cluster id.

Part of #2013

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@dawsontoth
dawsontoth requested a review from a team as a code owner November 17, 2026 14:58
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.89% 23185 / 26993
🔵 Statements 85.69% 24610 / 28717
🔵 Functions 81.87% 6453 / 7882
🔵 Branches 81.42% 20264 / 24887
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/features/instance/config/aiModels/index.tsx 86.95% 80.55% 79.31% 86.15% 39-44, 126, 132, 134, 251-264
src/features/instance/config/aiModels/saveModelChange.ts 100% 97.61% 100% 100%
src/features/instance/config/aiModels/useSaveModelChange.ts 100% 100% 100% 100%
src/integrations/api/instance/models/models.ts 100% 100% 100% 100%
Generated in workflow #2604 for commit 47bfca4 by the Vitest Coverage Report Action

@dawsontoth
dawsontoth added this pull request to the merge queue Nov 17, 2026
Merged via the queue into stage with commit ff55a7f Nov 17, 2026
11 checks passed
@dawsontoth
dawsontoth deleted the claude/fabric-customer-models-2013 branch November 17, 2026 15:52
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