You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add missing SessionConfig options (clientName, agent, onEvent) to reference table.
Add 13 undocumented event types with new sections for External Tool, Permission,
Command, and Plan Mode events. Add session.log() and early event registration
sections to advanced.md. Add onListModels to setup.md CopilotClientOptions table.
Add disableResume and onEvent to resume options table.
|`ephemeral`| Boolean | If `true`, the message is transient and may not be persisted |
528
+
529
+
Use cases:
530
+
- Displaying progress in a UI while the session processes a request
531
+
- Sending status updates to the session log
532
+
- Debugging session behavior with contextual messages
533
+
534
+
See [CopilotSession.log()](apidocs/com/github/copilot/sdk/CopilotSession.html#log(java.lang.String)) Javadoc for details.
535
+
536
+
---
537
+
538
+
## Early Event Registration
539
+
540
+
Register an event handler *before* the `session.create` RPC is issued, ensuring no early events are missed.
541
+
542
+
When you register handlers with `session.on()` after `createSession()` returns, you may miss events emitted during session creation (e.g., `SessionStartEvent`). Use `SessionConfig.setOnEvent()` to guarantee delivery of all events from the very start:
543
+
544
+
```java
545
+
var events =newCopyOnWriteArrayList<AbstractSessionEvent>();
.setOnEvent(events::add) // Registered before session.create RPC
550
+
).get();
551
+
552
+
// events list now includes SessionStartEvent and any other early events
553
+
```
554
+
555
+
This is equivalent to calling `session.on(handler)` immediately after creation, but executes earlier in the lifecycle. The same option is available on `ResumeSessionConfig.setOnEvent()` for resumed sessions.
556
+
557
+
---
558
+
509
559
## User Input Handling
510
560
511
561
Handle user input requests when the AI uses the `ask_user` tool to gather information from the user.
0 commit comments