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

Function externalAgentReadyError

coderd/x/chatd/chattool/createworkspace.go:604–614  ·  view source on GitHub ↗

externalAgentReadyError returns the external-agent-specific error message when agent belongs to an external resource, or the empty string otherwise. Errors looking up the resource are treated as non-external so the caller falls back to the dial error.

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

Source from the content-addressed store, hash-verified

602// string otherwise. Errors looking up the resource are treated as
603// non-external so the caller falls back to the dial error.
604func externalAgentReadyError(
605 ctx context.Context,
606 db database.Store,
607 agent database.WorkspaceAgent,
608) string {
609 isExternal, err := IsExternalWorkspaceAgent(ctx, db, agent)
610 if err != nil || !isExternal {
611 return ""
612 }
613 return ExternalAgentUnavailableMessage(agent)
614}
615
616// waitForAgentReady waits for the workspace agent to become
617// reachable and for its startup scripts to finish. It returns

Callers 1

waitForAgentReadyFunction · 0.85

Calls 2

IsExternalWorkspaceAgentFunction · 0.85

Tested by

no test coverage detected