Fix linter issues in agent-run packages

Replace the single-case switch in the agent-run handler with an if,
and add the blank lines wsl_v5 requires around statements in the
approval checkpoint, worker tests, and policy-set registration.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-08 15:22:17 +02:00
parent 79d57e35d1
commit 997e37a5c5
4 changed files with 6 additions and 2 deletions

View File

@@ -80,6 +80,7 @@ func MergeApprovalDecisions(
if cp.ApprovalInput == nil { if cp.ApprovalInput == nil {
cp.ApprovalInput = make(map[string]ApprovalResult, len(decisions)) cp.ApprovalInput = make(map[string]ApprovalResult, len(decisions))
} }
maps.Copy(cp.ApprovalInput, decisions) maps.Copy(cp.ApprovalInput, decisions)
data, err := json.Marshal(&cp) data, err := json.Marshal(&cp)

View File

@@ -177,8 +177,7 @@ func (h *handler) executeRun(ctx context.Context, run *coredata.AgentRun) error
run.Result = nil run.Result = nil
run.ErrorMessage = nil run.ErrorMessage = nil
switch { if runErr == nil {
case runErr == nil:
run.Status = coredata.AgentRunStatusCompleted run.Status = coredata.AgentRunStatusCompleted
if result != nil { if result != nil {

View File

@@ -151,6 +151,7 @@ func TestWorker_StopAndResume(t *testing.T) {
t, t,
func() bool { func() bool {
r, err := tryLoadAgentRun(client, run.ID) r, err := tryLoadAgentRun(client, run.ID)
return err == nil && return err == nil &&
r.Status == coredata.AgentRunStatusPending && r.Status == coredata.AgentRunStatusPending &&
r.Checkpoint != nil r.Checkpoint != nil
@@ -558,6 +559,7 @@ func TestWorker_StopAndResumeAcrossHandoff(t *testing.T) {
t, t,
func() bool { func() bool {
r, err := tryLoadAgentRun(client, run.ID) r, err := tryLoadAgentRun(client, run.ID)
return err == nil && return err == nil &&
r.Status == coredata.AgentRunStatusPending && r.Status == coredata.AgentRunStatusPending &&
r.Checkpoint != nil r.Checkpoint != nil
@@ -690,6 +692,7 @@ func TestWorker_StopAndResumeNestedSubAgent(t *testing.T) {
t, t,
func() bool { func() bool {
r, err := tryLoadAgentRun(client, run.ID) r, err := tryLoadAgentRun(client, run.ID)
return err == nil && return err == nil &&
r.Status == coredata.AgentRunStatusPending && r.Status == coredata.AgentRunStatusPending &&
r.Checkpoint != nil r.Checkpoint != nil

View File

@@ -595,6 +595,7 @@ func (impl *Implm) Run(
) )
agentRunService := agentrun.NewService(pgClient) agentRunService := agentrun.NewService(pgClient)
iamService.Authorizer.RegisterPolicySet(agentrun.PolicySet()) iamService.Authorizer.RegisterPolicySet(agentrun.PolicySet())
thirdPartyService := thirdparty.NewService(pgClient, fileService, thirdPartyVetter) thirdPartyService := thirdparty.NewService(pgClient, fileService, thirdPartyVetter)