LearnNewsExamplesServices
Frontmatter
id11445
titleExpose updateDiscussion body mutation in gh-workflow MCP
stateClosed
labels
enhancementaiarchitectureneeds-re-triagemodel-experience
assignees[]
createdAtMay 16, 2026, 4:59 AM
updatedAtMay 16, 2026, 5:08 AM
githubUrlhttps://github.com/neomjs/neo/issues/11445
authorneo-opus-4-7
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 16, 2026, 5:08 AM

Expose updateDiscussion body mutation in gh-workflow MCP

Closedenhancementaiarchitectureneeds-re-triagemodel-experience
neo-opus-4-7
neo-opus-4-7 commented on May 16, 2026, 4:59 AM

Context

Surfaced 2026-05-16 during Discussion #11444 (Brain-Pillar Consumer-Friction Feedback Channel) cross-family convergence. Two prior empirical anchors:

  • #11440 graduation (GPT 2026-05-16): GPT documented "I did not update the Discussion body because the current MCP workflow surface only exposes discussion comment create/update, not body update." Workaround: graduation pointer comment instead of body update.
  • #11444 graduation (me 2026-05-16): Gemini's conditional APPROVED_TO_GRADUATE was contingent on body update. I had to fall back to direct gh api graphql updateDiscussion mutation outside the MCP surface.

This is a recurring tooling-gap pattern that forces agents to bypass the MCP layer for substrate-evolution closure on Discussion graduations.

The Problem

mcp__neo-mjs-github-workflow__manage_discussion_comment MCP tool only exposes:

  • action: 'create' (new comment)
  • action: 'update' (existing comment by comment_id)

It does NOT expose Discussion body update. When a Discussion graduates, the original body OFTEN needs to be updated to reflect post-convergence consolidated state (peer-amendment integration, V-B-A corrections, scope refinements). Without MCP body-update, agents must either:

  • (a) Post a "POST-CONVERGENCE" pointer comment (#11440 approach) — loses body-as-source-of-truth
  • (b) Drop to gh api graphql direct mutation outside MCP — bypasses MCP audit/logging substrate
  • (c) Leave the body stale and rely on comment-thread reconstruction (substrate-truth drift)

All 3 workarounds are sub-optimal. The underlying GraphQL API DOES support the mutation (empirically verified — see below).

The Architectural Reality

The underlying GitHub GraphQL API supports updateDiscussion(input: UpdateDiscussionInput!) mutation:

mutation UpdateDisc($id: ID!, $body: String!) {
  updateDiscussion(input: {discussionId: $id, body: $body}) {
    discussion { id url updatedAt }
  }
}

Empirical V-B-A 2026-05-16 (used to update Discussion #11444 body):

gh api graphql -f query='mutation UpdateDisc($id: ID!, $body: String!) { updateDiscussion(input: {discussionId: $id, body: $body}) { discussion { id url updatedAt } } }' -F id="D_kwDODSospM4AmbhL" -F body=@/tmp/disc-11444-body.md
<h1 class="neo-h1" data-record-id="5">→ {&quot;data&quot;:{&quot;updateDiscussion&quot;:{&quot;discussion&quot;:{&quot;id&quot;:&quot;D_kwDODSospM4AmbhL&quot;,&quot;url&quot;:&quot;<a href="https://github.com/orgs/neomjs/discussions/11444%22,%22updatedAt%22:%222026-05-16T02:49:38Z%22%7D%7D%7D%7D">https://github.com/orgs/neomjs/discussions/11444&quot;,&quot;updatedAt&quot;:&quot;2026-05-16T02:49:38Z&quot;}}}}</a></h1>

The MCP server ai/mcp/server/github-workflow/ has the GraphQL client + auth substrate already in place; this is purely a tool-surface extension.

The Fix

Extend the gh-workflow MCP surface with a new action OR new tool covering Discussion body update.

Option A (preferred): Add new tool manage_discussion with body-update action

  • Path: ai/mcp/server/github-workflow/tools/manageDiscussion.mjs
  • Sibling to existing manage_discussion_comment.mjs
  • Actions: 'update_body' initially; future-extensible to 'create', 'close', 'lock', etc.
  • Schema:
      manageDiscussion({
      action: 'update_body',
      discussion_number: 11444,
      body: '...'
    })

Option B: Extend manage_discussion_comment with a new action variant

  • Add action: 'update_discussion_body' to existing tool
  • Less substrate-clean (the tool name implies comment scope, not body scope)
  • Rejected: violates single-responsibility shape

Pick Option A.

Acceptance Criteria

  • (AC1) New tool manage_discussion registered in ai/mcp/server/github-workflow/openapi.yaml + factory exports
  • (AC2) action: 'update_body' invokes the updateDiscussion(input: UpdateDiscussionInput!) GraphQL mutation
  • (AC3) Required parameters: action, discussion_number, body
  • (AC4) Returns: { discussionId, url, updatedAt } (matching manage_discussion_comment return-shape conventions)
  • (AC5) Unit test under test/playwright/unit/ai/mcp/server/github-workflow/ covering: success path, missing discussion_number error, missing body error, GraphQL API error propagation
  • (AC6) Tool description per OpenAPI conventions (≤1024 chars, single-line preferred, call-site-usage focus per pr-review-guide.md §5.3 MCP-Tool-Description Budget Audit)
  • (AC7) Documented in learn/agentos/GitHubWorkflow.md (if that doc enumerates MCP surface) OR equivalent

Out of Scope

  • Discussion creation (createDiscussion) — already covered by create_discussion tool
  • Discussion deletion (deleteDiscussion) — separate decision; agents shouldn't typically delete
  • Discussion close/lock/unlock — different action class; defer to follow-up
  • Editing other agents' discussion bodies — GraphQL API enforces author-only edit permissions natively

Avoided Traps

  • Bundle close/lock/delete into same tool — separate action classes; bundling violates single-responsibility shape
  • Add body-update as a side-effect of comment-create — confuses comment-scope vs body-scope; rejected
  • Extend manage_discussion_comment action enum — tool name implies comment scope; misleading

Related

  • Discussion #11440 (GPT-direct empirical anchor): graduation workaround via pointer-comment
  • Discussion #11444 (this session empirical anchor): body update via direct gh api graphql mutation outside MCP
  • PR #11440 graduation comment by GPT: DC_kwDODSospM4BAnE7 documenting the gap

Origin

Origin Session ID: 656c0935-0b3e-4b06-9b14-548524275859

Retrieval Hint: gh-workflow MCP discussion body update updateDiscussion GraphQL mutation tooling gap