Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

offer every harness a cross-protocol backend declares in the add-harness picker (#6460)

[._.]/ Adam Eivy2af7498b74cb
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index b9a32d1a44..b0dfaa1d2c 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -157,7 +157,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `mediaCollectionList.js` | Search / sort ordering for the Media Collections grid (#3283) and the `CollectionPickerShell` dropdown (#3312): `applyCollectionView(collections, { query, sort })` filters via `mediaSearch.js`'s AND-token matcher over name+description and orders synthetic "Unsorted" → non-empty-or-user-created → auto-generated empties, then by `COLLECTION_SORTS` (`updated` / `name` / `count`, `normalizeCollectionSort` coerces an unknown/URL value); keys are derived once per record, not per comparison. "Hide empty" is deliberately NOT a parameter — the page owns that one predicate (`collectionItemCount(c) > 0`) because it also needs the pre-filter count. `isAutoCollection(c)` recognizes a machine-created collection from ANY of four independent markers (`AUTO_NAME_PREFIXES`, `Auto-created…`/`Auto-generated…` description, `uc-`/`sc-` id, universe/series link) so a record predating a given marker still classifies; `splitCollectionName(name)` lifts the shared `Creative Director: ` / `Writers Room: ` / `Universe: ` / `Series: ` prefix into a badge label so the distinguishing tail survives truncation, and name sorting uses that stripped title. **Adding a server-side auto-creator means adding its prefix here** or its collections silently rank as user-created. Pure — no React. |
| `mediaSearch.js` | `buildMediaHaystack`, `tokenizeQuery`, `matchHaystack`, `filterByQuery` — client-side AND-token search over normalized media items (prompt/model/seed/LoRA/universe tags). Shared by MediaHistory + the Image Gen gallery picker. |
| `ports.js` | `PORTS` + `DEFAULT_PEER_PORT`, re-exported from the pure leaf `server/lib/ports.js` (which `ports.test.js` pins against `ecosystem.config.cjs`, the source of truth — see docs/PORTS.md). Use these instead of re-hardcoding a port literal in a form default, a copy-paste help string, or a cross-machine URL. |
-| `providerManagement.js` | Joins the `GET /api/providers/management` graph into one row per connection (`groupGraphByConnection`, `findConnectionGroup`), and reads a binding's shared-model state honestly: `bindingModelOffer` (empty `selectedModels` = the whole catalog, not none), `staleSelectedModels` (pins the catalog no longer offers — reported, never repaired), `catalogSummary` (keeps `unknown` / `known`-and-empty / `failed` distinct). `routeOverrideDraft` / `routeOverridePatch` are the mode-override form pair: they walk whatever settings the server published for a route rather than naming fields, send only CHANGED keys, read a blank text field as `null` (unpinned) and a blank timeout as no change. `routeModelAliasRows` renders a route’s canonical→executable aliases with the hand-authored ones marked, and a manual alias naming a spelling the route no longer lists flagged stale rather than dropped. `connectionProtocol` / `transportProtocolOptions` / `harnessOptionsFor` drive the create controls from what the SERVER published (`creatableHarnesses`, `creatableConnectionKinds`) rather than a mirrored table — offering only harnesses that speak a backend’s transport, and naming the credential one still needs. |
+| `providerManagement.js` | Joins the `GET /api/providers/management` graph into one row per connection (`groupGraphByConnection`, `findConnectionGroup`), and reads a binding's shared-model state honestly: `bindingModelOffer` (empty `selectedModels` = the whole catalog, not none), `staleSelectedModels` (pins the catalog no longer offers — reported, never repaired), `catalogSummary` (keeps `unknown` / `known`-and-empty / `failed` distinct). `routeOverrideDraft` / `routeOverridePatch` are the mode-override form pair: they walk whatever settings the server published for a route rather than naming fields, send only CHANGED keys, read a blank text field as `null` (unpinned) and a blank timeout as no change. `routeModelAliasRows` renders a route’s canonical→executable aliases with the hand-authored ones marked, and a manual alias naming a spelling the route no longer lists flagged stale rather than dropped. `connectionProtocols` / `connectionProtocol` / `transportProtocolOptions` / `harnessOptionsFor` drive the create controls from what the SERVER published (`creatableHarnesses`, `creatableConnectionKinds`) rather than a mirrored table — offering every harness that speaks one of a backend’s DECLARED transports (a cross-protocol row offers both), and naming the credential one still needs. |
| `morsePractice.js` | Pure deterministic adaptive Morse sampler — `selectMorsePrompt` combines bounded weak-character/confusion weighting with a non-zero exploration floor and only emits material valid for the active Koch pool; `canAdvanceMorseLevel` guards level advancement on sample count, accuracy, and effective speed. |
| `moodBoardItemSrc.js` | `moodBoardItemSrc(item)` resolves a mood-board item to a display image/poster src (`imageUrl` → served `image:<file>` bytes → derived video thumbnail → null); `moodBoardItemVideoSrc(item)` resolves a `type:'video'` item's playback URL; `moodBoardItemAnalysisSource(item)` resolves an item to a prompt-from-media source (null when not a local gallery asset). Shared by MoodBoardDetail + MoodBoardReferenceStrip. |
| `rapidReaderPosition.js` | Cursor-to-word mapping plus privacy-preserving Rapid Reader progress persistence keyed by a text fingerprint; stores position/settings without storing pasted source text. |
diff --git a/client/src/lib/providerManagement.js b/client/src/lib/providerManagement.js
index 654cfd2c50..1c4c21f818 100644
--- a/client/src/lib/providerManagement.js
+++ b/client/src/lib/providerManagement.js
@@ -223,8 +223,18 @@ export function routeModelAliasRows(route) {
// which harnesses carry a command recipe, and which backend kinds a minted
// route can honestly describe, are server decisions.
-/** The one transport protocol a connection declares, or `null`. */
-export const connectionProtocol = (connection) => Object.keys(connection?.transports || {})[0] || null;
+/**
+ * Every transport protocol a connection declares.
+ *
+ * More than one is normal on a backend a human linked across protocols — one
+ * Ollama daemon reached by Claude on its Anthropic port and by Codex on `/v1`
+ * is ONE backend, and the server accepts a harness for any protocol the row
+ * declares (#6460).
+ */
+export const connectionProtocols = (connection) => Object.keys(connection?.transports || {});
+
+/** The FIRST transport protocol a connection declares, or `null` — for copy that names one. */
+export const connectionProtocol = (connection) => connectionProtocols(connection)[0] || null;
/**
* Transport protocols a new backend may declare, each with the programs that
@@ -249,25 +259,28 @@ export function transportProtocolOptions(graph) {
/**
* The harnesses that can be added to THIS backend, plus the direct API option.
*
- * Filtered by the backend's declared protocol rather than offered and then
- * refused: the server rejects a harness that does not speak it, and an option
- * whose only outcome is a 409 is not an option. `needsCredential` is why an
- * otherwise-valid choice will still be refused, so the row can say so before
- * the click rather than after it.
+ * Filtered by the protocols the backend DECLARES rather than offered and then
+ * refused: the server rejects a harness that speaks none of them, and an option
+ * whose only outcome is a 409 is not an option. A row declaring two protocols
+ * offers the harnesses for both — that is the whole point of a cross-protocol
+ * link, and the server mints a route for either one (#6460).
+ *
+ * `needsCredential` is why an otherwise-valid choice will still be refused, so
+ * the row can say so before the click rather than after it.
*
* @returns {{harnessId:string|null, label:string, modes:string[], needsCredential:string|null}[]}
*/
export function harnessOptionsFor(graph, connection) {
- const protocol = connectionProtocol(connection);
+ const protocols = connectionProtocols(connection);
const harnesses = (Array.isArray(graph?.creatableHarnesses) ? graph.creatableHarnesses : [])
- .filter((harness) => harness.protocol === protocol)
+ .filter((harness) => protocols.includes(harness.protocol))
.map((harness) => ({
harnessId: harness.id,
label: harness.label,
modes: harness.modes,
needsCredential: harness.credentialRequired && !connection?.hasCredentials ? harness.credentialKey : null,
}));
- return protocol === 'openai'
+ return protocols.includes('openai')
? [...harnesses, { harnessId: null, label: 'Direct API', modes: ['api'], needsCredential: null }]
: harnesses;
}
diff --git a/client/src/lib/providerManagement.test.js b/client/src/lib/providerManagement.test.js
index e9e3ff6c70..d59efbb050 100644
--- a/client/src/lib/providerManagement.test.js
+++ b/client/src/lib/providerManagement.test.js
@@ -13,7 +13,13 @@
* (`components/providers/ProviderConnections.test.jsx`).
*/
import { describe, expect, it } from 'vitest';
-import { bindingModelOffer, catalogSummary, groupGraphByConnection, staleSelectedModels } from './providerManagement.js';
+import {
+ bindingModelOffer,
+ catalogSummary,
+ groupGraphByConnection,
+ harnessOptionsFor,
+ staleSelectedModels,
+} from './providerManagement.js';
const connection = (models, state = 'known') => ({
id: 'conn-1', catalog: { state, models },
@@ -81,3 +87,33 @@ describe('groupGraphByConnection', () => {
expect(groups[0].bindings[0].label).toBe('Claude Code');
});
});
+
+describe('harnessOptionsFor', () => {
+ const GRAPH = {
+ creatableHarnesses: [
+ { id: 'claude', label: 'Claude Code', protocol: 'anthropic', modes: ['cli', 'tui'], credentialRequired: true, credentialKey: 'ANTHROPIC_AUTH_TOKEN' },
+ { id: 'codex', label: 'Codex CLI', protocol: 'openai', modes: ['cli'], credentialRequired: false, credentialKey: null },
+ ],
+ };
+
+ it('offers the harnesses for EVERY protocol a cross-protocol backend declares', () => {
+ // One daemon reached on two ports is one backend, and the server mints a
+ // route for either protocol (#6460) — hiding one here would make the
+ // second harness link-only in a UI that can already create it.
+ const options = harnessOptionsFor(GRAPH, {
+ hasCredentials: true,
+ transports: { anthropic: { baseUrl: 'http://127.0.0.1:11434' }, openai: { baseUrl: 'http://127.0.0.1:11434/v1' } },
+ });
+ expect(options.map((option) => option.label)).toEqual(['Claude Code', 'Codex CLI', 'Direct API']);
+ });
+
+ it('still hides a harness no declared transport speaks', () => {
+ const options = harnessOptionsFor(GRAPH, { transports: { openai: { baseUrl: 'http://127.0.0.1:11434/v1' } } });
+ expect(options.map((option) => option.label)).toEqual(['Codex CLI', 'Direct API']);
+ });
+
+ it('names the credential a keyless backend still needs rather than hiding the choice', () => {
+ const [claude] = harnessOptionsFor(GRAPH, { transports: { anthropic: { baseUrl: 'http://127.0.0.1:11434' } } });
+ expect(claude).toMatchObject({ harnessId: 'claude', needsCredential: 'ANTHROPIC_AUTH_TOKEN' });
+ });
+});