Skip to content

perf(pi): avoid blocking tracing on streamed updates - #90

Merged
Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi-perf-reduce-pi-streaming-trace-overhead
Sep 16, 2026
Merged

Abhijeet Prasad (AbhiPrasad) merged 2 commits into
mainfrom
abhi-perf-reduce-pi-streaming-trace-overhead

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

AI Summary

Forward only the first meaningful text or thinking delta for each model call, which preserves time-to-first-token data without awaiting a daemon write for every streamed token.

Keep UI status polling on a short-timeout, separate client so a backed-up daemon cannot stall session startup or event capture. Also make Pi updates target the npm-qualified extension instead of a potentially shadowing local package.

Forward only the first meaningful text or thinking delta for each model call,
which preserves time-to-first-token data without awaiting a daemon write for
every streamed token.

Keep UI status polling on a short-timeout, separate client so a backed-up daemon
cannot stall session startup or event capture. Also make Pi updates target the
npm-qualified extension instead of a potentially shadowing local package.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T19:15:41.134776Z 037b414 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04aa905516

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

ctx.ui.setWidget(WIDGET_KEY, undefined);
}
await client.close();
await statusClient.close();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Close pending UI work before clearing shutdown state

When a fire-and-forget UI refresh from session startup, compaction, or tree navigation is still pending at shutdown, the UI is cleared before statusClient.close() waits for that request. The refreshUi continuation then resumes and restores the Braintrust: tracing status and possibly the trace-link widget after shutdown; even a timed-out status request does this because status() returns undefined and refreshUi still sets the tracing status. Await or invalidate pending status work before clearing the UI.

Useful? React with 👍 / 👎.

@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 08d15c9 into main Sep 16, 2026
20 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi-perf-reduce-pi-streaming-trace-overhead branch September 16, 2026 20:48
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.

2 participants