Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

events-and-streaming changedmanaged-agents/events-and-streaming

Nearest release: v2.1.307, published 4 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+6added
Lines−43removed
From line 109 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits29to this page, all time

The whole hunk

from line 109, old and new numbered
/
lines
from line 109
109109 [
110110 new BetaManagedAgentsUserMessageEventParams
111111 {
112 Type = BetaManagedAgentsUserMessageEventParamsType.UserMessage,
113 Content =
114 [
115 new BetaManagedAgentsTextBlock
116 {
117 Type = BetaManagedAgentsTextBlockType.Text,
118 Text = "Summarize the repo README",
119 },
120 ],
112 Content = [new BetaManagedAgentsTextBlock { Text = "Summarize the repo README" }],
121113 },
122114 ],
123115 });
from line 186
194186 session.id(),
195187 EventSendParams.builder()
196188 .addEvent(BetaManagedAgentsUserMessageEventParams.builder()
197 .type(BetaManagedAgentsUserMessageEventParams.Type.USER_MESSAGE)
198189 .addTextContent("Summarize the repo README")
199190 .build())
200191 .build()
from line 572
581572 [
582573 new BetaManagedAgentsUserMessageEventParams
583574 {
584 Type = BetaManagedAgentsUserMessageEventParamsType.UserMessage,
585575 Content =
586576 [
587577 new BetaManagedAgentsTextBlock
588578 {
589 Type = BetaManagedAgentsTextBlockType.Text,
590579 Text = "Analyze the performance of the sort function in utils.py",
591580 },
592581 ],
from line 607
618607 session.id(),
619608 EventSendParams.builder()
620609 .addEvent(BetaManagedAgentsUserMessageEventParams.builder()
621 .type(BetaManagedAgentsUserMessageEventParams.Type.USER_MESSAGE)
622610 .addTextContent("Analyze the performance of the sort function in utils.py")
623611 .build())
624612 .build());
from line 760
772760 [
773761 new BetaManagedAgentsUserCustomToolResultEventParams
774762 {
775 Type = BetaManagedAgentsUserCustomToolResultEventParamsType.UserCustomToolResult,
776763 CustomToolUseID = toolUse.ID,
777 Content =
778 [
779 new BetaManagedAgentsTextBlock
780 {
781 Type = BetaManagedAgentsTextBlockType.Text,
782 Text = result,
783 },
784 ],
764 Content = [new BetaManagedAgentsTextBlock { Text = result }],
785765 },
786766 ],
787767 });
from line 827
847827 session.id(),
848828 EventSendParams.builder()
849829 .addEvent(BetaManagedAgentsUserCustomToolResultEventParams.builder()
850 .type(BetaManagedAgentsUserCustomToolResultEventParams.Type.USER_CUSTOM_TOOL_RESULT)
851830 .customToolUseId(toolUse.id())
852831 .addTextContent(result)
853832 .build())
from line 980
1001980 [
1002981 new BetaManagedAgentsUserToolConfirmationEventParams
1003982 {
1004 Type = BetaManagedAgentsUserToolConfirmationEventParamsType.UserToolConfirmation,
1005983 ToolUseID = eventId,
1006984 Result = BetaManagedAgentsUserToolConfirmationEventParamsResult.Allow,
1007985 },
from line 1042
10641042 session.id(),
10651043 EventSendParams.builder()
10661044 .addEvent(BetaManagedAgentsUserToolConfirmationEventParams.builder()
1067 .type(BetaManagedAgentsUserToolConfirmationEventParams.Type.USER_TOOL_CONFIRMATION)
10681045 .toolUseId(toolUseId)
10691046 .result(BetaManagedAgentsUserToolConfirmationEventParams.Result.ALLOW)
10701047 .build())
from line 1184
12071184 [
12081185 new BetaManagedAgentsUserMessageEventParams
12091186 {
1210 Type = BetaManagedAgentsUserMessageEventParamsType.UserMessage,
12111187 Content =
12121188 [
12131189 new BetaManagedAgentsTextBlock
12141190 {
1215 Type = BetaManagedAgentsTextBlockType.Text,
12161191 Text = "Now run the tests against the changes you made earlier.",
12171192 },
12181193 ],
from line 1223
12481223 session.id(),
12491224 EventSendParams.builder()
12501225 .addEvent(BetaManagedAgentsUserMessageEventParams.builder()
1251 .type(BetaManagedAgentsUserMessageEventParams.Type.USER_MESSAGE)
12521226 .addTextContent("Now run the tests against the changes you made earlier.")
12531227 .build())
12541228 .build());
from line 1355
13811355 {
13821356 Events =
13831357 [
1384 new BetaManagedAgentsUserInterruptEventParams
1385 {
1386 Type = BetaManagedAgentsUserInterruptEventParamsType.UserInterrupt,
1387 },
1358 new BetaManagedAgentsUserInterruptEventParams(),
13881359 new BetaManagedAgentsUserMessageEventParams
13891360 {
1390 Type = BetaManagedAgentsUserMessageEventParamsType.UserMessage,
13911361 Content =
13921362 [
13931363 new BetaManagedAgentsTextBlock
13941364 {
1395 Type = BetaManagedAgentsTextBlockType.Text,
13961365 Text = "Instead, focus on fixing the bug in line 42.",
13971366 },
13981367 ],
from line 1403
14341403 client.beta().sessions().events().send(
14351404 session.id(),
14361405 EventSendParams.builder()
1437 .addEvent(BetaManagedAgentsUserInterruptEventParams.builder()
1438 .type(BetaManagedAgentsUserInterruptEventParams.Type.USER_INTERRUPT)
1439 .build())
1406 .addEvent(BetaManagedAgentsUserInterruptEventParams.builder().build())
14401407 .addEvent(BetaManagedAgentsUserMessageEventParams.builder()
1441 .type(BetaManagedAgentsUserMessageEventParams.Type.USER_MESSAGE)
14421408 .addTextContent("Instead, focus on fixing the bug in line 42.")
14431409 .build())
14441410 .build());
from line 1597
16311597 .build());
16321598 for (var event : events.data()) {
16331599 event.agentToolUse().ifPresent(toolUse ->
1634 IO.println("[" + toolUse.type() + "] " + toolUse.processedAt()));
1600 IO.println("[" + toolUse._type() + "] " + toolUse.processedAt()));
16351601 event.agentToolResult().ifPresent(toolResult ->
1636 IO.println("[" + toolResult.type() + "] " + toolResult.processedAt()));
1602 IO.println("[" + toolResult._type() + "] " + toolResult.processedAt()));
16371603 }
16381604 ```
16391605 
from line 1698
17321698 [
17331699 new BetaManagedAgentsSystemMessageEventParams
17341700 {
1735 Type = BetaManagedAgentsSystemMessageEventParamsType.SystemMessage,
17361701 Content =
17371702 [
17381703 new BetaManagedAgentsSystemContentBlock
17391704 {
1740 Type = BetaManagedAgentsSystemContentBlockType.Text,
17411705 Text = "The user's current timezone is America/New_York.",
17421706 },
17431707 ],
from line 1731
17671731 session.id(),
17681732 EventSendParams.builder()
17691733 .addEvent(BetaManagedAgentsSystemMessageEventParams.builder()
1770 .type(BetaManagedAgentsSystemMessageEventParams.Type.SYSTEM_MESSAGE)
17711734 .addTextContent("The user's current timezone is America/New_York.")
17721735 .build())
17731736 .build());
Feedback