()
| 51 | } |
| 52 | |
| 53 | func allSubagentDefinitions() []subagentDefinition { |
| 54 | return []subagentDefinition{ |
| 55 | { |
| 56 | id: subagentTypeGeneral, |
| 57 | description: "substantial delegated research, analysis, reasoning, review, planning support, and implementation", |
| 58 | buildOptions: func(ctx context.Context, p *Server, parent database.Chat, _ database.Chat, _ uuid.UUID, _ string) (childSubagentChatOptions, error) { |
| 59 | modelConfigID, err := p.resolveSubagentModelConfigID( |
| 60 | ctx, |
| 61 | parent.OwnerID, |
| 62 | codersdk.ChatModelOverrideContextGeneral, |
| 63 | ) |
| 64 | if err != nil { |
| 65 | return childSubagentChatOptions{}, err |
| 66 | } |
| 67 | options := childSubagentChatOptions{} |
| 68 | if modelConfigID != uuid.Nil { |
| 69 | options.modelConfigIDOverride = &modelConfigID |
| 70 | } |
| 71 | return options, nil |
| 72 | }, |
| 73 | }, |
| 74 | { |
| 75 | id: subagentTypeExplore, |
| 76 | description: "narrow repository-local read-only code discovery and code tracing", |
| 77 | buildOptions: func(ctx context.Context, p *Server, _ database.Chat, turnParent database.Chat, currentModelConfigID uuid.UUID, _ string) (childSubagentChatOptions, error) { |
| 78 | modelConfigID, err := p.resolveSubagentModelConfigID( |
| 79 | ctx, |
| 80 | turnParent.OwnerID, |
| 81 | codersdk.ChatModelOverrideContextExplore, |
| 82 | ) |
| 83 | if err != nil { |
| 84 | return childSubagentChatOptions{}, err |
| 85 | } |
| 86 | if modelConfigID == uuid.Nil { |
| 87 | modelConfigID = currentModelConfigID |
| 88 | } |
| 89 | inheritedMCPServerIDs, err := p.resolveExploreToolSnapshot( |
| 90 | ctx, |
| 91 | turnParent, |
| 92 | ) |
| 93 | if err != nil { |
| 94 | return childSubagentChatOptions{}, err |
| 95 | } |
| 96 | // Clearing plan mode changes only the Explore model behavior. |
| 97 | // The inherited tool snapshot still comes from the parent turn. |
| 98 | clearPlanMode := database.NullChatPlanMode{} |
| 99 | return childSubagentChatOptions{ |
| 100 | chatMode: database.NullChatMode{ |
| 101 | ChatMode: database.ChatModeExplore, |
| 102 | Valid: true, |
| 103 | }, |
| 104 | modelConfigIDOverride: &modelConfigID, |
| 105 | planModeOverride: &clearPlanMode, |
| 106 | inheritedMCPServerIDs: inheritedMCPServerIDs, |
| 107 | }, nil |
| 108 | }, |
| 109 | }, |
| 110 | { |
no test coverage detected