Skip to content

Commit 4a0628f

Browse files
authored
Recorder proxy hardening, server error handling, test hygiene (#177)
## Summary Follow-up quality sweep addressing 30 issues surfaced by 7-agent CR on PR #175, complementing the broader sweep in #176. **Recorder proxy relay** — forward HTTP method instead of hardcoding POST, clear response timeout after completion, fix client-disconnect handler to check `writableFinished` before destroying upstream, wrap hook callbacks in try/catch, override audio content-type on error relay, atomic fixture writes, toolCall sanitization, tighter video detection **Server error handling** — deferred splice for one-shot error fixtures, SyntaxError guard on Azure injection catch, fixture-level chaos evaluation for non-completions endpoints, fal body double-consumption fix, fal PUT body support **Test hygiene** — tmpDir leak fix, global fetch replaced with node:http helpers, try/finally fixture cleanup, deduplicated helpers, explicit mock properties, resource guard on setup helper ## Test plan - [x] 2872 tests pass (79 files, 37 skipped) - [x] TypeScript typecheck clean - [x] Prettier + ESLint clean
2 parents 449382f + ee07f6b commit 4a0628f

4 files changed

Lines changed: 476 additions & 184 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212
- **Drift detection compared only first event per type**`compareSSESequences` now compares ALL events per type, not just the first, catching previously invisible divergences
1313
- **Ollama drift tests used broken async describe.skipIf** — replaced with synchronous env-var gate so tests are correctly skipped or executed
1414
- **12 unrestored spy/mock leaks and misleading assertions** — fix spy/mock leaks across test files and correct assertions that passed for the wrong reasons
15+
- Proxy relay hardcoded POST method — now forwards the original HTTP method
16+
- Response timeout timer leak — cleared after successful upstream completion
17+
- Client disconnect handler race — checks `writableFinished` before destroying upstream request
18+
- `onHookBypassed` and `beforeWriteResponse` callbacks not wrapped in try/catch
19+
- Audio error relay sent non-2xx responses with audio content-type instead of application/json
20+
- Snapshot-mode fixture writes not atomic — concurrent requests could corrupt the file
21+
- Undefined `toolCall` name/arguments silently dropped during fixture save
22+
- Video detection heuristic false-positives on LLM provider responses with `{id, status}` shape
23+
- One-shot error fixture splice during iteration (deferred via microtask)
24+
- Azure model injection catch swallowed non-SyntaxError exceptions
25+
- fal request body lost on passthrough (double `readBody` consumption)
26+
- fal queue handler dropped PUT request body
27+
- Recorder test: tmpDir leak on strict-mode reassignment, global fetch dependency, fragile fixturePath cleanup, duplicate helpers, spy leak on assertion failure
28+
29+
### Added
30+
31+
- Fixture-level chaos evaluation for non-completions endpoints (ElevenLabs, fal)
1532

1633
### Changed
1734

0 commit comments

Comments
 (0)