fix(cli): allow --proxy-only with URL-only --fixtures (v1.14.8)#129
Merged
fix(cli): allow --proxy-only with URL-only --fixtures (v1.14.8)#129
Conversation
The recordBase URL check was previously guarded by `if (values.record || values["proxy-only"])` and rejected any first --fixtures value starting with http(s):// as an invalid record destination. For --record mode this is correct — recording writes JSON files to disk and needs a writable base path. For --proxy-only mode it is overbroad: proxy-only forwards unmatched requests without saving, and recorder.ts/agui-recorder.ts already skip all disk writes when proxyOnly is set. All-URL --fixtures invocations should therefore be valid. The URL-rejection now fires only for --record (and --agui-record). In --proxy-only mode with a URL first fixture, fixturePath is left undefined on the RecordConfig — the recorder code path that would consume it is skipped by the existing proxyOnly guard, so no dead filesystem writes are attempted. This unblocks the showcase-aimock Railway service which needs to run aimock in proxy-only mode against two remote GitHub raw fixture URLs with no local fallback. The previous workaround was a shell-wrapped startCommand that mkdirs a dummy /tmp/empty-fixtures before exec-ing aimock.
Four new cases under a new describe block "CLI: --proxy-only with URL-only --fixtures": - --proxy-only + URL-only --fixtures starts successfully, loads the remote fixture, and does not emit the recordBase rejection error. - --record + URL-only --fixtures still errors (regression guard — record writes to disk, URLs are genuinely unsupported as write targets). - --proxy-only + mixed local and URL --fixtures loads both (2 fixtures), preserving argv order (baseline coverage for the combined path). - --agui-proxy-only + URL-only --fixtures starts successfully (parallel AG-UI path gets the same fix). Tests were verified red against the pre-fix cli.ts (the two URL-only cases timed out waiting for "listening on" because the CLI exited with the recordBase error) and green against the fixed cli.ts.
Bumps @copilotkit/aimock to 1.14.8 with CHANGELOG entry for the --proxy-only URL-only --fixtures fix.
commit: |
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.
Summary
--proxy-onlymode no longer rejects URL-only--fixturesinvocationsrecordBaseURL check now fires only for--recordmode (where a writable destination is actually required)--agui-proxy-onlyCLI path--proxy-only+ AG-UI variant + mixed local/URL) and guard the--recordregression@copilotkit/aimockto 1.14.8 with CHANGELOG entryWhy
The showcase-aimock Railway service (14+ demo services route through it) hit this blocker when switching from the baked-in wrapper image to
ghcr.io/copilotkit/aimock:1.14.7with remote fixtures from GitHub raw. The workaround was a shell-wrapped startCommand thatmkdirs a dummy local path before exec-ing aimock. This fix removes the workaround.The
recordBasecheck was guarded byif (values.record || values["proxy-only"])and rejected any first--fixturesvalue starting withhttp(s)://. For--recordthat's correct — recording writes files to disk and needs a writable base path. For--proxy-onlyit's overbroad: proxy-only forwards without saving, and bothrecorder.tsandagui-recorder.tsalready guard disk writes behindif (!proxyOnly). The fix narrows the URL-rejection to--record/--agui-recordand leavesfixturePathundefined on theRecordConfigwhen the first fixture is a URL in proxy-only mode.Test plan
npx -p @copilotkit/aimock aimock --proxy-only --provider-openai https://api.openai.com --fixtures https://... --validate-on-load --host 0.0.0.0 --port 4010starts cleanly