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

Method checkSubagentCompletion

coderd/x/chatd/subagent.go:1411–1430  ·  view source on GitHub ↗
(
	ctx context.Context,
	chatID uuid.UUID,
)

Source from the content-addressed store, hash-verified

1409}
1410
1411func (p *Server) checkSubagentCompletion(
1412 ctx context.Context,
1413 chatID uuid.UUID,
1414) (database.Chat, string, bool, error) {
1415 chat, err := p.db.GetChatByID(ctx, chatID)
1416 if err != nil {
1417 return database.Chat{}, "", false, xerrors.Errorf("get chat: %w", err)
1418 }
1419
1420 if chat.Status == database.ChatStatusPending || chat.Status == database.ChatStatusRunning {
1421 return database.Chat{}, "", false, nil
1422 }
1423
1424 report, err := latestSubagentAssistantMessage(ctx, p.db, chatID)
1425 if err != nil {
1426 return database.Chat{}, "", false, err
1427 }
1428
1429 return chat, report, true, nil
1430}
1431
1432func latestSubagentAssistantMessage(
1433 ctx context.Context,

Callers 2

Calls 3

GetChatByIDMethod · 0.65
ErrorfMethod · 0.45

Tested by 1