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

Function IsExternalWorkspaceAgent

coderd/x/chatd/chattool/external_agents.go:38–47  ·  view source on GitHub ↗

IsExternalWorkspaceAgent reports whether agent belongs to an external resource.

(ctx context.Context, db database.Store, agent database.WorkspaceAgent)

Source from the content-addressed store, hash-verified

36// IsExternalWorkspaceAgent reports whether agent belongs to an external
37// resource.
38func IsExternalWorkspaceAgent(ctx context.Context, db database.Store, agent database.WorkspaceAgent) (bool, error) {
39 if db == nil || agent.ResourceID == uuid.Nil {
40 return false, nil
41 }
42 resource, err := db.GetWorkspaceResourceByID(ctx, agent.ResourceID)
43 if err != nil {
44 return false, err
45 }
46 return resource.Type == ExternalAgentResourceType, nil
47}

Callers 3

externalAgentErrorMethod · 0.92
externalAgentReadyErrorFunction · 0.85

Calls 1

Tested by

no test coverage detected