Skip to content

feat: add --proxy-only flag for stateless proxying#99

Merged
jpr5 merged 3 commits into
mainfrom
feat/proxy-only
Apr 9, 2026
Merged

feat: add --proxy-only flag for stateless proxying#99
jpr5 merged 3 commits into
mainfrom
feat/proxy-only

Conversation

@jpr5

@jpr5 jpr5 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add --proxy-only CLI flag that proxies unmatched requests to upstream providers without saving fixtures to disk or caching them in memory
  • Every unmatched request always hits the real provider — no stale recorded responses
  • Matched fixtures still work normally
  • Adds proxyOnly field to RecordConfig type for programmatic usage

Use case

Demo/live environments where aimock sits in front of real LLM providers with local fixtures for known scenarios, but unmatched traffic should always go upstream rather than getting cached after the first call.

Files changed

  • src/types.tsproxyOnly?: boolean on RecordConfig
  • src/cli.ts--proxy-only flag parsing and help text
  • src/recorder.ts — skip disk write + memory push when proxyOnly is set
  • src/__tests__/proxy-only.test.ts — 8 tests covering proxy-only and contrast with record mode

Test plan

  • 8 new tests covering all proxy-only behaviors
  • All 2214 tests pass
  • Build passes

🤖 Generated with Claude Code

…ording

Proxy unmatched requests to upstream providers without writing fixtures
to disk or caching them in memory. Every unmatched request always hits
the real provider — useful for demos and live environments where stale
recorded responses are undesirable.
@pkg-pr-new

pkg-pr-new Bot commented Apr 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: d3e2cb1

@jpr5 jpr5 changed the title Add --proxy-only flag for stateless proxying feat: add --proxy-only flag for stateless proxying Apr 9, 2026
@jpr5
jpr5 merged commit 75f2bca into main Apr 9, 2026
18 checks passed
@jpr5
jpr5 deleted the feat/proxy-only branch April 9, 2026 19:24
jpr5 added a commit that referenced this pull request Jul 15, 2026
## Summary

- Add `--proxy-only` CLI flag that proxies unmatched requests to
upstream providers without saving fixtures to disk or caching them in
memory
- Every unmatched request always hits the real provider — no stale
recorded responses
- Matched fixtures still work normally
- Adds `proxyOnly` field to `RecordConfig` type for programmatic usage

## Use case

Demo/live environments where aimock sits in front of real LLM providers
with local fixtures for known scenarios, but unmatched traffic should
always go upstream rather than getting cached after the first call.

## Files changed

- `src/types.ts` — `proxyOnly?: boolean` on `RecordConfig`
- `src/cli.ts` — `--proxy-only` flag parsing and help text
- `src/recorder.ts` — skip disk write + memory push when `proxyOnly` is
set
- `src/__tests__/proxy-only.test.ts` — 8 tests covering proxy-only and
contrast with record mode

## Test plan

- [x] 8 new tests covering all proxy-only behaviors
- [x] All 2214 tests pass
- [x] Build passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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