Skip to content

Fix Claude API rejection of safe_outputs tools with top-level oneOf constraints#10698

Merged
pelikhan merged 6 commits intomainfrom
copilot/investigate-failed-campaign-generation
Jan 19, 2026
Merged

Fix Claude API rejection of safe_outputs tools with top-level oneOf constraints#10698
pelikhan merged 6 commits intomainfrom
copilot/investigate-failed-campaign-generation

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Campaign generation workflow failed with Claude API error: input_schema does not support oneOf, allOf, or anyOf at the top level. Two MCP tools (assign_to_agent, update_project) used top-level oneOf for conditional field requirements.

Changes

Removed top-level oneOf constraints from tool schemas:

  • assign_to_agent: Removed oneOf requiring either issue_number or pull_number. Both fields now optional; validation documented in descriptions.
  • update_project: Removed oneOf for conditional requirements based on content_type. Required fields simplified to ["project", "content_type"]; conditional requirements documented in field descriptions.

Added regression test:

  • TestNoTopLevelOneOfAllOfAnyOf in pkg/workflow/safe_outputs_tools_schema_test.go validates that all 31 safe output tools comply with the constraint. Test acts as a compiler sanity check to prevent this bug from reoccurring.

Before:

{
  "name": "assign_to_agent",
  "inputSchema": {
    "properties": {
      "issue_number": {"type": ["number", "string"]},
      "pull_number": {"type": ["number", "string"]}
    },
    "oneOf": [
      {"required": ["issue_number"]},
      {"required": ["pull_number"]}
    ]
  }
}

After:

{
  "name": "assign_to_agent",
  "inputSchema": {
    "properties": {
      "issue_number": {
        "type": ["number", "string"],
        "description": "... Either issue_number or pull_number must be provided, but not both."
      },
      "pull_number": {
        "type": ["number", "string"],
        "description": "... Either issue_number or pull_number must be provided, but not both."
      }
    }
  }
}

Updated both pkg/workflow/js/safe_outputs_tools.json and actions/setup/js/safe_outputs_tools.json. Runtime validation handles constraints previously enforced by schema.

Original prompt

Investigate failed campaign generation run
https://github.com/githubnext/gh-aw/actions/runs/21142123455/job/60798581325


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 19, 2026 15:11
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate failed campaign generation run Fix Claude API rejection of safe_outputs tools with top-level oneOf constraints Jan 19, 2026
Copilot AI requested a review from mnkiefer January 19, 2026 15:29
@mnkiefer mnkiefer marked this pull request as ready for review January 19, 2026 15:38
@pelikhan
Copy link
Contributor

@copilot add sanity check validation in compiler to ensure the bug is not reoccurring

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 19, 2026

@copilot add sanity check validation in compiler to ensure the bug is not reoccurring

Added TestNoTopLevelOneOfAllOfAnyOf regression test in pkg/workflow/safe_outputs_tools_schema_test.go. The test validates all 31 safe output tools to ensure none have oneOf, allOf, or anyOf at the top level of their inputSchema. Test successfully catches violations with clear error messages referencing the original incident. (7371826)

Copilot AI requested a review from pelikhan January 19, 2026 15:48
@pelikhan pelikhan merged commit 477f12f into main Jan 19, 2026
@pelikhan pelikhan deleted the copilot/investigate-failed-campaign-generation branch January 19, 2026 15:54
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.

3 participants