Skip to content

fix(cli): allow --proxy-only with URL-only --fixtures (v1.14.8)#129

Merged
jpr5 merged 3 commits intomainfrom
fix/proxy-only-url-fixtures
Apr 23, 2026
Merged

fix(cli): allow --proxy-only with URL-only --fixtures (v1.14.8)#129
jpr5 merged 3 commits intomainfrom
fix/proxy-only-url-fixtures

Conversation

@jpr5
Copy link
Copy Markdown
Contributor

@jpr5 jpr5 commented Apr 23, 2026

Summary

  • --proxy-only mode no longer rejects URL-only --fixtures invocations
  • The recordBase URL check now fires only for --record mode (where a writable destination is actually required)
  • Same fix applied to the parallel --agui-proxy-only CLI path
  • 4 new tests pin the green-path (URL-only --proxy-only + AG-UI variant + mixed local/URL) and guard the --record regression
  • Release: bumps @copilotkit/aimock to 1.14.8 with CHANGELOG entry

Why

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.7 with remote fixtures from GitHub raw. The workaround was a shell-wrapped startCommand that mkdirs a dummy local path before exec-ing aimock. This fix removes the workaround.

The recordBase check was guarded by if (values.record || values["proxy-only"]) and rejected any first --fixtures value starting with http(s)://. For --record that's correct — recording writes files to disk and needs a writable base path. For --proxy-only it's overbroad: proxy-only forwards without saving, and both recorder.ts and agui-recorder.ts already guard disk writes behind if (!proxyOnly). The fix narrows the URL-rejection to --record/--agui-record and leaves fixturePath undefined on the RecordConfig when the first fixture is a URL in proxy-only mode.

Test plan

  • CI green
  • Manual: npx -p @copilotkit/aimock aimock --proxy-only --provider-openai https://api.openai.com --fixtures https://... --validate-on-load --host 0.0.0.0 --port 4010 starts cleanly
  • showcase-aimock Railway startCommand reverts to the unwrapped form (follow-up in CopilotKit PR #4190 reference)

jpr5 added 3 commits April 22, 2026 19:22
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.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@129

commit: 5dcf061

@jpr5 jpr5 merged commit 5370e80 into main Apr 23, 2026
23 checks passed
@jpr5 jpr5 deleted the fix/proxy-only-url-fixtures branch April 23, 2026 02:50
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.

1 participant