Skip to content

[Feat] Add merged and closed PR status to task history#243

Merged
mrubens merged 2 commits into
developfrom
feature/pr-status-task-history-2alo0m50qai1d
Jul 12, 2026
Merged

[Feat] Add merged and closed PR status to task history#243
mrubens merged 2 commits into
developfrom
feature/pr-status-task-history-2alo0m50qai1d

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Matt Rubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

Related issue

Internal work from Slack (no tracked issue).

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

What changed

When a linked pull request is merged or closed, Roomote now writes that terminal status into the owning task's transcript history as an out-of-band assistant message — the same resurfacing mechanism already used for PR review-feedback notifications.

  • Adds PR_STATUS_NOTIFICATION_TASK_MESSAGE_SOURCE to the out-of-band message sources so the next agent turn can re-surface the change.
  • Adds recordPrStatusChangeInTaskHistory in the SDK with Redis per-task dedup against webhook retries.
  • Uses wall-clock timestamps so two terminal PR events in the same second cannot collide on the task-message unique key.
  • Formats GitLab (!n) and Azure DevOps (PR n) references with provider-native shorthand.
  • Hooks the recorder into terminal PR lifecycle paths for GitHub, GitLab, Gitea, Bitbucket, and Azure DevOps.

Existing platform merge chat notifications are unchanged; this path only fills the agent-context gap for status in task history.

How it was tested

  • Unit tests for the new status recorder (record-pr-status-change.test.ts), including provider reference formatting and wall-clock timestamps
  • Existing webhook handler tests for GitHub, GitLab, Gitea, and ADO (mock wiring updated)
  • Out-of-band claim tests remain green (new source is registered in the shared source list)
  • Pre-push lint:fast, check-types:fast, and knip passed on push

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

Write terminal PR status changes into linked task history as out-of-band
messages so agents get the same context path used for review notifications.
@roomote-roomote

roomote-roomote Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

No new code issues found. Both earlier findings are resolved in 9ad7420. See task

  • Event-time ts can overwrite an earlier status line — fixed: status messages now use Date.now() so concurrent terminal events cannot collide on the (taskId, protocol, ts, eventType) unique key; webhook retries stay idempotent via the Redis claim.
  • # reference is provider-inaccurate for GitLab/ADO — fixed: formatter now uses # for GitHub/Gitea/Bitbucket, ! for GitLab, and PR n for Azure DevOps.

Reviewed 9ad7420

@roomote-roomote

roomote-roomote Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both open review findings in 9ad7420:

  1. Status-history messages now use Date.now() so two PR terminal events in the same second no longer can overwrite each other on the task-message unique key.
  2. GitLab uses !n and Azure DevOps uses PR n in the agent-facing status text (GitHub/Gitea/Bitbucket keep #n).

Tests updated/passed for the recorder.

Use Date.now() for status-history timestamps so concurrent terminal events
do not share a second, and format GitLab/ADO PR references with provider-
native shorthand instead of always using #.
@mrubens mrubens marked this pull request as ready for review July 12, 2026 13:05
@mrubens mrubens merged commit 94190ad into develop Jul 12, 2026
14 checks passed
@mrubens mrubens deleted the feature/pr-status-task-history-2alo0m50qai1d branch July 12, 2026 13:05
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