Fix missing_tool schema inconsistency - make tool field optional#12165
Merged
Fix missing_tool schema inconsistency - make tool field optional#12165
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix schema inconsistency for missing_tool validation
Fix missing_tool schema inconsistency - make tool field optional
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
missing_toolsafe output tool had mismatched schemas: the tool description (safe_outputs_tools.json) markedtoolas optional, but the validation schema (safe_output_validation_config.go) required it. This would cause validation failures for agents correctly following the tool description.Changes
toolfield fromRequired: truetoRequired: falseinValidationConfig["missing_tool"]TestMissingToolFieldOptionalto verify field requirementsBoth schemas now agree: only
reasonis required,toolandalternativesare optional.Original prompt
This section details on the original issue you should resolve
<issue_title>[safeoutputs] Fix schema inconsistency in missing_tool - 'tool' field marked optional in description but required in validation</issue_title>
<issue_description>### Summary
Analysis of safe output tool schemas identified a schema inconsistency in the
missing_tooltool where thetoolfield is marked as optional in the tool description but required in the validation schema. This discrepancy could cause agents to correctly follow the tool description (omitting the optionaltoolfield) but then fail validation.While no actual errors were found in the last 24 hours (the
missing_tooltool was not used), this inconsistency represents a latent bug that could cause future agent failures.Schema Inconsistency Details
Tool Description (pkg/workflow/js/safe_outputs_tools.json)
Line 678-700:
{ "name": "missing_tool", "description": "Report that a tool or capability needed to complete the task is not available...", "inputSchema": { "type": "object", "required": [ "reason" ], "properties": { "tool": { "type": "string", "description": "Optional: Name or description of the missing tool or capability..." }, "reason": { "type": "string", "description": "Explanation of why this tool is needed..." }, "alternatives": { "type": "string", "description": "Any workarounds, manual steps, or alternative approaches..." } } } }Key points:
reason]tool,alternatives]Validation Schema (/opt/gh-aw/safeoutputs/validation.json)
Line 35-55:
{ "missing_tool": { "defaultMax": 20, "fields": { "alternatives": { "type": "string", "sanitize": true, "maxLength": 512 }, "reason": { "required": true, "type": "string", "sanitize": true, "maxLength": 256 }, "tool": { "required": true, "type": "string", "sanitize": true, "maxLength": 128 } } } }Key points:
reason,tool]toolfield has"required": trueRoot Cause Analysis
The inconsistency exists because:
Tool Description Intent: The tool description was designed to make
tooloptional, recognizing that agents might want to report general limitations without specifying a specific tool name (e.g., "The data needed for this analysis is not available in any tool")Validation Schema Mismatch: The validation schema marks
toolas required, likely from an earlier design where it was always expectedNo Runtime Errors Yet: The tool hasn't been used in the analyzed period, so this inconsistency hasn't caused actual failures
Impact Assessment
Current Impact: None (0 uses in last 24 hours)
Potential Future Impact: High
toolis optional{"reason": "Missing data for analysis"}toolis requiredRecommended Fix
Choose one of two approaches:
Option 1: Make 'tool' Truly Optional (Recommended)
Update
/opt/gh-aw/safeoutputs/validation.jsonto match the tool description:{ "missing_tool": { "defaultMax": 20, "fields": { "alternatives": { "type": "string", "sanitize": true, "maxLength": 512 }, "reason": { "required": true, "type": "string", "sanitize": true, "maxLength": 256 }, "tool": { "required": false, // Changed from true "type": "string", "sanitize": true, "maxLength": 128 } } } }Rationale: The tool description makes a strong case for optionality. Many scenarios exist where an agent needs to report a limitation without specifying a specific tool name.
Option 2: Make 'tool' Required in Both Schemas
Update
pkg/workflow/js/safe_outputs_tools.jsonto require thetoolfield:{ "name": "missing_tool", "inputSchema": { "type": "object", "required": [ "reason", "tool" // Add this ], "properties": { "tool": { "type": "string", "description": "Name or description of the missing tool or capability..." // Remove "Optional:" }, ... } } }Rationale: If every missing tool report should identify a specific tool, making it required enforces this constraint.
Testing Plan
After fixing the schema inconsistency:
# Compare required fields cat pkg/wor...✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.