| 4775 | } |
| 4776 | |
| 4777 | func (f *fakeSessionManager) Spawn(ctx context.Context, opts session.SpawnOpts) (*session.Session, error) { |
| 4778 | child, err := f.Create(ctx, session.CreateOpts{ |
| 4779 | AgentName: opts.AgentName, |
| 4780 | Provider: opts.Provider, |
| 4781 | Name: opts.Name, |
| 4782 | Workspace: opts.Workspace, |
| 4783 | WorkspacePath: opts.WorkspacePath, |
| 4784 | Channel: opts.Channel, |
| 4785 | PromptOverlay: opts.PromptOverlay, |
| 4786 | Type: session.SessionTypeSpawned, |
| 4787 | Lineage: &store.SessionLineage{ |
| 4788 | ParentSessionID: opts.ParentSessionID, |
| 4789 | SpawnRole: opts.SpawnRole, |
| 4790 | AutoStopOnParent: opts.AutoStopOnParent, |
| 4791 | PermissionPolicy: opts.PermissionPolicy, |
| 4792 | }, |
| 4793 | }) |
| 4794 | if err != nil { |
| 4795 | return nil, err |
| 4796 | } |
| 4797 | f.mu.Lock() |
| 4798 | f.infos = append(f.infos, child.Info()) |
| 4799 | f.mu.Unlock() |
| 4800 | return child, nil |
| 4801 | } |
| 4802 | |
| 4803 | func (f *fakeSessionManager) List() []*session.Info { |
| 4804 | f.mu.Lock() |