th-9a5794: render stream_preamble ephemeral pre-answer sentence#35
Merged
Conversation
When the operator streams a fast-model preamble ahead of the answer (covering the reasoning model's time-to-first-token), show it in the assistant bubble's typing slot — muted + italic, in place of the bare typing dots — then swap in the real answer the instant it starts streaming. A late preamble frame (arriving after the answer began) is ignored, matching the server-side guard. Requires @smooai/smooth-operator >= 1.22.15 (adds stream_preamble to the event union so the SDK client forwards the frame instead of dropping it as unknown). Verified: 172/172 widget tests pass against a 1.22.15 SDK, including 2 new tests (preamble shown then replaced by the answer; late preamble ignored). typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WEUZgsyfGVab8uqSFPbr23
🦋 Changeset detectedLatest commit: b4372ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Renders the new
stream_preambleframe from the operator. When the server streams a fast-model preamble ("what I'm about to do") ahead of the answer — covering the reasoning model's time-to-first-token — the widget shows it in the assistant bubble's typing slot (muted + italic, in place of the bare dots), then swaps in the real answer the instant it starts streaming. A late preamble frame (after the answer began) is ignored, matching the server guard.⛔ Blocked on
@smooai/smooth-operator1.22.15 (smooth-operator PR #234), which addsstream_preambleto the SDK event union. Until it publishes, the SDK client (client.jsisServerEventgate) drops the frame as unknown, andpnpm installcan't resolve the bumped dep. On publish:pnpm installto refresh the lockfile → CI green → mark ready.Verified
172/172 widget tests pass against a locally-built 1.22.15 SDK, including 2 new tests (preamble shown then replaced by the answer; late preamble ignored). Typecheck clean. The
event.type === 'stream_preamble'check is written version-independently (small cast) so it compiles against the current pinned SDK too.🤖 Generated with Claude Code
https://claude.ai/code/session_01WEUZgsyfGVab8uqSFPbr23