Skip to content

perf(protocol): make raw event retention opt-in - #198

Merged
leoisadev1 merged 3 commits into
mainfrom
perf/protocol-observation-retention
Sep 8, 2026
Merged

perf(protocol): make raw event retention opt-in#198
leoisadev1 merged 3 commits into
mainfrom
perf/protocol-observation-retention

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Problem

The ACP and Codex app-server transports retain raw protocol events even when callers consume only callbacks. An unread observation stream can therefore retain the whole session without helping required protocol work.

Changes

Disable optional raw observation by default. Expose bounded sliding buffers and an explicit "unbounded" compatibility option through client and agent constructors. Keep notification callbacks, request handlers, correlated replies, and connection shutdown independent of observation retention. Document the new defaults and migration option.

This affects the transport packages, not the Mastra Codex/Kimi turn path. Repository runtime consumers do not read the raw streams. External consumers needing legacy lossless observation must opt in to "unbounded".

Verification

  • Parent verification passed all 51 protocol/client/agent tests across five suites, using in-memory transports and fixture child processes.
  • Stress coverage sends 10,000 payloads, verifies default/zero retention, keeps only the newest eight observations in bounded mode, and checks that required callbacks and replies still complete.
  • Late readers, explicit unbounded observation, input-end draining, malformed input, interruption, and connection-scope cleanup are covered.
  • Both package typechecks, targeted lint, formatting, and diff checks passed. Additional configured Effect compiler diagnostics remain a CI gate.
  • No paid-provider calls or UI changes. No whole-application memory percentage or provider-turn speedup is claimed.

Implemented and verified by gpt-6-astra in T3 Code through the Grok harness.

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
akeru-bot-landing Ready Ready Preview Sep 8, 2026 7:36pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 8, 2026
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

Summary

  • ACP raw notifications and Codex raw notifications and requests are now opt-in, with disabled, bounded, and unbounded retention modes.
  • The focused protocol, client, and agent coverage confirms that callbacks, request handlers, and replies continue to operate independently of raw observation.
  • No issues requiring changes before merging were identified.

Confidence Score: 5/5

Safe to merge: no concrete defects were found in the changed protocol-observation behavior.

The final finding set is empty. Focused ACP and Codex tests passed for disabled observation, bounded retention, unbounded replay, callback dispatch, request replies, stream completion, and scope cleanup.

Files Needing Attention: No files need follow-up changes.

T-Rex T-Rex Logs

What T-Rex did

  • Ran ACP focused tests against the PR head; all 31 tests passed.
  • Ran Codex focused tests against the PR head; all 20 tests passed.
  • Verified test flows including disabled raw streams, sliding retention for enabled streams, callback dispatch, request handling, and JSON-RPC replies.
  • Executed existing focused package tests against the PR head; 31 ACP tests and 20 Codex tests passed.
  • Captured a base-worktree command for the isolated worktree; it could not run because workspace package symlinks did not resolve.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@leoisadev1
leoisadev1 merged commit b6b0994 into main Sep 8, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the perf/protocol-observation-retention branch September 8, 2026 20:04
@github-actions github-actions Bot mentioned this pull request Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant