Skip to content

Fix update_issue schema compatibility with Anthropic - #66784

Merged
pelikhan merged 2 commits into
mainfrom
pelikhan-update-issue-schema
Oct 8, 2026
Merged

pelikhan merged 2 commits into
mainfrom
pelikhan-update-issue-schema

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Anthropic rejects update_issue during tool registration because its input schema contains a top-level anyOf. Remove that unsupported composition keyword from both the runtime and embedded schemas, and describe the update-field requirement in the tool guidance.

Preserve immediate validation in the MCP handler: calls must include at least one update field before an output is recorded. Reuse blank-optional-field normalization while preserving empty-body and empty-list updates. Add generated-schema and handler regression coverage, and document the requirement.

Validation

  • Reproduced the original schema compatibility failure and confirmed it passes after the fix.
  • Related JavaScript suites: 484 passed, with two confirmed baseline failures excluded.
  • Passed JavaScript type checking, make fmt-cjs, make lint-cjs, the Go build, and go test ./pkg/workflow -run 'TestSafeOutputsTools' -count=1.
  • make agent-report-progress remains blocked by two unrelated macOS failures in safe_outputs_handlers.test.cjs: the /etc system-directory assertion and eligible-JSON custom validation. Both reproduce on the unchanged baseline.

Remove the unsupported top-level anyOf from both tool schema copies and enforce update-field requirements in the MCP handler. Add runtime and generated-schema regression coverage and document the requirement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 8, 2026 05:04
Copilot AI balanced review requested due to automatic review settings October 8, 2026 05:04
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed for PR #66784: the PR does not carry the implementation label (has_implementation_label=false) and adds only 1 line in default business logic directories, well under the 100-line threshold (requires_adr_by_default_volume=false). No custom .design-gate.yml config is present.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #66784

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The existing blank-field Go conformance test still expects schema-level rejection and now fails.

1 open finding
What changed in this PR

Makes update_issue schemas Anthropic-compatible while retaining runtime update-field validation.

Changes:

  • Removes the top-level anyOf requirement from both schema copies.
  • Adds handler validation and regression coverage for updates and explicit clears.
  • Documents required update fields.
File Description
pkg/​workflow/​js/​safe_outputs_tools.json Updates the embedded schema.
docs/​src/​content/​docs/​reference/​safe-outputs.md Documents required update fields.
actions/​setup/​js/​safe_outputs_tools.json Updates the runtime schema.
actions/​setup/​js/​safe_outputs_handlers.test.cjs Tests handler validation.
actions/​setup/​js/​safe_outputs_handlers.cjs Enforces update-field presence.
actions/​setup/​js/​generate_safe_outputs_tools.test.cjs Tests generated schema compatibility.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread actions/setup/js/generate_safe_outputs_tools.test.cjs
@github-actions github-actions Bot mentioned this pull request Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-08T05:07:39.082+00:00
review_event: REQUEST_CHANGES
top_themes:
  - update_issue contract mismatch for milestone null clears
files_reviewed:
  - actions/setup/js/generate_safe_outputs_tools.test.cjs
  - actions/setup/js/safe_outputs_handlers.cjs
  - actions/setup/js/safe_outputs_handlers.test.cjs
  - actions/setup/js/safe_outputs_tools.json
  - docs/src/content/docs/reference/safe-outputs.md
  - pkg/workflow/js/safe_outputs_tools.json
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 55.4 AIC · ⌖ 5.45 AIC · ⊞ 19.8K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes

This removes the top-level anyOf, but it also cements a contradictory update_issue contract: the tool description still says milestone: null clears the milestone, while the new handler/tests reject that payload before it can be recorded.

Blocking theme

The change needs to make the milestone-clear path consistent end to end. Either preserve explicit milestone: null updates through validation/execution, or remove the Use null to clear contract from the schema and docs in the same PR. Shipping both behaviors at once guarantees that schema-driven clients will hit a handler-side -32602 for a documented operation.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 55.4 AIC · ⌖ 5.45 AIC · ⊞ 19.8K
Comment /review to run again

Comment thread actions/setup/js/safe_outputs_handlers.cjs

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs — requesting changes: the new update-field guard has a documented-clear regression for milestone.

📋 Key Themes & Highlights

Key Themes

  • Milestone clear regression: safe_outputs_tools.json documents milestone: null as "Use null to clear", but the new updateFields.some(...) guard in safe_outputs_handlers.cjs (line 3016) treats null as "not supplied" for every field, including milestone. A caller intending to clear only the milestone now gets a -32602 validation error instead of the clear being applied. The PR's own test suite (safe_outputs_handlers.test.cjs line 4223) bakes this in as expected — { milestone: null } is asserted to be rejected rather than accepted and forwarded.
  • The anyOf → MCP-handler validation migration itself is sound and well-targeted: it fixes real Anthropic tool-registration incompatibility, keeps additionalProperties: false, and reuses normalizeBlankOptionalFields consistently with other handlers.
  • Test coverage for the new guard is good and uses clear parametrized cases, which made the milestone regression straightforward to pinpoint — just needs one edge case corrected.

Positive Highlights

  • ✅ Clean, minimal schema diff — only the unsupported anyOf keyword removed, nothing else disturbed.
  • ✅ Tool description updated in the same commit so the agent-facing guidance reflects the new validation requirement.
  • ✅ Docs (safe-outputs.md) updated alongside the code change.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 152 AIC · ⌖ 13.5 AIC · ⊞ 10.1K
Comment /matt to run again

Comment thread actions/setup/js/safe_outputs_handlers.cjs Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impeccable Review Summary (mode: harden)

One blocking issue found in the new update_issue required-field guard.

  • milestone: null incorrectly rejected — the schema documents null as the way to clear a milestone, and the downstream requiresOneOf validator treats null as present. The new MCP-layer pre-check excludes null too, silently blocking the documented clear-milestone flow. See inline comment.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 145.5 AIC · ⌖ 13.1 AIC · ⊞ 8.1K

Comment thread actions/setup/js/safe_outputs_handlers.cjs Outdated
…MCP handler

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan merged commit eaab108 into main Oct 8, 2026
73 of 74 checks passed
@pelikhan
pelikhan deleted the pelikhan-update-issue-schema branch October 8, 2026 05:29
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.6

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