MCPcopy Create free account
hub / github.com/compozy/agh / taskActorContextForWorkspace

Method taskActorContextForWorkspace

internal/api/core/tasks.go:119–145  ·  view source on GitHub ↗
(
	c *gin.Context,
	action string,
	expectedWorkspaceID string,
)

Source from the content-addressed store, hash-verified

117}
118
119func (h *BaseHandlers) taskActorContextForWorkspace(
120 c *gin.Context,
121 action string,
122 expectedWorkspaceID string,
123) (taskpkg.ActorContext, error) {
124 if h.TaskActorContextResolver != nil {
125 return h.TaskActorContextResolver(c, action)
126 }
127 credentials := agentCallerCredentialsFromRequest(c)
128 if hasAgentCallerIdentityCredentials(credentials) {
129 caller, err := h.resolveAgentCallerForWorkspace(
130 c.Request.Context(),
131 credentials,
132 "tasks."+strings.TrimSpace(action),
133 expectedWorkspaceID,
134 )
135 if err != nil {
136 return taskpkg.ActorContext{}, err
137 }
138 return caller.Actor, nil
139 }
140 return taskpkg.DeriveHumanActorContext(
141 defaultTaskActorRef,
142 taskOriginKindForTransport(h.transportName()),
143 "tasks."+strings.TrimSpace(action),
144 )
145}
146
147func taskOriginKindForTransport(name string) taskpkg.OriginKind {
148 normalized := strings.ToLower(strings.TrimSpace(name))

Callers 4

taskActorContextMethod · 0.95
CreateTaskMethod · 0.95

Tested by 1