MCPcopy Index your code
hub / github.com/docker/docker-agent / handleReadSessionPlan

Method handleReadSessionPlan

pkg/runtime/sessionplan_handlers.go:36–48  ·  view source on GitHub ↗
(_ context.Context, sess *session.Session, _ tools.ToolCall, _ EventSink)

Source from the content-addressed store, hash-verified

34}
35
36func (r *LocalRuntime) handleReadSessionPlan(_ context.Context, sess *session.Session, _ tools.ToolCall, _ EventSink) (*tools.ToolCallResult, error) {
37 content, _, err := sessionplan.ReadContent(sessionplan.DefaultDir(), sess.ID)
38 if errors.Is(err, sessionplan.ErrPlanNotFound) {
39 return tools.ResultError("no plan written yet for this session; call write_session_plan first"), nil
40 }
41 if err != nil {
42 if errors.Is(err, sessionplan.ErrInvalidSessionID) {
43 return tools.ResultError(err.Error()), nil
44 }
45 return nil, err
46 }
47 return tools.ResultSuccess(content), nil
48}
49
50// handleExitPlanMode marks the session's plan as ready and returns control to
51// the host. Switching agents is the host's decision — the runtime does not

Callers

nothing calls this directly

Calls 5

ReadContentFunction · 0.92
DefaultDirFunction · 0.92
ResultErrorFunction · 0.92
ResultSuccessFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected