You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: normalize proxy relay status codes to prevent upstream leaks
Raw upstream HTTP status codes (429, 503, 401, etc.) were leaking
through to aimock clients in 5 recorder proxy relay paths, exposing
provider implementation details.
Normalize to 200 for success, 502 for errors — aimock is the gateway.
Fixture recording preserves the original upstream status for fidelity.
Paths fixed:
- recorder.ts non-SSE relay (writeHead with raw upstreamStatus)
- recorder.ts SSE streaming relay (res.statusCode passthrough)
- agui-recorder.ts success relay (exact 201/204 leak)
- agui-recorder.ts error relay (raw 401/429/503 passthrough)
- agui-recorder.ts timeout handler (implicit 200 instead of 502)
Add 5 new status normalization tests with fixture preservation
assertions, update 2 existing tests, fix test cleanup with awaited
server.close in try/finally.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
# @copilotkit/aimock
2
2
3
+
## [Unreleased]
4
+
5
+
### Fixed
6
+
7
+
-**Drift tests passed vacuously with zero assertions** — the `shouldFail` guard silently skipped all `expect` calls when no critical diffs were found, so broken extraction logic or warning-level drift went completely undetected. Replaced every guarded assertion across all 21 drift test files (89 instances) with unconditional `expect(diffs.filter(...)).toEqual([])`
8
+
-**Proxy relay leaked raw upstream HTTP status codes** — 5 recorder relay paths in `recorder.ts` and `agui-recorder.ts` forwarded raw upstream codes (429, 503, 401, 201, etc.) to aimock clients, exposing provider implementation details. Normalized to 200 for success and 502 for errors; fixture recording preserves the original status for fidelity
0 commit comments