Surface code-change claim tasks in the tasks list, with their originating prompt - #5071
Open
Evanfeenstra wants to merge 2 commits into
Open
Surface code-change claim tasks in the tasks list, with their originating prompt#5071Evanfeenstra wants to merge 2 commits into
Evanfeenstra wants to merge 2 commits into
Conversation
…ting prompt Approving a `propose_code_change` proposal creates a claim Task, but it was invisible in the default tasks list: the list only shows a TODO task when it is agent-mode or Stakwork-backed, and the claim is neither. It rendered only in Kanban, which groups by workflowStatus and skips that check. Create the claim `IN_PROGRESS` instead of letting it default to TODO. That is also the honest state — the PR run is in flight — and the existing merge paths (pr-monitor, the GitHub webhook) already carry it to DONE on merge or CANCELLED on close off the PULL_REQUEST artifact, so no new terminal transition is needed. Exempt claims from the stale-task halt sweep. That branch matches any IN_PROGRESS task with no open PR and no pod, with no tenant or source filter, so a claim would be halted after the stale threshold — overwriting the `workflowStatus: COMPLETED` that pr-monitor's fix path depends on, in exactly the case worth keeping intact: a PR that never reported back, which code-change-reconcile still expects to recover. `proposalId` is written only by approveCodeChange, so it identifies claims precisely. Also carry the originating `repo_agent` prompt into the claim. It was dropped after the preview run, so the Task view showed a diff and a PR with no record of what was asked. It now rides on the proposal payload and is seeded as a USER message ahead of the diff. The field is optional: proposals stored before this replay result-only. Scope `attachPrArtifact` to the ASSISTANT message. Both seed rows are written in one transaction, so `createdAt` alone can tie and hand back the prompt row; the role filter keeps the PR artifact beside its diff. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Test environment is now live. View it at: https://hive-preview-2.sphinx.chat Database expires at: Aug 19, 2026, 11:14 PM UTC |
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.
What
Approving a
propose_code_changeproposal creates a claim Task — but you couldn't see it in the workspace tasks list. This makes it visible, and gives it the prompt that produced it.Why it was hidden
The list only shows a
TODOtask if it's agent-mode or Stakwork-backed (tasks/route.ts). The claim ismode: "live"withstakworkProjectId: nulland never setstatus, so it defaulted toTODOand matched none of the three branches. It rendered only in Kanban, which groups byworkflowStatusand skips that check entirely.Changes
Create the claim
IN_PROGRESS. Also the honest state — the PR run is in flight. No new terminal transition was needed: the claim already gets aPULL_REQUESTartifact, so pr-monitor and the GitHub webhook carry it toDONEon merge /CANCELLEDon close.Exempt claims from the stale-task halt sweep. This is the part that would have bitten. The halt branch in
releaseStaleTaskPodsmatches anyIN_PROGRESStask with no open PR and no pod — no tenant, source, or assignee filter. A claim would be halted after the stale threshold, overwriting theworkflowStatus: COMPLETEDthat pr-monitor's fix path depends on, in precisely the case worth preserving: a PR that never reported back, whichcode-change-reconcilestill expects to recover. Guarded withproposalId: null, which is exact —Task.proposalIdis written only byapproveCodeChange.Carry the originating prompt into the claim. It was consumed by the read-only preview run and dropped, so the Task view showed a diff and a PR with no record of what was asked. It now rides on
CodeChangeProposalPayloadand is seeded as aUSERmessage ahead of the diff. Optional field — proposals stored before this replay result-only.Scope
attachPrArtifactto the ASSISTANT message. Both seed rows are written in one transaction, socreatedAtalone can tie and hand back the prompt row. The role filter keeps the PR artifact beside its diff.Also tightens the
propose_code_changeprompt guidance from the enforced cap (≤ 50 files) to a focus target of < 10 files, in both the system prompt and the capability snippet. The enforced cap is unchanged.Verification
handleApproval-code-change,codeChangeCompletion,codeChangeTools,code-change-webhook, and the fullunit/services+unit/lib/proposalssuites: 2863 passed, 1 skipped.IN_PROGRESS; prompt seeded as USER ahead of the diff and read from the stored proposal rather than the caller's transcript; back-compat whenpromptis absent;attachPrArtifactrole targeting and its no-duplicate path.release-stale-task-podsassertions that pin the sweep's where-clause.tsc --noEmitclean for production code; eslint clean on changed files.Note: the repo isn't Prettier-clean on these files, so I formatted by hand to keep the diff reviewable rather than running
npm run format.🤖 Generated with Claude Code