Replace MessageStart/MessageEnd with ToolCallResult and HookEvent#62
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anbuzin
approved these changes
Apr 30, 2026
| proxy: { | ||
| '/api': { | ||
| target: 'http://localhost:8000', | ||
| rewrite: (path) => path.replace(/^\/api/, ''), |
Collaborator
There was a problem hiding this comment.
We shouldn't actually do that, the move is to use vercel dev and let it handle the routing.
Contributor
Author
There was a problem hiding this comment.
If we do this, though, it will work either way?
MessageStart and MessageEnd were always emitted back-to-back after the models rework, and MessageStart didn't carry any useful information anymore. A bunch of downstream examples were broken. (Some are still a bit broken after this; I have some more pending tool streaming changes.) Instead, we'll add two special-purpose event types: - ToolCallResult: emitted after tool execution with the result message - HookEvent: emitted when a hook suspends/resolves/cancels (Previously those were signaled with synthetic MessageStart/MessageEnd pairs.) We also add a `TerminalEvent = types.StreamEnd | ToolCallResult | HookEvent` that represents all of the AgentEvents that are "terminal". I also wanted to make `message` nonoptional in all the events (since from a *user* perspective, it should be!), so I've made the default be a `_DUMMY_MESSAGE`. This is an annoying hack but improves the user facing interface a fair amount, if they are using typing.
c220755 to
33ee4a5
Compare
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.
MessageStart and MessageEnd were always emitted back-to-back after the
models rework, and MessageStart didn't carry any useful information
anymore. A bunch of downstream examples were broken. (Some are still a
bit broken after this; I have some more pending tool streaming
changes.)
Instead, we'll add two special-purpose event types:
(Previously those were signaled with synthetic MessageStart/MessageEnd
pairs.)
We also add a
TerminalEvent = types.StreamEnd | ToolCallResult | HookEventthat represents all of the AgentEvents that are "terminal".
I also wanted to make
messagenonoptional in all the events (sincefrom a user perspective, it should be!), so I've made the default be
a
_DUMMY_MESSAGE. This is an annoying hack but improves the userfacing interface a fair amount, if they are using typing.