Skip to content

feat(lifecycle): replace progress comment with PR created message#423

Merged
zbigniewsobiecki merged 3 commits intodevfrom
feature/pr-created-replaces-progress-comment
Feb 18, 2026
Merged

feat(lifecycle): replace progress comment with PR created message#423
zbigniewsobiecki merged 3 commits intodevfrom
feature/pr-created-replaces-progress-comment

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Feb 18, 2026

Summary

  • Threads progressCommentId through the execution pipeline: ProgressMonitorAgentResultadapteragent-executionlifecycle
  • Updates progress comment — When the implementation agent posts "PR created: …", handleSuccess now calls updateComment on the existing progress comment instead of always calling addComment
  • Fallback safety — If updateComment fails (e.g. comment deleted), falls back to addComment so the PR URL is never lost
  • Backward compatibleprogressCommentId is optional; without it, existing addComment behavior is preserved

Changes

  • src/types/index.ts — Added progressCommentId?: string to AgentResult
  • src/backends/progressMonitor.ts — Added getProgressCommentId(): string | null public getter
  • src/backends/adapter.ts — Captures monitor?.getProgressCommentId() in the returned AgentResult
  • src/triggers/shared/agent-execution.ts — Passes agentResult.progressCommentId to lifecycle.handleSuccess
  • src/pm/lifecycle.tshandleSuccess accepts progressCommentId?, uses updateComment+fallback when provided
  • tests/unit/pm/lifecycle.test.ts — Added updateComment mock; new tests for update, fallback, and no-progressCommentId cases
  • tests/unit/triggers/agent-execution.test.ts — Updated test + new test verifying progressCommentId flows to handleSuccess
  • tests/unit/backends/progress.test.ts — New getProgressCommentId() getter tests

Test plan

  • handleSuccess updates comment when progressCommentId provided
  • handleSuccess falls back to addComment when updateComment fails
  • handleSuccess uses addComment when no progressCommentId (backward compat)
  • getProgressCommentId() returns null initially, correct ID after posting
  • progressCommentId flows through pipeline from AgentResult to handleSuccess
  • All 2194 tests passing
  • Lint and typecheck passing

Card: https://trello.com/c/ogyS6225/45-the-pr-created-pm-comment-in-implementation-should-replace-last-pm-progress-comment-if-any-rather-than-always-creating-an-additi

🤖 Generated with Claude Code

@nhopeatall
Copy link
Copy Markdown
Collaborator

🔍 Reviewing PR...

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — Clean implementation that threads progressCommentId through the pipeline to replace progress comments with the final "PR created" message.

Verified:

  • Data flow is correct: ProgressMonitor.getProgressCommentId()adapter.tsagent-execution.tslifecycle.handleSuccess()
  • Backward compatible: all new parameters are optional, existing behavior preserved when progressCommentId is absent
  • Fallback safety: safeUpdateOrAddComment catches updateComment failures and falls back to addComment
  • No race condition: getProgressCommentId() is read after backend.execute() completes (minutes later), well after the initial comment promise resolves
  • All 86 affected tests pass, typecheck clean, CI green
  • updateComment already exists on the PMProvider interface — no new contract needed

@zbigniewsobiecki zbigniewsobiecki merged commit 6a0fef9 into dev Feb 18, 2026
4 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feature/pr-created-replaces-progress-comment branch March 16, 2026 16:43
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.

3 participants