Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d105918

Browse files
committed
fixup! chore: add experiment agentic-chat, add tests for chat API routes
1 parent 1103e10 commit d105918

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coderd/chat.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ func (api *API) postChatMessages(w http.ResponseWriter, r *http.Request) {
179179
client := codersdk.New(api.AccessURL)
180180
client.SetSessionToken(httpmw.APITokenFromRequest(r))
181181

182-
tools := make([]aisdk.Tool, len(toolsdk.All))
182+
tools := make([]aisdk.Tool, 0)
183183
handlers := map[string]toolsdk.GenericHandlerFunc{}
184-
for i, tool := range toolsdk.All {
184+
for _, tool := range toolsdk.All {
185185
if tool.Name == "coder_report_task" {
186186
continue // This tool requires an agent to run.
187187
}
188-
tools[i] = tool.Tool
188+
tools = append(tools, tool.Tool)
189189
handlers[tool.Tool.Name] = tool.Handler
190190
}
191191

0 commit comments

Comments
 (0)