feat: Track PR outcomes end-to-end in task history#363
Open
whitmo wants to merge 1 commit intodlorenc:mainfrom
Open
feat: Track PR outcomes end-to-end in task history#363whitmo wants to merge 1 commit intodlorenc:mainfrom
whitmo wants to merge 1 commit intodlorenc:mainfrom
Conversation
Workers can now report their PR URL via `agent complete --pr-url <url>`, which gets persisted in task history with parsed PR number. A new daemon loop (every 5 min) polls GitHub for open/unknown task history entries and updates their status (merged/closed/open) via the existing but previously unused UpdateTaskHistoryStatus method. The CLI also uses stored terminal statuses (merged/closed) to avoid redundant GitHub API calls at display time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Triage ReviewPriority: P1 (Task history - roadmap item) Changes:
Recommendation: Safe to merge anytime - no conflicts with any other PR. |
5 tasks
Author
Local CI Verification (2026-03-12)
CI Status: No GitHub Actions checks are running — this is expected for first-time fork PRs. GitHub requires a maintainer to approve workflow runs for PRs from forks. Branch is rebased on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--pr-urlflag toagent completeso workers can report which PR they created when signaling completionUpdateTaskHistoryStatusmethodGetPendingTaskHistorystate method to efficiently query entries needing outcome checksparsePRNumberandghStateToTaskStatushelpers with comprehensive testsWhat was broken before
The task history system had the infrastructure but wasn't wiring it together:
UpdateTaskHistoryStatus()andUpdateTaskHistorySummary()existed but were never called in production (dead code)Data flow (after)
Test plan
TestGetPendingTaskHistory- returns only open/unknown entries with branchesTestGetPendingTaskHistoryNonExistentRepo- error handlingTestRecordTaskHistoryWithPRURL- PR URL/number captured, status set to openTestRecordTaskHistoryWithPRURLAndFailure- failure status takes precedence over PRTestParsePRNumber- URL parsing edge casesTestGhStateToTaskStatus- GitHub state mappinggo test ./...)verify-docsstate schema check passes🤖 Generated with Claude Code