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

Method findInterceptionLineage

coderd/aibridgedserver/aibridgedserver.go:422–435  ·  view source on GitHub ↗

findInterceptionLineage looks up the parent interception and the root of the thread by finding which interception recorded a tool usage with the given tool call ID. Returns (parentID, rootID); both will be uuid.Nil if no match is found or the tool call ID is empty.

(ctx context.Context, toolCallID string)

Source from the content-addressed store, hash-verified

420// the given tool call ID. Returns (parentID, rootID); both will be
421// uuid.Nil if no match is found or the tool call ID is empty.
422func (s *Server) findInterceptionLineage(ctx context.Context, toolCallID string) (parent uuid.UUID, root uuid.UUID) {
423 if toolCallID == "" {
424 return uuid.Nil, uuid.Nil
425 }
426
427 lineage, err := s.store.GetAIBridgeInterceptionLineageByToolCallID(ctx, toolCallID)
428 if err != nil {
429 s.logger.Warn(ctx, "failed to retrieve interception lineage",
430 slog.Error(err), slog.F("tool_call_id", toolCallID))
431 return uuid.Nil, uuid.Nil
432 }
433
434 return lineage.ThreadParentID, lineage.ThreadRootID
435}
436
437func (s *Server) GetMCPServerConfigs(_ context.Context, _ *proto.GetMCPServerConfigsRequest) (*proto.GetMCPServerConfigsResponse, error) {
438 cfgs := make([]*proto.MCPServerConfig, 0, len(s.externalAuthConfigs))

Callers 1

RecordInterceptionMethod · 0.95

Calls 2

ErrorMethod · 0.45

Tested by

no test coverage detected