Skip to content

Harden APP discussion bot Copilot parse path against token/model failures - #44

Closed
LionSR with Copilot wants to merge 1 commit into
mainfrom
copilot/discussion-36-copilot-cli-error-handling
Closed

Harden APP discussion bot Copilot parse path against token/model failures#44
LionSR with Copilot wants to merge 1 commit into
mainfrom
copilot/discussion-36-copilot-cli-error-handling

Conversation

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The APP discussion bot intermittently failed in actions/ai-inference@v3 after invoking Copilot CLI (copilot -p ...), with the parse step exiting non-zero. This change reduces hard failures in the inference path while preserving the existing fallback behavior.

  • Inference-step gating on credential availability

    • Run Copilot-dependent steps only when COPILOT_PAT is configured.
    • Prevents unnecessary CLI invocation in environments where inference credentials are absent.
  • Model compatibility adjustment

    • Switch AI inference model from gpt-5.5 to gpt-5 in the parse step to align with more reliable Copilot CLI execution.
  • Behavioral impact

    • When Copilot inference cannot run, the workflow now cleanly follows the existing URL-based parsing/fallback path instead of surfacing avoidable parse-step failures.
- name: Parse comment (GitHub Copilot)
  if: steps.ctx.outputs.skip != 'true' && secrets.COPILOT_PAT != ''
  uses: actions/ai-inference@v3
  with:
    system-prompt-file: .github/prompts/parse-app-submission-system.md
    prompt-file: runtime-parse-prompt.txt
    model: gpt-5
Co-authored-by: LionSR <14889516+LionSR@users.noreply.github.com>
LionSR pushed a commit that referenced this pull request Aug 14, 2026
Confirmed via a raw, unmasked Copilot CLI invocation (run 31781411798):

  Error: Authentication token found but could not be validated.
    Failed to fetch PAT user login (401): GitHub returned: Bad credentials

COPILOT_PAT is expired/revoked -- auth fails before any model or prompt
is considered. That's why swapping gpt-5.5 for gpt-4.1 changed nothing,
and why PR #44's "only run if COPILOT_PAT is set" approach wouldn't have
helped either: the secret is set, it's just no longer a valid token.
This requires regenerating the PAT and updating the repo secret; no
workflow or script change can fix it. Debug step served its purpose,
removing it.
@LionSR LionSR closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants