Skip to content

feat(github): replace hardcoded agent messages with LLM-generated ack messages#490

Merged
zbigniewsobiecki merged 1 commit intodevfrom
feat/llm-ack-github-agents
Feb 22, 2026
Merged

feat(github): replace hardcoded agent messages with LLM-generated ack messages#490
zbigniewsobiecki merged 1 commit intodevfrom
feat/llm-ack-github-agents

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Unify initial GitHub comments: LLM-generated ack messages (from generateAckMessage()) are now THE initial comment for all GitHub agents, eliminating duplicate comments in router+worker mode
  • Plumb ackMessage through the entire pipeline: queue → worker → webhook handler → agent execution, alongside the existing ackCommentId
  • Expand ack posting to all GitHub agents: postAcknowledgmentComment() now handles review, respond-to-ci, etc. — not just respond-to-review/respond-to-pr-comment
  • Reuse pre-existing ack comments: When ackCommentId is present, agents skip posting a new comment and instead record the existing one for progress updates
  • Remove hardcoded headerMessage from all 4 GitHub agent definitions; INITIAL_MESSAGES serves as the static fallback
  • Simplify PRResponseAgentInput: removed acknowledgmentCommentId field (unified to ackCommentId on AgentInput)

Files changed (19)

Area Files Change
Types src/types/index.ts, src/router/queue.ts Add ackMessage field
Router src/router/github.ts tryPostGitHubAck returns { commentId, message }
Worker src/worker-entry.ts Pass ackMessage through
Queue src/utils/webhookQueue.ts, src/triggers/shared/webhook-queue.ts Forward ackMessage
Webhook handler src/triggers/github/webhook-handler.ts Expand ack to all agents with generateAckMessage()
Agent core src/agents/shared/githubAgent.ts Reuse ack comment, resolve effective header
PR response src/agents/shared/prResponseAgent.ts Remove acknowledgmentCommentId
Agent defs src/agents/review.ts, respond-to-review.ts, respond-to-pr-comment.ts, respond-to-ci.ts Remove headerMessage
Claude Code src/backends/agent-profiles.ts preExecute skips when ack exists, uses ackMessage
Tests 5 test files 14 new tests, updated assertions

Test plan

  • npm run typecheck — clean
  • npm run lint — clean (only 1 pre-existing warning)
  • npm test — all 2614 tests pass (14 new)
  • New tests cover: tryPostGitHubAck return type, ack message on queued jobs, preExecute skip when ack exists, preExecute uses ackMessage fallback, ackMessage queue forwarding
  • Manual verification: trigger a review agent via webhook → verify single LLM-generated comment (not two)

🤖 Generated with Claude Code

… messages

GitHub agents had hardcoded initial messages in three places: headerMessage
in agent definitions, preExecute in Claude Code profiles, and
postAcknowledgmentComment in the webhook handler. Meanwhile, the router
already had a working LLM ack mechanism that generated contextual messages.
In router+worker mode this created duplicate comments — one LLM-generated
ack from the router, then a second hardcoded one from the agent.

This change makes the LLM-generated ack the single initial message for all
GitHub agents by plumbing ackMessage through the entire pipeline (queue,
worker, webhook handler, agent execution) and teaching agents to reuse
pre-existing ack comments instead of posting new ones.

Key changes:
- Add ackMessage field to AgentInput, GitHubJob, and webhook queue
- tryPostGitHubAck now returns { commentId, message } instead of just number
- postAcknowledgmentComment handles all GitHub agent types (not just
  respond-to-review/respond-to-pr-comment) using generateAckMessage()
- executeGitHubAgent resolves effective header: ackMessage > INITIAL_MESSAGES
  > definition.headerMessage, and reuses ack comment when ackCommentId exists
- Remove hardcoded headerMessage from review, respond-to-review,
  respond-to-pr-comment, respond-to-ci agent definitions
- Claude Code profile preExecute hooks skip when ackCommentId exists
- Remove acknowledgmentCommentId from PRResponseAgentInput (unified to
  ackCommentId on AgentInput)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 0743e5d into dev Feb 22, 2026
5 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the feat/llm-ack-github-agents branch February 22, 2026 18:47
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