Skip to content

fix(task-board): resolve the PR-open reaction's archive lane from the board - #6862

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/pr-open-reaction-org-archive-lane-w1
Sep 2, 2026
Merged

fix(task-board): resolve the PR-open reaction's archive lane from the board#6862
pedrofrxncx merged 1 commit into
mainfrom
fix/pr-open-reaction-org-archive-lane-w1

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

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's status is that board's own column key, not Studio's fixed vocabulary.

reactToPrOpenedForBoard (in pr-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 with t.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 to update, re-linking a PR onto a card that's already done.

Fix: resolve board.lanes() before building the candidate list and also exclude t.status === lanes.archive (the board's actual archive column, null on a board with none — a no-op filter in that case, same as before). board.lanes() was already being fetched later in the function for applyBoardDecision; moved it earlier and reused it instead of computing twice.

Behavior-preserving for Studio's own board: lanes.archive there 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) and bunx oxlint apps/api/src/tools/task-board/pr-open-board-reaction.ts (clean). No test added — this function (reactToPrOpenedForBoard) takes a full StudioContext and calls generateObject, 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 in pr-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.

  • The filter previously excluded only the literal "archived" status, which never matches an org-owned board's archive column.
  • Resolves board.lanes() before building candidates and excludes the actual archive lane (a no-op on boards with none).
  • Moves the existing board.lanes() call earlier and reuses it instead of computing twice.
  • Behavior is unchanged for Studio's own board, where the archive lane is literally "archived".

Written for commit 1c6edbb. Summary will update on new commits.

Review in cubic

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.
@pedrofrxncx
pedrofrxncx merged commit 494c36f into main Sep 2, 2026
33 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/pr-open-reaction-org-archive-lane-w1 branch September 2, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant