From fd57cbc3232e305264f1121adbb85dab66ab6963 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Wed, 10 Jun 2026 21:34:31 -0700 Subject: [PATCH] Hide terminal PR artifacts from manager assignments --- internal/eventstore/projection.go | 3 ++- internal/eventstore/projection_test.go | 9 ++++++++- internal/orchestrator/service_test.go | 14 +++++++++++++- internal/orchestrator/task_assignments.go | 3 ++- internal/orchestrator/task_assignments_test.go | 2 ++ web/src/main.tsx | 3 ++- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/internal/eventstore/projection.go b/internal/eventstore/projection.go index 3700500..2e1b00d 100644 --- a/internal/eventstore/projection.go +++ b/internal/eventstore/projection.go @@ -508,7 +508,8 @@ func isTerminalPullRequestState(state string) bool { } func isManagerVisibleArtifact(kind string) bool { - return !strings.EqualFold(strings.TrimSpace(kind), "worker_log") + normalized := strings.ToLower(strings.TrimSpace(kind)) + return normalized != "worker_log" && normalized != "github_pull_request" } func managerSummaryTone(current string, next string) string { diff --git a/internal/eventstore/projection_test.go b/internal/eventstore/projection_test.go index 00d1381..d59a9ee 100644 --- a/internal/eventstore/projection_test.go +++ b/internal/eventstore/projection_test.go @@ -215,13 +215,20 @@ func TestBuildManagerSummariesCountsOnlyCurrentSignals(t *testing.T) { Name: "Remote stdout", UpdatedAt: base.Add(14 * time.Minute), }, + "pr-artifact": { + ID: "open-pr", + TaskID: "task", + Kind: "github_pull_request", + Name: "Open PR", + UpdatedAt: base.Add(15 * time.Minute), + }, } steering := map[string]core.SteeringItem{ "steering": { ID: "steering", TaskID: "task", Status: "pending", - UpdatedAt: base.Add(15 * time.Minute), + UpdatedAt: base.Add(16 * time.Minute), }, } diff --git a/internal/orchestrator/service_test.go b/internal/orchestrator/service_test.go index a523878..c1e8268 100644 --- a/internal/orchestrator/service_test.go +++ b/internal/orchestrator/service_test.go @@ -10554,7 +10554,19 @@ func TestServiceWaitsForProviderCapacityWhenUsageExhaustedWithoutFallback(t *tes t.Fatal(err) } - snapshot := waitForTaskStatus(t, store, task.ID, core.TaskWaiting) + snapshot := waitForSnapshot(t, store, func(snapshot core.Snapshot) bool { + if len(snapshot.Tasks) == 0 { + return false + } + got := snapshot.Tasks[0] + return got.ID == task.ID && + got.Status == core.TaskWaiting && + got.ObjectiveStatus == core.ObjectiveWaitingExternal && + got.ObjectivePhase == "provider_usage_exhausted" && + hasTaskAction(snapshot.Events, task.ID, "provider_usage_exhausted", "waiting_external") + }, func(snapshot core.Snapshot) string { + return fmt.Sprintf("missing provider usage exhausted waiting state/action:\n%s", taskActionPayloads(snapshot.Events, task.ID)) + }) if snapshot.Tasks[0].ObjectiveStatus != core.ObjectiveWaitingExternal || snapshot.Tasks[0].ObjectivePhase != "provider_usage_exhausted" { t.Fatalf("objective = %q phase %q", snapshot.Tasks[0].ObjectiveStatus, snapshot.Tasks[0].ObjectivePhase) } diff --git a/internal/orchestrator/task_assignments.go b/internal/orchestrator/task_assignments.go index c5a35be..37eacd3 100644 --- a/internal/orchestrator/task_assignments.go +++ b/internal/orchestrator/task_assignments.go @@ -807,7 +807,8 @@ func isDisplayWorkItemStatus(status core.WorkItemStatus) bool { } func isManagerVisibleArtifact(kind string) bool { - return !strings.EqualFold(strings.TrimSpace(kind), "worker_log") + normalized := strings.ToLower(strings.TrimSpace(kind)) + return normalized != "worker_log" && normalized != "github_pull_request" } func isActiveAssignmentStatus(status string) bool { diff --git a/internal/orchestrator/task_assignments_test.go b/internal/orchestrator/task_assignments_test.go index 02191e9..eb82cd5 100644 --- a/internal/orchestrator/task_assignments_test.go +++ b/internal/orchestrator/task_assignments_test.go @@ -283,6 +283,7 @@ func TestBuildTaskAssignmentsDisplayRowsHideHistoricalFailures(t *testing.T) { }, Artifacts: []core.Artifact{ {ID: "stdout-log", TaskID: "task-1", Kind: "worker_log", Name: "Remote stdout", Ref: "/home/bot/work/worker/stdout.log", CreatedAt: now, UpdatedAt: now.Add(time.Minute)}, + {ID: "pr-open", TaskID: "task-1", Kind: "github_pull_request", Name: "Open result", Ref: "feature/open", URL: "https://github.com/owner/repo/pull/2", CreatedAt: now, UpdatedAt: now.Add(time.Minute)}, {ID: "benchmark", TaskID: "task-1", Kind: "benchmark", Name: "Benchmark", Ref: "shared/bench.txt", CreatedAt: now, UpdatedAt: now.Add(2 * time.Minute)}, }, } @@ -298,6 +299,7 @@ func TestBuildTaskAssignmentsDisplayRowsHideHistoricalFailures(t *testing.T) { displayRowAbsent(t, result.DisplayRows, "pr:pr-merged") displayRowAbsent(t, result.DisplayRows, "feedback:feedback-merged") displayRowAbsent(t, result.DisplayRows, "artifact:stdout-log") + displayRowAbsent(t, result.DisplayRows, "artifact:pr-open") displayRowByID(t, result.DisplayRows, "work:queued-work") displayRowByID(t, result.DisplayRows, "debug_worker:worker-queued") diff --git a/web/src/main.tsx b/web/src/main.tsx index 5085bdb..46ebbdc 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -4671,7 +4671,8 @@ function isTerminalPullRequestState(state: PullRequestState["state"] | undefined } function isManagerVisibleArtifact(artifact: Artifact): boolean { - return artifact.kind.trim().toLowerCase() !== "worker_log"; + const kind = artifact.kind.trim().toLowerCase(); + return kind !== "worker_log" && kind !== "github_pull_request"; } function formatDuration(start: string, end: string): string {