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)
| 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. |
| 422 | func (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 | |
| 437 | func (s *Server) GetMCPServerConfigs(_ context.Context, _ *proto.GetMCPServerConfigsRequest) (*proto.GetMCPServerConfigsResponse, error) { |
| 438 | cfgs := make([]*proto.MCPServerConfig, 0, len(s.externalAuthConfigs)) |
no test coverage detected