Skip to content

perf(chat): unblock response delivery and measure send phases - #1344

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/chat-send-phase-latency
Oct 5, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/chat-send-phase-latency

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Transcript updates can wait behind a slow sidebar activity projection, even after model output is available. Give each durable outbox its own coalesced publisher, so sidebar PostgreSQL work does not hold up the response stream. Overlap the independent HTTP workflow, lifecycle, and run-context reads after conversation authorization.

Add content-free phase timings for HTTP admission, durable preparation, usage reservation, enrichment, model context, and first text. A live trace measured 1,398 ms inside admission, but the remaining time has not yet been attributed precisely. These logs allow that attribution without treating browser observation time as database latency.

Validation: full pnpm test passed, including all type checks, lint, 537 site tests, 2,274 chat tests, and 20 desktop tests. The real PostgreSQL runtime suite completed successfully. The focused publication and run tests passed 17 cases, including a new regression that blocks sidebar publication while later transcript updates continue. Durable receipts, publisher coalescing, retries, and copy activation checks remain intact.

Summary by CodeRabbit

  • Bug Fixes
    • Conversation transcript updates can now continue while bot-activity updates are delayed, reducing the impact of slow activity subscribers.
    • Send requests perform independent data reads concurrently, which may reduce response time while preserving access and lifecycle checks.
  • Improvements
    • Added structured timing diagnostics for conversation sends and runs, including first-response timing, without recording message text or credentials.

@tannerlinsley
tannerlinsley requested a review from a team October 5, 2026 06:56
@changeset-bot

changeset-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fc63def

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com fc63def Oct 05 2026, 06:58 AM

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d60ea69-edba-4d30-9930-d3e7ae94358b
📥 Commits

Reviewing files that changed from the base of the PR and between 5085d7f and fc63def.

📒 Files selected for processing (4)
  • docs/tanchat-send-latency.md
  • harness-tests/pending-runtime/conversation-runs-runtime.test.ts
  • src/chat/server/conversation-http.server.ts
  • src/chat/server/conversation.ts
 ______________________________________________
< Looking for trouble in all the right places. >
 ----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tannerlinsley
tannerlinsley merged commit 01bcb35 into main Oct 5, 2026
7 of 8 checks passed
@tannerlinsley
tannerlinsley deleted the taren/chat-send-phase-latency branch October 5, 2026 07:03
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