diff --git a/pkg/agent/approval.go b/pkg/agent/approval.go index 43c6fba83..93d541bc3 100644 --- a/pkg/agent/approval.go +++ b/pkg/agent/approval.go @@ -80,6 +80,7 @@ func MergeApprovalDecisions( if cp.ApprovalInput == nil { cp.ApprovalInput = make(map[string]ApprovalResult, len(decisions)) } + maps.Copy(cp.ApprovalInput, decisions) data, err := json.Marshal(&cp) diff --git a/pkg/agentrun/handler.go b/pkg/agentrun/handler.go index f63e21424..dc08efde9 100644 --- a/pkg/agentrun/handler.go +++ b/pkg/agentrun/handler.go @@ -177,8 +177,7 @@ func (h *handler) executeRun(ctx context.Context, run *coredata.AgentRun) error run.Result = nil run.ErrorMessage = nil - switch { - case runErr == nil: + if runErr == nil { run.Status = coredata.AgentRunStatusCompleted if result != nil { diff --git a/pkg/agentrun/worker_test.go b/pkg/agentrun/worker_test.go index c4daac34d..bc5cd5848 100644 --- a/pkg/agentrun/worker_test.go +++ b/pkg/agentrun/worker_test.go @@ -151,6 +151,7 @@ func TestWorker_StopAndResume(t *testing.T) { t, func() bool { r, err := tryLoadAgentRun(client, run.ID) + return err == nil && r.Status == coredata.AgentRunStatusPending && r.Checkpoint != nil @@ -558,6 +559,7 @@ func TestWorker_StopAndResumeAcrossHandoff(t *testing.T) { t, func() bool { r, err := tryLoadAgentRun(client, run.ID) + return err == nil && r.Status == coredata.AgentRunStatusPending && r.Checkpoint != nil @@ -690,6 +692,7 @@ func TestWorker_StopAndResumeNestedSubAgent(t *testing.T) { t, func() bool { r, err := tryLoadAgentRun(client, run.ID) + return err == nil && r.Status == coredata.AgentRunStatusPending && r.Checkpoint != nil diff --git a/pkg/probod/probod.go b/pkg/probod/probod.go index f29e9e301..d1e0cf532 100644 --- a/pkg/probod/probod.go +++ b/pkg/probod/probod.go @@ -595,6 +595,7 @@ func (impl *Implm) Run( ) agentRunService := agentrun.NewService(pgClient) + iamService.Authorizer.RegisterPolicySet(agentrun.PolicySet()) thirdPartyService := thirdparty.NewService(pgClient, fileService, thirdPartyVetter)