---
id: 10304
title: Enrich manage_discussion_comment with Comment-ID hand-off protocol
state: CLOSED
labels:
  - enhancement
  - ai
  - architecture
assignees:
  - neo-gpt
createdAt: '2026-04-24T17:37:27Z'
updatedAt: '2026-06-05T01:47:11Z'
githubUrl: 'https://github.com/neomjs/neo/issues/10304'
author: neo-gemini-pro
commentsCount: 1
parentIssue: null
subIssues: []
subIssuesCompleted: 0
subIssuesTotal: 0
blockedBy: []
blocking: []
closedAt: '2026-06-05T01:47:11Z'
---
# Enrich manage_discussion_comment with Comment-ID hand-off protocol

## Context

We implemented the A2A Comment-ID Hand-off Protocol for issues and PRs in #10272 / PR #10287. Ideation Sandbox Discussions can also grow long over multiple review cycles, so Discussion comments need the same linear-cost handoff shape.

## Current State (2026-06-03 V-B-A)

- `manage_discussion_comment` already returns `commentId`, `url`, and `createdAt` on create, plus `commentId`, `url`, and `updatedAt` on update. That slice was delivered by #10841 / PR #10891.
- `get_conversation` supports `comment_id`, `since_comment_id`, and `last_n` selectors for Issues and Pull Requests only.
- No `get_discussion_conversation` or equivalent Discussion selective-fetch read tool exists in the GitHub Workflow MCP surface.
- `ideation-sandbox` discussion cycles currently still rely on full Discussion context or raw GraphQL/local artifacts, so the N^2 fetch problem remains for long design threads.

## Problem

The remaining gap is Discussion-domain selective fetch. A2A messages can carry a Discussion commentId, but there is no agent-callable read tool that fetches only that comment or the comments after it.

## Contract Ledger Matrix

| Target Surface | Source of Authority | Proposed Behavior | Fallback / Edge Case | Docs | Evidence |
|---|---|---|---|---|---|
| `manage_discussion_comment` return payload | #10841 / PR #10891; current `DiscussionService.manageDiscussionComment()` | Already returns `commentId` + URL + timestamp. No new implementation required for this row. | Update path returns `updatedAt`, not `createdAt`; callers should treat timestamp field according to action. | `GitHubWorkflow.md`, OpenAPI if wording is stale | Source inspection + focused existing tests if touched |
| New Discussion selective-fetch tool | #10304; issue/PR `get_conversation` selector contract | Add `get_discussion_conversation({discussion_number, comment_id?, since_comment_id?, last_n?})` or an equivalent MCP read surface. Selector precedence mirrors issues/PRs: `comment_id > since_comment_id > last_n > full`. | Unknown `comment_id` returns empty comments; unknown `since_comment_id` returns empty comments; invalid or missing `discussion_number` returns structured error; full fetch remains the cold-cache fallback. | OpenAPI + `GitHubWorkflow.md`; `ideation-sandbox` handoff guidance if changed | Unit coverage for selector precedence and structured errors |
| Discussion comment shape | GitHub Discussion GraphQL schema + existing sync query conventions | Returned discussion includes title/body/author/category metadata plus filtered `comments.nodes`; comment nodes include `id`, `author.login`, `body`, `createdAt`, `isAnswer`, and replies if included by the existing query shape. | Replies remain nested under the returned parent comment; no separate reply selector in this ticket. | OpenAPI schema / docs | Service test with representative GraphQL fixture |
| Ideation Sandbox handoff usage | `ideation-sandbox` workflow + A2A commentId handoff precedent from `pr-review` | Long Discussion cycles can pass `commentId` via A2A so peers fetch only the new Discussion comment when warm-cache context exists. | Fresh/cold-cache reviewers still fetch broader context before evaluating a single isolated comment. | `ideation-sandbox` docs; optional cross-reference to `pr-review` warm-vs-cold discipline | Docs grep + review evidence |

## Acceptance Criteria

- [x] `manage_discussion_comment` returns `commentId` and timestamp metadata. Delivered by #10841 / PR #10891; no new code required.
- [ ] A Discussion selective-fetch read tool exists with `comment_id`, `since_comment_id`, and `last_n` selectors.
- [ ] Selector precedence and fallback semantics match issue/PR `get_conversation` behavior.
- [ ] OpenAPI/tool documentation names the Discussion selector contract.
- [ ] `ideation-sandbox` guidance documents commentId handoff for warm-cache Discussion cycles, with cold-cache fallback.
- [ ] Focused tests cover the service/router selector behavior.

## Related

- #10272 / PR #10287 — issue/PR comment-ID return + selective fetch.
- #10841 / PR #10891 — Discussion commentId return payload.
- #10376 / PR #10377 — A2A commentId handoff discipline; adjacent but does not close this Discussion-domain read-tool gap.

Origin Session ID: 0b29a8fa-c6b0-42e2-ab3b-8015a99db2d8

## Timeline

- 2026-04-24T17:37:28Z @neo-gemini-pro added the `enhancement` label
- 2026-04-24T17:37:28Z @neo-gemini-pro added the `ai` label
- 2026-04-26T14:30:07Z @neo-opus-ada cross-referenced by #10376
- 2026-04-26T14:35:44Z @neo-opus-ada cross-referenced by PR #10377
### @neo-gpt - 2026-06-03T00:57:59Z

**Input from GPT-5 (Codex Desktop):**

> ● [ARCH_ALIGNMENT] Ticket-intake verdict: `needs-contract-alignment`, not safe to self-assign yet.
> 
> V-B-A checks run before this classification:
> - Live issue body/comment thread fetched from GitHub: no Contract Ledger matrix is present, and there are no clarifying comments.
> - Current source shows `DiscussionService.manageDiscussionComment()` already returns `commentId`/`createdAt` on create and `commentId`/`updatedAt` on update (`ai/services/github-workflow/DiscussionService.mjs`).
> - Current OpenAPI/docs expose `manage_discussion_comment`, but there is no discussion-conversation selective-fetch tool equivalent to `get_conversation({comment_id|since_comment_id|last_n})`.
> - Successor sweep found PR #10377, but that PR explicitly scoped itself to PR/issue hand-off discipline and lists #10304 as adjacent/out-of-scope, so it does not close this ticket.
> 
> Because this ticket proposes an agent-consumed MCP contract, `learn/agentos/contract-ledger.md` makes T3 Contract Ledger coverage the intake prerequisite. The remaining implementation may still be worthwhile, but the issue body needs an explicit matrix naming the target surface(s), source of authority, exact selector precedence/fallback behavior, docs surfaces, and evidence plan before a branch is opened. I am applying `needs-re-triage` as the available label proxy for this contract-alignment state and leaving the ticket open.

- 2026-06-03T00:58:11Z @neo-gpt added the `needs-re-triage` label
- 2026-06-03T07:46:00Z @neo-gpt removed the `needs-re-triage` label
- 2026-06-04T22:34:41Z @neo-gpt added the `architecture` label
- 2026-06-04T22:34:51Z @neo-gpt assigned to @neo-gpt
- 2026-06-04T22:45:57Z @neo-gpt cross-referenced by PR #12552
- 2026-06-05T01:47:11Z @tobiu closed this issue
- 2026-06-05T01:47:11Z @tobiu referenced in commit `2938379` - "feat(github-workflow): add discussion selective fetch (#10304) (#12552)

Co-authored-by: tobiu <tobiasuhlig78@gmail.com>"

