Repository navigation
Description
Summary
When a machine joins a Home as a Remote Link Child, which clients are routed into OpenCodex ("Route to": Codex, Claude, Claude Desktop, Grok, Aside, OpenCode, Pi, ...) should follow the Home by default, and each client's config should be materialized on the Child for that Child (its own paths, OS, listener port, installed clients, and Aside accounts). A person should also be able to see and change this per device from the CLI, the way ocx fallback --device already works.
Today only codex and claude can be selected for a Child (selectedClients, max 2). Every other integration is refused on the Child as Home-owned. The Home's own integration commands only write the Home's files, so a Child cannot get Aside, Claude Desktop, Grok, or any file integration without hand-editing.
Observed 2026-11-07 (two real Children, OpenCodex 2.98.0)
Home: macOS, juns-MacBook-Pro. Children: parkjs101 (macOS) and parkjs-win (Windows 11, Git Bash over OpenSSH).
- Both Children came up with
selectedClients: ["codex","claude"]. There was no way to ask for Aside. - On the Child, the integration commands are refused:
ocx integration client status --client asideprintedThis machine is a Remote Link Child managed by Home ... GET /api/client-integrations/aside/profiles runs on the Home, not on this Child.ocx inspect client-config --client asidewas refused the same way forGET /api/client-config.
- On the Home,
ocx integration client enable --client asidecan only target the Home's own~/.aside/u/<id>/models.json. Those<id>slots are per machine: the Mac Child has u0 and u1, the Windows Child has only u0, and the people behind them differ. - Workaround used: run
ocx inspect client-config --client asideon the Home, then copy theproviders.opencodexblock (baseUrlhttp://127.0.0.1:10100/v1,opencodex-loopback, 23 models) into each Child's Asidemodels.jsonby script. It works, but nothing owns it now: there is no journal, no refresh when the catalog changes, and no clean removal on disconnect. - The Home catalog and the Aside block drift apart. The Home-generated Aside block had
command-code/deepseek-deepseek-v4.1-flash-fast, while the Child's/v1/modelsservescommand-code/deepseek/deepseek-v4.1-flash-fast. A per-device materialization built from the Child's own served catalog would not drift. - Related breakage:
ocx disconnectonparkjs-win(and onclisu-oracle) failed with "Codex journal restore was partial" and leftrotation: recovery-required. Home sync then skipped the Child withchild-link-mismatch:disconnect_pending. The cause was that the user had edited~/.codex/config.tomlafter injection (model, hooks, trusted projects, Computer Use paths), so the whole-fileinjectedConfigHashno longer matched.- Recovery that worked: write
originalConfigback byte-for-byte, thenocx disconnect(restored: true), then re-apply the user's later edits, then restart the service, thenocx link addagain from the Home. - Extra trap: after disconnect, the service-owned process kept running with
role:"client".ocx restartandocx service restartboth kept it alive, soocx link addfailed withChild restart preflight(409,child_restart_unsupported). Killing the process was needed. - Materializing more clients on a Child makes this restore path matter more, so it is part of the acceptance criteria below.
- Recovery that worked: write
Design
Two layers
1. Route intent (Home-owned, synced to Children by default)
- Per client:
on | off, plus client policy knobs that are decisions rather than facts, such as--model-names alias|routed. - Aside account selection is expressed as
all | none | [Aside userId...]. Never use numericu/N, because slot numbers differ per machine. - It never contains paths, ports, profile slot ids, or credentials.
- Follow the precedent of
src/link/codex-settings.ts([Bug]: Remote Link Child does not inherit the Home's model settings, dashboard or management CLI #6957): a versionedHomeRouteIntentDocument, served on a new authenticated link readGET /v1/link-management/route-intent. Each Child receives only its own effective view: Home defaults merged with that device's overrides. - Digest: add
appliedRouteIntentDigestto the link peer report next toappliedCodexSettingsDigest, and show it inocx link status.
2. Device materialization (Child-owned, local writes)
- The Child's own server applies the intent to the Child's own files, using:
- its own listener URL (
127.0.0.1:<child port>); - its own OS paths (Windows
C:\Users\..., macOS~/Library/...); - its own installed-client detection;
- its own Aside
accounts.json, soallmeans every local Aside profile and a userId list matches by userId; - its own catalog, so model ids come from what this Child serves.
- its own listener URL (
- It reuses the existing writer, ownership, snapshot, and journal machinery (
src/integrations/*,src/clients/config-export.ts) unchanged. These are local writes on the Child, not relayed writes, so the read-only link-management boundary from [Bug]: Remote Link Child does not inherit the Home's model settings, dashboard or management CLI #6957 is unchanged. - Apply on connect, when the intent digest changes (on the existing sync tick), on catalog change (refresh model lists), and on
ocx sync. - Apply is idempotent and per client. Possible per-client outcomes are
current,stale,not_installed,conflict, andfailed, and they are reported back to the Home in the peer report. conflictnever overwrites without an explicit--overwrite-conflictfrom a person.
Precedence (same model as ocx fallback)
Device override (--device) > Home default > built-in default (codex, claude on; everything else off).
For backward compatibility, ocx connect --clients codex,claude and the link-join default become the initial device override. selectedClients stays readable but is derived from the effective intent. Drop the max-2 limit, or move it to the intent layer.
CLI
ocx route already exists (combo/policy), so this adds a to sub-noun:
ocx route to status [--device <alias|id|all|this>] [--json]
ocx route to <client> on|off [--device <alias|id>] [--accounts all|none|<userId,...>] [--model-names alias|routed] [--json]
ocx route to <client> inherit --device <alias|id> # drop the device override
ocx route to sync [--device <alias|id|all>] # Home: ask Child(ren) to reapply; Child: apply now
- On the Home, writing without
--devicesets the Home default, which also applies to the Home itself. The existingocx integration native|client enable/disablebecome aliases of that and keep working. - On a Child:
statusandsyncwork locally.on|offis refused with the existing refusal text plus the exact Home command:ocx route to aside on --device parkjs-win.- Open question: should we allow a local-only override (see below)?
Example status output:
DEVICE CLIENT INTENT SOURCE APPLIED TARGET
home codex on default current ~/.codex/config.toml
home aside on default current u0,u1,u2
parkjs101 aside on default current u0,u1 (2 local profiles)
parkjs-win aside on default current u0
parkjs-win grok on default not_installed -
parkjs-win pi off device - -
GUI
The Route page gets a device selector (Home or each Child) that renders the same matrix and the same inherit action. If the backend and CLI land first, this can be a follow-up PR.
Disconnect / journal (must hold for every materialized client)
- Restore by removing the keys OpenCodex owns (
openai_base_url,experimental_realtime_ws_base_url,model_catalog_json, managed blocks), not by requiring a byte-identical whole file. Edits the user made after injection must survive disconnect. rotation: recovery-requiredmust have a documented command path out, not a hand-edit.- After
ocx disconnect, the service-owned runtime must come back asstandalone(ocx service restartmust actually replace arole:"client"process), soocx link addpasseschild_restart_unsupportedwithout killing processes by hand.
Acceptance criteria
- A fresh Child linked with
ocx link addgets every Home-default client materialized locally, with Child paths and the Child port, and no manual step. - Aside on a Child: one
providers.opencodexentry per local Aside profile (or per the userId selection). Model ids come from that Child's catalog, and the entry refreshes on catalog change. -
ocx route to status --device allon the Home shows intent, source, and the applied outcome for every device. JSON is a versioned schema (ocx.route-to/1). -
ocx route to <client> on|off|inherit --device Xon the Home is applied on Child X within one sync tick, or immediately withocx route to sync --device X. - On a Child, writes are refused with the exact Home command to run.
statusandsyncwork. - Clients that are not installed report
not_installed. A conflicting block reportsconflictand is never overwritten without the explicit flag. - Disconnect restores each client by keys, so post-injection user edits survive. Regression tests cover the 2026-11-07 scenario (edited
config.toml, then disconnect, then relink) on Windows and POSIX. - After disconnect,
ocx service restartbrings the runtime back as standalone, andocx link addsucceeds without killing processes by hand. - The [Bug]: Remote Link Child does not inherit the Home's model settings, dashboard or management CLI #6957 boundary is unchanged: no new write path from Child to Home, and the link management read list stays default-deny.
Open questions (with a recommended default)
- Should a Child have a local-only override (
ocx route to <client> off --local), reported to the Home assource: local? Recommended: yes, butoffonly, so the person at the Child can opt a client out on their own machine without the Home turning it back on.onstays Home-only. - Should the Home materialize for itself through the same path, so that Home is just device
home? Recommended: yes, so there is a single code path.
Observed by the maintainer on 2026-11-07 while linking parkjs101 and parkjs-win.
Activity
coderabbitai commentedon Nov 7, 2026
🔗 Related PRs
#7484 - feat(link): parity on apply — restart the Child runtime, record and report the apply (OCX-6) [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
feat(link): sync route intent and materialize clients per device (#8274…
Revert 14 PRs admin-merged on CI alone without required review (#8402)
simon-ami commentedon Nov 10, 2026
This looks close to what I need: one Linux Home managing providers and models, with my Mac as a full Remote Link Child.
#8416 seems to cover syncing models and applying harness configurations locally on the Child.
Is there a follow-up planned for dashboard support? I'd like to easily enable, disable, and refresh integrations for my Mac's installed harnesses (Pi, OpenCode, etc.) without using the CLI.
Whether this is done from the Home or Child dashboard doesn't matter to me. The goal is simple GUI-based management of Child integrations.
feat(link): sync route intent and materialize clients per device (re-…