Commit 75f2bca
authored
feat: add --proxy-only flag for stateless proxying (#99)
## 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)File tree
10 files changed
+510
-42
lines changed- .claude-plugin
- charts/aimock
- docs/record-replay
- src
- __tests__
10 files changed
+510
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
73 | 139 | | |
74 | 140 | | |
75 | 141 | | |
| |||
107 | 173 | | |
108 | 174 | | |
109 | 175 | | |
110 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
111 | 181 | | |
112 | 182 | | |
113 | 183 | | |
| |||
166 | 236 | | |
167 | 237 | | |
168 | 238 | | |
| 239 | + | |
169 | 240 | | |
170 | 241 | | |
171 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments