Skip to content

perf(server): reduce streaming and tool update overhead - #143

Merged
leoisadev1 merged 6 commits into
mainfrom
t3code/optimize-akeru-performance
Sep 2, 2026
Merged

perf(server): reduce streaming and tool update overhead#143
leoisadev1 merged 6 commits into
mainfrom
t3code/optimize-akeru-performance

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Long streaming turns repeatedly rebuilt message text, queried thread state for transient provider output, and sent every live tool update to each client. Large MCP arguments could remain attached to client activity state and raise heap use.

This change appends streaming text in SQLite, skips state reads for provider events that cannot change thread state, coalesces live tool updates over a bounded 50 ms window, bounds projected tool payloads, caches Git root discovery, and replaces ACP replay polling with a deadline-based wait. Full tool payloads remain in persistence.

Focused validation:

  • 130 tests across projection, persistence, ingestion, WebSocket coalescing, repository identity, and ACP replay
  • WebSocket coalescing integration test
  • Server typecheck
  • Targeted lint and formatting

Measured workloads:

  • 41.5% less CPU for 5,000 streaming message chunks
  • 99% fewer live tool-update frames in a dense update burst
  • 99.7% less retained heap for twenty 5 MB MCP inputs
  • 81.8% fewer ACP idle checks

Model: GPT-5.6 Sol
Harness: Codex in T3 Code

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
akeru-bot-landing Skipped Skipped Sep 2, 2026 7:55pm 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 2, 2026
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

The server-side performance updates preserve correct user-visible behavior. Focused runtime checks confirmed that streamed assistant messages retain their accumulated text when finalized, live tool updates preserve the latest state at ordering boundaries, repository identity caching remains isolated by Git root, and ACP replay waits respect renewed activity before completing.

Confidence Score: 5/5

No blocking failure remains.

Focused execution covered the changed streaming persistence, live-event delivery, repository identity caching, and ACP replay-idle behavior without reproducing a user-facing failure.

T-Rex T-Rex Logs

What T-Rex did

  • Ran focused SQLite streamed-message finalization test and the event-store projection bootstrap replay test; both passed with exit code 0, confirming the stored text is retained after finalization and replay does not duplicate streamed text.
  • Ran the focused coalescer suite and the boundary-flow test; the suite passed all six checks and the boundary-flow validation showed updates and turns are retained in order, with temporary changes removed.
  • Ran the ACP replay idle runtime tests; the runtime-model suite reported 20 passing tests and the TestClock waitForSessionLoadReplayIdle behaved as expected after the refresh, with the temporary test removed.
  • Ran the repository identity flow with two nested roots; identities remained distinct per root and remote lookups occurred only once per root, and the resolver suite (nine tests) passed.
  • Validated the capture before-and-after of streaming-message behavior and noted implementation details in the code paths for the projection pipeline and message persistence.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (5): Last reviewed commit: "Merge branch 'main' into t3code/optimize..." | Re-trigger Greptile

@leoisadev1
leoisadev1 merged commit e142a9f into main Sep 2, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the t3code/optimize-akeru-performance branch September 2, 2026 21:18
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