Skip to content

Recorder proxy hardening, server error handling, test hygiene#177

Merged
jpr5 merged 4 commits into
mainfrom
blitz/cr-sweep-175/integration
May 11, 2026
Merged

Recorder proxy hardening, server error handling, test hygiene#177
jpr5 merged 4 commits into
mainfrom
blitz/cr-sweep-175/integration

Conversation

@jpr5
Copy link
Copy Markdown
Contributor

@jpr5 jpr5 commented May 11, 2026

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

  • 2872 tests pass (79 files, 37 skipped)
  • TypeScript typecheck clean
  • Prettier + ESLint clean

jpr5 added 3 commits May 11, 2026 12:35
- Forward HTTP method to upstream instead of hardcoding POST
- Clear response timeout after successful completion (guard null socket)
- Fix client-disconnect handler to check writableFinished before destroying
- Wrap onHookBypassed and beforeWriteResponse callbacks in try/catch
- Override audio content-type to application/json on non-2xx error relay
- Atomic write (tmp+rename) for snapshot-mode fixture files
- Sanitize undefined toolCall name/arguments before saving fixtures
- Tighten video detection heuristic to exclude LLM provider fields
- Clarify Float32Array alignment copy behavior
- Use consumed flag + deferred splice for one-shot error fixtures
- Guard Azure model injection catch to only swallow SyntaxError
- Pass matched fixture to evaluateChaos for non-completions endpoints
- Cache fal request body to prevent double-consumption on passthrough
- Include PUT in fal queue body reading
- Clean up previous tmpDir before overwriting in strict mode test
- Replace global fetch with node:http helpers (del, postRaw)
- Wrap default fixturePath test in try/finally for reliable cleanup
- Hoist duplicate createRawUpstream to shared scope
- Add explicit headersSent mock property instead of relying on internals
- Guard setupUpstreamAndRecorder against leaked resources on re-entry
- Narrow bare catch to only swallow expected filesystem errors
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 11, 2026

Open in StackBlitz

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

commit: ee07f6b

@jpr5 jpr5 merged commit 4a0628f into main May 11, 2026
22 checks passed
@jpr5 jpr5 deleted the blitz/cr-sweep-175/integration branch May 11, 2026 19:46
jpr5 added a commit that referenced this pull request May 12, 2026
## Summary
- Update 2 drift test assertions from exact .toBe() to prefix .toMatch()
for the Malformed JSON error message
- PR #177/#178 intentionally changed the error format to include parse
error details, but the drift test assertions weren't updated

## Test plan
- [x] Drift tests pass locally
@jpr5 jpr5 mentioned this pull request May 13, 2026
3 tasks
jpr5 added a commit that referenced this pull request May 13, 2026
## Summary

Patch release v1.22.1 — includes strict-before-proxy fix (PR #182) +
recorder hardening (PR #177).

- Version bumped: package.json, plugin.json, marketplace.json,
Chart.yaml
- CHANGELOG [1.22.1] section with all unreleased fixes

## Test plan

- [x] All version files bumped to 1.22.1
- [x] CHANGELOG updated
- [x] Auto-publishes to npm on merge
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