Skip to content

Ian/abort stream #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
51ac497
cleanup
ianmacartney Jun 16, 2025
98dd26f
explicit abort call & list aborted streamed messages
ianmacartney Jun 16, 2025
294baee
0.1.9-alpha.4
ianmacartney Jun 16, 2025
1f4a65f
list aborted messages optionally
ianmacartney Jun 17, 2025
e20716c
0.1.9-alpha.5
ianmacartney Jun 17, 2025
1ab980f
fix startOrder arg
ianmacartney Jun 18, 2025
292bac3
.
ianmacartney Jun 17, 2025
2db31ed
0.1.9-alpha.7
ianmacartney Jun 18, 2025
1fb68c6
fix deletePageForStreamId
ianmacartney Jun 18, 2025
a8cb0f2
Merge branch 'main' into ian/abort-stream
ianmacartney Jun 18, 2025
6152040
upgrade things
ianmacartney Jun 18, 2025
dbbe4d4
fix order pruning results
ianmacartney Jun 18, 2025
4881913
v0.0.15-alpha.0
ianmacartney Jun 18, 2025
698946c
0.1.9-alpha.9
ianmacartney Jun 18, 2025
47fb396
bump up stream timeout
ianmacartney Jun 18, 2025
f9cae38
Merge branch 'main' into ian/abort-stream
ianmacartney Jun 18, 2025
866ee8f
dont set streaming status for aborted messages
ianmacartney Jun 18, 2025
0cd6d7e
delete streamingMessage after deltas always
ianmacartney Jun 18, 2025
438b006
0.1.9-alpha.11
ianmacartney Jun 18, 2025
f2a2fdb
Merge branch 'main' into ian/abort-stream
ianmacartney Jun 19, 2025
ab4ca55
0.1.10-alpha.0
ianmacartney Jun 19, 2025
337e168
Merge branch 'main' into ian/abort-stream
ianmacartney Jun 19, 2025
bac63c2
cancel the cleanup if we've already deleted
ianmacartney Jun 19, 2025
ba8a6c9
0.1.10-alpha.1
ianmacartney Jun 19, 2025
e4b80e1
dynamic agent definitions
ianmacartney Jul 5, 2025
30c1db7
fixup Play.tsx
ianmacartney Jul 5, 2025
6fe5679
try to publish per-pr package
ianmacartney Jul 5, 2025
c15e6b6
try to publish per-pr package
ianmacartney Jul 5, 2025
2a9b1b1
lint
ianmacartney Jul 5, 2025
af4e974
Merge branch 'main' into ian/abort-stream
ianmacartney Jul 11, 2025
b899d24
todos
ianmacartney Jul 11, 2025
7c0a839
changelog
ianmacartney Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
cache-dependency-path: |
example/package.json
package.json
node-version: "19.x"
node-version: "20.x"
cache: "npm"
- run: node setup.cjs
- run: npm test
- run: npm run typecheck
- run: npm run lint
- run: npx pkg-pr-new publish
- run: npx pkg-pr-new publish ./ ./playground
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.1.15 alpha

- You can request that `syncStreams` return aborted streamed messages,
if you want to show those in your UI.
- They will have `msg.streaming === false` if they were aborted.
- Fix: stream deletion is idempotent and cleanup is canceled if it's already deleted.

## 0.1.14

- Expose delete functions for messages & threads on the Agent class
Expand Down Expand Up @@ -39,7 +46,7 @@

## 0.1.9

