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

Function handleSubagentDone

coderd/x/chatd/subagent.go:1368–1380  ·  view source on GitHub ↗

handleSubagentDone translates a completed subagent check into the appropriate return value, surfacing error-status chats as errors.

(
	chat database.Chat,
	report string,
)

Source from the content-addressed store, hash-verified

1366// handleSubagentDone translates a completed subagent check into the
1367// appropriate return value, surfacing error-status chats as errors.
1368func handleSubagentDone(
1369 chat database.Chat,
1370 report string,
1371) (database.Chat, string, error) {
1372 if chat.Status == database.ChatStatusError {
1373 reason := strings.TrimSpace(report)
1374 if reason == "" {
1375 reason = "agent reached error status"
1376 }
1377 return database.Chat{}, "", xerrors.New(reason)
1378 }
1379 return chat, report, nil
1380}
1381
1382func (p *Server) closeSubagent(
1383 ctx context.Context,

Callers 1

Calls 1

NewMethod · 0.65

Tested by

no test coverage detected