Skip to content

feat(agents): answer planning questions without unnecessary plan edits#479

Merged
zbigniewsobiecki merged 1 commit intodevfrom
refactor/planning-comment-question-handling
Feb 22, 2026
Merged

feat(agents): answer planning questions without unnecessary plan edits#479
zbigniewsobiecki merged 1 commit intodevfrom
refactor/planning-comment-question-handling

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Teach respond-to-planning-comment agent to classify comments as questions, plan updates, or both — and act accordingly
  • Questions ("Why this approach?", "Can you explain step 3?") now get a PostComment reply only, without wasteful UpdateWorkItem calls
  • Plan update requests preserve existing behavior (update + summary comment)
  • Mixed comments (question + change request) do both
  • Mirrors the proven pattern from respond-to-pr-comment / buildPRCommentResponsePrompt

Changes

  • src/agents/prompts/templates/respond-to-planning-comment.eta — Add Comment Classification section (Category A/B/C), branching task flow, dual response format, updated rules
  • src/agents/shared/taskPrompts.ts — Update buildCommentResponsePrompt with classification instruction
  • tests/unit/agents/prompts.test.ts — Add 5 tests for template rendering of new classification sections
  • tests/unit/agents/shared/taskPrompts.test.ts — Add 3 tests for new classification, question-only, and ambiguous-default behavior

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • Full test suite (2514 tests) passes
  • CI checks pass

🤖 Generated with Claude Code

…ithout plan edits

The planning comment agent previously assumed every comment required plan
modifications, wasting iterations on unnecessary UpdateWorkItem calls when
users just asked questions like "Why this approach?" or "Can you explain
step 3?". Mirror the pattern from respond-to-pr-comment: classify the
comment as a question (PostComment only), a plan update (existing behavior),
or both, and act accordingly.

- Add Comment Classification section (Category A/B/C) to the prompt template
- Soften CRITICAL rules: "ONLY job" → "primary role", remove unconditional
  UpdateWorkItem mandate
- Add branching task flow: questions get PostComment-only, updates get plan
  edits + summary, mixed gets both
- Add question-only response format ("Re: [topic]") alongside existing
  "Plan Updated" format
- Update taskPrompts.ts buildCommentResponsePrompt with classification
  instruction matching buildPRCommentResponsePrompt pattern
- Add tests for new classification behavior and template rendering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 340080b into dev Feb 22, 2026
5 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the refactor/planning-comment-question-handling branch February 22, 2026 15:34
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