Closed
Labels
cliCLI, config inject, packaging flags
Description
Summary
ocx link add fails with Remote Link failed during Child preflight whenever the Child's ocx config show --json output is larger than 64 KiB. The preflight reads the whole effective config over SSH, but the SSH runner's default output cap is DEFAULT_OUTPUT_BYTES = 64 * 1024 (src/link/ssh-runner.ts), so readOutput throws output_limit and the outer catch reports a generic child_preflight_failed.
Observed (Home 2.99.0, Child 2.99.0, macOS)
- A long-lived former-standalone Mac had a 168,548-byte
ocx config show --json(largest keys:disabledModels1,249 entries ≈ 44 KB,modelDiscovery≈ 38 KB,providers≈ 31 KB). ocx link add <alias> --expect-fingerprint …failed in ~3.5 s withRemote Link failed during Child preflight, repeatedly.- Removing
disabledModels+modelDiscoverygot the file to ~63 KB, but after a service restartmodelDiscoveryrepopulated andconfig showwas 74,904 bytes, so it still failed. - Only after cutting
providersdown toopenai(config show ≈ 11 KB) didlink addsucceed (state: connected,childRole: client).
So a user with a normal, well-used standalone config cannot become a Child without deleting their provider config.
Where
src/server/management/link-enrollment.ts, phase child_preflight:
const configured = await run(ocx(["config", "show", "--json"])); // default 64 KiB capThe preflight only needs port and runtimeRole.
Suggested fix
- Ask the Child for only the fields the preflight needs (e.g. a
config get port runtimeRole --jsonstyle call, or a small dedicated preflight command), or - pass an explicit larger
maxOutputBytesfor this call (the runner already allows up to 4 MiB), and - map
SshRunnerError("output_limit")to a specific reason/hint instead of the generic phase failure.
Acceptance
ocx link addsucceeds against a Child whose full effective config is > 64 KiB.- If an output cap is ever hit, the CLI says so (not just "failed during Child preflight").
Metadata
Metadata
Assignees
Labels
cliCLI, config inject, packaging flags
Activity
fix(link): raise Child preflight output cap and name the limit (lidge…