Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

The add_comment handler was hiding older comments when hide-older-comments was enabled, even when the global append-only-comments: true was set in messages config. This created a conflict where campaign workflows configured for append-only timeline behavior would still minimize previous comments.

Changes

  • add_comment.cjs: Check global appendOnlyComments flag from messages config and skip hiding when enabled
  • add_comment.test.cjs: Add test coverage for append-only behavior interaction

Implementation

// Check global messages config during handler initialization
const messagesConfig = getMessages();
const appendOnlyComments = messagesConfig?.appendOnlyComments === true;

// Skip hiding when append-only mode is active
if (hideOlderCommentsEnabled && !appendOnlyComments && workflowId) {
  await hideOlderComments(github, repoParts.owner, repoParts.repo, itemNumber, workflowId, isDiscussion);
} else if (hideOlderCommentsEnabled && appendOnlyComments) {
  core.info("Skipping hide-older-comments because append-only-comments is enabled");
}

The fix ensures campaign workflows using append-only-comments: true maintain a complete comment timeline regardless of individual handler configurations.

Original prompt

Fix add_comment not being added as a new comment even though we used appendCommentOnly in campaign generator, see generated comments on issue: https://github.com/githubnext/gh-aw/issues/11170


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 22, 2026 04:28
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
… config

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix add_comment not added as new comment Fix add_comment to respect append-only-comments from messages config Jan 22, 2026
Copilot AI requested a review from mnkiefer January 22, 2026 04:43
@mnkiefer mnkiefer marked this pull request as ready for review January 22, 2026 04:43
@mnkiefer mnkiefer merged commit 5e024ba into main Jan 22, 2026
49 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-add-comment-issue branch January 22, 2026 04:45
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.

2 participants