Package com.github.copilot.sdk.json
Interface ExitPlanModeHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handler for exit-plan-mode requests from the agent.
Register an exit-plan-mode handler via
SessionConfig.setOnExitPlanMode(ExitPlanModeHandler) or
ResumeSessionConfig.setOnExitPlanMode(ExitPlanModeHandler). When
provided, the server routes exitPlanMode.request callbacks to this
handler.
Example Usage
ExitPlanModeHandler handler = (request, invocation) -> {
// Review the plan and decide whether to approve
return CompletableFuture
.completedFuture(new ExitPlanModeResult().setApproved(true).setSelectedAction("interactive"));
};
var session = client.createSession(new SessionConfig().setOnExitPlanMode(handler)).get();
- Since:
- 1.0.8
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionhandle(ExitPlanModeRequest request, ExitPlanModeInvocation invocation) Handles an exit-plan-mode request from the agent.
-
Method Details
-
handle
CompletableFuture<ExitPlanModeResult> handle(ExitPlanModeRequest request, ExitPlanModeInvocation invocation) Handles an exit-plan-mode request from the agent.- Parameters:
request- the exit-plan-mode request containing the summary, plan content, and available actionsinvocation- context information about the invocation- Returns:
- a future that resolves with the user's decision
-