- You can finish a stream asynchronously and have it abort the streaming.
- You can abort a stream asynchronously and have it stop writing deltas smoothly.
- The timeout for streaming deltas with no sign of life has been
increased to 10 minutes.
- Delete stream deltas automatically 5 min after the stream finishes.
Expand Down
13 changes: 12 additions & 1 deletion example/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,12 @@ export declare const components: {
>;
};
streams: {
abort: FunctionReference<
"mutation",
"internal",
{ reason: string; streamId: string },
null
>;
addDelta: FunctionReference<
"mutation",
"internal",
Expand Down Expand Up @@ -1770,13 +1776,18 @@ export declare const components: {
list: FunctionReference<
"query",
"internal",
{ threadId: string },
{
startOrder?: number;
statuses?: Array<"streaming" | "finished" | "aborted">;
threadId: string;
},
Array<{
agentName?: string;
model?: string;
order: number;
provider?: string;
providerOptions?: Record<string, Record<string, any>>;
status: "streaming" | "finished" | "aborted";
stepOrder: number;
streamId: string;
userId?: string;
Expand Down
13 changes: 12 additions & 1 deletion examples/chat-basic/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,12 @@ export declare const components: {
>;
};
streams: {
abort: FunctionReference<
"mutation",
"internal",
{ reason: string; streamId: string },
null
>;
addDelta: FunctionReference<
"mutation",
"internal",
Expand Down Expand Up @@ -1744,13 +1750,18 @@ export declare const components: {
list: FunctionReference<
"query",
"internal",
{ threadId: string },
{
startOrder?: number;
statuses?: Array<"streaming" | "finished" | "aborted">;
threadId: string;
},
Array<{
agentName?: string;
model?: string;
order: number;
provider?: string;
providerOptions?: Record<string, Record<string, any>>;
status: "streaming" | "finished" | "aborted";
stepOrder: number;
streamId: string;
userId?: string;
Expand Down
17 changes: 13 additions & 4 deletions examples/chat-basic/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion examples/chat-streaming/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,12 @@ export declare const components: {
>;
};
streams: {
abort: FunctionReference<
"mutation",
"internal",
{ reason: string; streamId: string },
null
>;
addDelta: FunctionReference<
"mutation",
"internal",
Expand Down Expand Up @@ -1744,13 +1750,18 @@ export declare const components: {
list: FunctionReference<
"query",
"internal",
{ threadId: string },
{
startOrder?: number;
statuses?: Array<"streaming" | "finished" | "aborted">;
threadId: string;
},
Array<{
agentName?: string;
model?: string;
order: number;
provider?: string;
providerOptions?: Record<string, Record<string, any>>;
status: "streaming" | "finished" | "aborted";
stepOrder: number;
streamId: string;
userId?: string;
Expand Down
17 changes: 13 additions & 4 deletions examples/chat-streaming/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion examples/files-images/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,12 @@ export declare const components: {
>;
};
streams: {
abort: FunctionReference<
"mutation",
"internal",
{ reason: string; streamId: string },
null
>;
addDelta: FunctionReference<
"mutation",
"internal",
Expand Down Expand Up @@ -1746,13 +1752,18 @@ export declare const components: {
list: FunctionReference<
"query",
"internal",
{ threadId: string },
{
startOrder?: number;
statuses?: Array<"streaming" | "finished" | "aborted">;
threadId: string;
},
Array<{
agentName?: string;
model?: string;
order: number;
provider?: string;
providerOptions?: Record<string, Record<string, any>>;
status: "streaming" | "finished" | "aborted";
stepOrder: number;
streamId: string;
userId?: string;
Expand Down
17 changes: 13 additions & 4 deletions examples/files-images/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion examples/rate-limiting/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,12 @@ export declare const components: {
>;
};
streams: {
abort: FunctionReference<
"mutation",
"internal",
{ reason: string; streamId: string },
null
>;
addDelta: FunctionReference<
"mutation",
"internal",
Expand Down Expand Up @@ -1744,13 +1750,18 @@ export declare const components: {
list: FunctionReference<
"query",
"internal",
{ threadId: string },
{
startOrder?: number;
statuses?: Array<"streaming" | "finished" | "aborted">;
threadId: string;
},
Array<{
agentName?: string;
model?: string;
order: number;
provider?: string;
providerOptions?: Record<string, Record<string, any>>;
status: "streaming" | "finished" | "aborted";
stepOrder: number;
streamId: string;
userId?: string;
Expand Down
Loading