fix(task-board): resolve the PR-open reaction's archive lane from the board - #6862
Merged
Merged
Conversation
pedrofrxncx
added a commit
that referenced
this pull request
Sep 2, 2026
…es to the activity log (#6878) Three status_changed entries in run-reactions.ts hardcoded "in_progress", "todo", and "in_review" instead of reading the board's own lanes — the same class of bug fixed in #6849/#6862/#6873 for the sweep/conflict paths. On an org-owned board (org_board_columns), a card's real progress/queue/review column can have a different name, so the timeline would show a from/to that doesn't match what was actually written to the card's status.
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.
Same bug class #6858 (in this batch) fixed in
review-sweeper.ts: a hardcoded canonical-status literal that no longer holds for an org-owned (mirrored) board, where a card'sstatusis that board's own column key, not Studio's fixed vocabulary.reactToPrOpenedForBoard(inpr-open-board-reaction.ts, predates the org-board-columns work — added in #6344 on Aug 21) filters the candidate cards it hands to the LLM witht.status !== "done" && t.status !== "archived". On an org-owned board, the column playing the "archived" role can have any key (e.g. a mirrored Jira status), so that literal never matches — every closed/archived card on that board leaks into the "open cards" list sent to the model, which can then pick one toupdate, re-linking a PR onto a card that's already done.Fix: resolve
board.lanes()before building the candidate list and also excludet.status === lanes.archive(the board's actual archive column,nullon a board with none — a no-op filter in that case, same as before).board.lanes()was already being fetched later in the function forapplyBoardDecision; moved it earlier and reused it instead of computing twice.Behavior-preserving for Studio's own board:
lanes.archivethere is literally"archived", already covered by the existing check, so nothing changes for the common case — only org-owned boards are affected, and only by excluding cards that shouldn't have been candidates in the first place.To confirm:
cd apps/api && bunx tsc --noEmit(clean) andbunx oxlint apps/api/src/tools/task-board/pr-open-board-reaction.ts(clean). No test added — this function (reactToPrOpenedForBoard) takes a fullStudioContextand callsgenerateObject, so exercising it needs e2e infra (real Postgres + a model provider), not a unit test; the extracted pure half (applyBoardDecision, unaffected by this change) already has Postgres integration coverage inpr-open-board-reaction.integration.test.ts. Full CI validates the rest.Summary by cubic
Fixes the PR-open reaction's candidate filter so archived cards on org-owned (mirrored) boards no longer leak into the list sent to the LLM.
"archived"status, which never matches an org-owned board's archive column.board.lanes()before building candidates and excludes the actual archive lane (a no-op on boards with none).board.lanes()call earlier and reuses it instead of computing twice."archived".Written for commit 1c6edbb. Summary will update on new commits.