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
<p>All <code>getUi()</code> methods throw <code>IllegalStateException</code> if the host does not support elicitation. Always check capabilities first.</p><hr/></section></section><section><aid="Getting_Session_Metadata_by_ID"></a>
1382
+
<p>All <code>getUi()</code> methods throw <code>IllegalStateException</code> if the host does not support elicitation. Always check capabilities first.</p><hr/></section></section><section><aid="Mode_Handlers"></a>
1383
+
<h2>Mode Handlers</h2>
1384
+
<p>Mode handlers let your application respond to mode transitions requested by the Copilot CLI.</p><section><aid="Exit_Plan_Mode"></a>
1385
+
<h3>Exit Plan Mode</h3>
1386
+
<p>When the model finishes creating a plan and wants to transition out of plan mode, it invokes the <code>exitPlanMode</code> handler. Register the handler via <code>SessionConfig.setOnExitPlanMode()</code>:</p>
<p>When no handler is registered, the SDK automatically approves the plan (<code>approved=true</code>). The handler receives an <code>ExitPlanModeRequest</code> with:</p>
1403
+
<tableclass="table table-striped">
1404
+
<thead>
1405
+
<trclass="a">
1406
+
<th>Field</th>
1407
+
<th>Description</th></tr></thead><tbody>
1408
+
<trclass="b">
1409
+
<td><code>summary</code></td>
1410
+
<td>Summary of the plan that was created</td></tr>
<td>The recommended action for the user</td></tr></tbody>
1420
+
</table>
1421
+
</section><section><aid="Auto_Mode_Switch"></a>
1422
+
<h3>Auto Mode Switch</h3>
1423
+
<p>When the model encounters a rate limit or similar constraint, it may request to switch modes automatically. Register the handler via <code>SessionConfig.setOnAutoModeSwitch()</code>:</p>
<p>Both handlers are also available on <code>ResumeSessionConfig</code> for resumed sessions.</p><hr/></section></section><section><aid="Getting_Session_Metadata_by_ID"></a>
1377
1452
<h2>Getting Session Metadata by ID</h2>
1378
1453
<p>Retrieve metadata for a specific session without listing all sessions:</p>
0 commit comments