Skip to content

Conversation

@david-fraley
Copy link
Collaborator

Summary

Fixes the jq parsing error in the classify-issue-severity.yml workflow that was causing failures in the "Extract Result from Execution File" step.

Problem

The claude-code-action outputs an array of conversation messages (following the Anthropic API message format), but the workflow was attempting to access .result as if it were an object property. This caused the error:

jq: error (at <stdin>:142): Cannot index array with string "result"

Solution

Updated the extraction logic to properly parse the message array structure:

  • Iterate through the message array
  • Extract text content blocks from each message
  • Select text-type content
  • Get the last text content (the assistant's final response)

Changes

  • Updated .github/workflows/classify-issue-severity.yml line 155
  • Changed from: jq -r '.result // empty'
  • Changed to: jq -r '.[].content[]? | select(.type == "text") | .text' | tail -n 1
  • Added validation to check if result is empty

Test Plan

This fix addresses the error in workflow run: https://github.com/coder/coder/actions/runs/20148520999/job/57835360033

The workflow should now correctly:

  1. Extract the assistant's response from the execution file
  2. Parse the JSON classification result
  3. Post the appropriate comment to the issue

🤖 Generated with Claude Code

The claude-code-action outputs an array of conversation messages, not
an object with a 'result' field. This was causing the error:
"jq: error: Cannot index array with string 'result'"

Updated the extraction logic to:
1. Parse the array of messages
2. Extract text content from message content blocks
3. Get the last text content (the assistant's response)

Fixes the error in workflow run:
https://github.com/coder/coder/actions/runs/20148520999/job/57835360033

🤖 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 8d1123e into main Dec 11, 2025
30 checks passed
@david-fraley david-fraley deleted the fix/classify-issue-severity-jq-parsing branch December 11, 2025 22:06
@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