Skip to content

fix(server): reveal buffered prose before tool activity - #857

Merged
rynfar merged 2 commits into
pylonfrom
fix/assistant-buffer-tool-boundary-20260925
Sep 26, 2026
Merged

rynfar merged 2 commits into
pylonfrom
fix/assistant-buffer-tool-boundary-20260925

Conversation

@rynfar

@rynfar rynfar commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

When a provider emits an assistant paragraph and then starts a tool before completing the assistant item, Pylon can show the tool activity while the prose stays buffered. This makes the stream appear to stop until a later paragraph or item completion. Flush that turn's buffered assistant text immediately before appending a tool.started activity, preserving the current Markdown-aware buffering and normal delivery rate for prose outside tool boundaries.

A regression drives Claude-shaped runtime events through the real ingestion harness: one unfinished paragraph, a tool start, then more assistant text and completion. It asserts the first prose is visible before the tool activity and the final message is complete without duplication. This is a server projection fix shared by web, desktop, and mobile; it does not change provider protocol handling or the user setting for legacy token streaming.

Validation: all 124 ProviderRuntimeIngestion tests, server typecheck, scoped lint and format, and git diff --check passed. One pre-existing unused-import lint warning remains in the touched server file. No live Claude turn was run, so this addresses the identified buffer/tool ordering path rather than claiming every cause of a missing reply is resolved.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

Deployment failed for project pylon-marketing with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/pylon-code?upgradeToPro=build-rate-limit

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

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.9 KiB 13.9 KiB +13 B (+0.1%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB +4 B (+0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +9 B (+0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB +44 B (+0.1%) 66.4 KiB ✅
Codex Live turn messages 9 10 +1 (+11.1%) 21 ✅
Claude Total thread wire 14.0 KiB 14.0 KiB +23 B (+0.2%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB +4 B (+0.1%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.8 KiB 6.8 KiB +19 B (+0.3%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.9 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 10 10 0 (0.0%) 21 ✅

Baseline: afd6c11 · PR result: d6c0932 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 115.6 KiB
  • Claude decoded thread snapshot: 116.3 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
pylon-marketing Ready Ready Preview Sep 26, 2026 6:48am UTC

@rynfar

rynfar commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator Author

Refreshed onto current pylon at d6c0932fce with a clean merge. The 124 focused ingestion tests, server typecheck, scoped lint/format, and diff check pass on this head. The prose-before-tool regression still exercises the real ingestion harness. Waiting for exact-head CI before merging; no live Claude turn or device run is claimed.

@rynfar
rynfar merged commit a1526ae into pylon Sep 26, 2026
20 checks passed
@rynfar
rynfar deleted the fix/assistant-buffer-tool-boundary-20260925 branch September 26, 2026 06:56

This branch was successfully deployed

1 active deployment
Preview — d6c0932f Deployed Sep 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 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