bug: dist/index.js is stale — calls deprecated Azure endpoint, breaking prompt/advanced modes entirely
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- github-actions, javascript
- Domain
- build-system, ci-cd
Research direction
Start with action.yml to confirm dist/index.js is the runtime entry point, then compare src/agent.js with the generated dist/index.js and review build-dist.yml. Run npm ci and npm run build, inspect the resulting dist/ changes, and verify that the generated artifact reflects the current source before committing it.
Written by the indexing model from the issue text.
Description
Bug Report
Summary
dist/index.js — the actual file that runs when the action is invoked (per action.yml: main: dist/index.js) — is severely out of sync with the current src/ code. This makes prompt and advanced modes completely non-functional for every user of this action.
What the dist does (broken)
// dist/index.js — what actually runs
const response = await fetch("https://models.inference.ai.azure.com/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
// No Accept header
// No X-GitHub-Api-Version header
// No AbortController / timeout
},
});
if (!response.ok) {
core.setFailed(...); // crashes the entire action on any API error
}
// No null checks — throws if AI returns unexpected JSON shape
const resultObj = JSON.parse(data.choices[0].message.content);
What the src does (correct)
// src/agent.js — never built into dist
const response = await fetch("https://models.github.ai/inference/chat/completions", {
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2026-03-10",
},
signal: controller.signal, // 30s timeout via AbortController
});
if (!response.ok) {
core.warning(...); // graceful degradation
return [];
}
// full null-safety, JSON parse error handling, deduplication logic
Comparison Table
dist/index.js (what runs) |
src/agent.js (never built) |
|
|---|---|---|
| API endpoint | models.inference.ai.azure.com (deprecated) |
models.github.ai/inference |
| Timeout | None — hangs forever | 30s AbortController |
| On API error | core.setFailed — kills entire action |
core.warning + graceful [] |
| JSON parse safety | Crashes on bad AI response | Try/catch with warning |
| Accept header | Missing | application/vnd.github+json |
| API version header | Missing | X-GitHub-Api-Version: 2026-03-10 |
| Base issue merging/dedup | Missing | Full deduplication logic |
Impact
promptandadvancedmodes are 100% broken — the old Azure endpoint either rejects requests or returns responses in a format the old code cannot handle, causing the action to crash viasetFailed.presetmode still works because it does not touch the AI endpoint.- This affects every repository using this action in
promptoradvancedmode.
Root Cause
The build-dist.yml workflow only rebuilds dist/ when a PR is merged to main. The current src/agent.js was updated with a new endpoint, timeout, better error handling, and deduplication logic — but a rebuild was never committed. The stale dist/index.js therefore still targets the old deprecated Azure endpoint.
Fix
Run npm run build and commit the result:
npm ci
npm run build
git add dist/
git commit -m "fix: rebuild dist with correct GitHub Models endpoint and error handling"
git push
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·