Skip to content

Conversation

@david-fraley
Copy link
Collaborator

Summary

Fixes the claude-code-action failure by simplifying the JSON schema that was too complex.

Problem

The previous fix (#21240) used a JSON schema with allOf conditionals, if/then logic, and enum constraints. This complex schema likely caused the claude-code-action to fail during the "Analyze Issue Severity" step.

Error from run: https://github.com/coder/coder/actions/runs/20149538756

Solution

Simplified the JSON schema to match patterns used in claude-code-action's test workflows:

  1. Removed complex conditionals

    • No more allOf, if/then, or const checks
    • Removed enum constraints for status and severity
  2. Simplified to basic schema

    • Only require: status and reasoning
    • Keep severity and next_steps as optional fields
    • Validation of values happens in the downstream parsing step
  3. Improved formatting

    • Changed claude_args from single-line to multi-line with |
    • Better readability and avoids potential YAML escaping issues

Schema Comparison

Before (complex):

{
  "allOf": [
    {
      "if": {"properties": {"status": {"const": "classified"}}},
      "then": {"required": ["severity"]}
    },
    ...
  ],
  "enum": ["classified", "insufficient_info"],
  ...
}

After (simple):

{
  "type": "object",
  "properties": {
    "status": {"type": "string"},
    "severity": {"type": "string"},
    "reasoning": {"type": "string"},
    "next_steps": {"type": "array", "items": {"type": "string"}}
  },
  "required": ["status", "reasoning"]
}

References

Supersedes

🤖 Generated with Claude Code

The previous JSON schema was too complex with allOf conditionals,
which likely caused the claude-code-action to fail.

Changes:
1. Simplified JSON schema - removed allOf, if/then conditions, and
   enum constraints
2. Changed claude_args to multi-line format for better readability
   and to avoid potential escaping issues
3. Keep only required fields: status and reasoning
4. Make severity and next_steps optional (validated in later step)

The schema now matches the simpler patterns used in claude-code-action
test workflows, which should be more reliable.

Fixes workflow run: https://github.com/coder/coder/actions/runs/20149538756

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@david-fraley david-fraley merged commit 8249ac8 into main Dec 11, 2025
30 checks passed
@david-fraley david-fraley deleted the fix/classify-issue-severity-simplify-schema branch December 11, 2025 22:47
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants