MCPcopy Index your code
hub / github.com/coder/coder / allSubagentDefinitions

Function allSubagentDefinitions

coderd/x/chatd/subagent_catalog.go:53–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53func 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 {

Callers 2

lookupSubagentDefinitionFunction · 0.85

Calls 8

userCanUseProviderKeysFunction · 0.85
isDesktopEnabledMethod · 0.80
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected