RestartToolset locates the named toolset on the active agent and asks it to restart in place. The supervisor closes the current session and reconnects; this method blocks until the new session is Ready, ctx is cancelled, or the underlying supervisor's timeout elapses. Returns an error when: - no to
(ctx context.Context, name string)
| 1038 | // built-in), so non-restartable matches are skipped rather than aborting: |
| 1039 | // the first restartable toolset with the given name wins. |
| 1040 | func (r *LocalRuntime) RestartToolset(ctx context.Context, name string) error { |
| 1041 | a := r.CurrentAgent() |
| 1042 | if a == nil { |
| 1043 | return errors.New("no active agent") |
| 1044 | } |
| 1045 | found := false |
| 1046 | for _, ts := range a.ToolSets() { |
| 1047 | if nameFor(ts, tools.DescribeToolSet(ts)) != name { |
| 1048 | continue |
| 1049 | } |
| 1050 | found = true |
| 1051 | if restartable, ok := tools.As[tools.Restartable](ts); ok { |
| 1052 | return restartable.Restart(ctx) |
| 1053 | } |
| 1054 | } |
| 1055 | if found { |
| 1056 | return fmt.Errorf("toolset %q does not support restart", name) |
| 1057 | } |
| 1058 | return fmt.Errorf("toolset %q not found", name) |
| 1059 | } |
| 1060 | |
| 1061 | // toolsetStatusFor builds a ToolsetStatus for ts. tools.As walks the |
| 1062 | // wrapper chain so Statable/Describer can live anywhere in the stack. |
nothing calls this directly
no test coverage detected