Skip to content

archon-fix-github-issue fails in fetch-issue when issue number output is shell-quoted #1377

@flsteven87

Description

@flsteven87

Summary

Hi Archon maintainers, thank you for the excellent work on making AI coding workflows deterministic and repeatable. While testing the GitHub issue workflow, I ran into a failure in the bundled archon-fix-github-issue workflow.

The workflow can fail in the fetch-issue bash node when the upstream extract-issue-number node returns the issue number wrapped in quotes, for example '4' instead of 4.

Environment

  • Archon CLI: v0.3.9
  • Platform: Windows / PowerShell, with bash available
  • Trigger path: GitHub issue comment webhook
  • Workflow: archon-fix-github-issue

Reproduction

  1. Start the Archon server with GitHub webhook support enabled.

  2. On a GitHub issue, comment:

    @archon /workflow run archon-fix-github-issue #4
    
  3. The workflow starts successfully.

  4. The first node, extract-issue-number, outputs the issue number as '4'.

  5. The next node, fetch-issue, fails before it can call gh issue view.

Observed Error

Bash node 'fetch-issue' failed: Command failed: bash -c # Strip quotes, whitespace, markdown backticks from AI output
ISSUE_NUM=$(echo "'4'" | tr -d "'\"\`\n " | grep -oE '[0-9]+' | head -1)
if [ -z "$ISSUE_NUM" ]; then
  echo "Failed to extract issue number from: '4'" >&2
  exit 1
fi
gh issue view "$ISSUE_NUM" --json title,body,labels,comments,state,url,author
/bin/bash: -c: line 4: unexpected EOF while looking for matching `''

The workflow then skips all downstream nodes and reports failure.

Expected Behavior

archon-fix-github-issue should robustly extract the numeric issue id and continue to gh issue view, even if the AI output is slightly formatted as '4', "4", #4, or includes surrounding whitespace/markdown.

Suspected Cause

The bash node currently does:

ISSUE_NUM=$(echo "$extract-issue-number.output" | tr -d "'\"\`\n " | grep -oE '[0-9]+' | head -1)

However, bash-node substitution appears to shell-quote upstream node output before embedding it in the script. That is generally good for safety, but in this workflow the substituted value is also placed inside double quotes and then passed through quote-stripping logic. When the upstream output is '4', the generated shell script can become syntactically invalid.

Relevant local code paths I inspected:

  • .archon/workflows/defaults/archon-fix-github-issue.yaml, fetch-issue node
  • packages/workflows/src/dag-executor.ts, shellQuote() / substituteNodeOutputRefs(..., escapedForBash = true) / bash node execution

Possible Fix Direction

One minimal workflow-level fix may be to avoid double-quoting the substituted node output and simply extract digits from the shell-quoted value, for example:

ISSUE_NUM=$(printf '%s\n' $extract-issue-number.output | grep -oE '[0-9]+' | head -1)

Or, more robustly, make extract-issue-number return structured JSON and reference a typed field downstream, so the bash node receives a predictable scalar.

Why This Matters

This is currently a blocker for using the GitHub issue-to-PR workflow as a reliable IssueOps pipeline. A small formatting deviation from the AI node causes the deterministic bash step to fail before any codebase investigation or implementation can happen.

Thanks again for the project. Happy to provide more logs or test a patch if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority - Backlog, when time permitsarea: workflowsWorkflow enginebugSomething is brokeneffort/lowSingle file or function, one responsibility, isolated change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions