Repository navigation
Description
factory: the vendored opencode action's version step fetches the latest release with an unauthenticated curl, which fails or hangs and takes down every agent run
Summary
Every opencode.yml (and triage.yml, wiki-update.yml) run executes a step inside the vendored action anomalyco/opencode/github@latest whose id is run_agent.version:
VERSION=$(curl -sf https://api.github.com/repos/anomalyco/opencode/releases/latest | ...)The curl carries no Authorization header. Unauthenticated requests to api.github.com are rate-limited per IP, and GitHub-hosted runners share NAT IPs, so from a busy runner the limit is regularly exhausted. -f turns the 403 into exit code 1, the step fails, the agent step is skipped (outcome=skipped) and the whole run concludes failure with nothing done. On other runs the same curl appears to hang indefinitely, producing a run that sits in_progress for 45+ minutes with no output.
Evidence
Run 42396752964 (17:31:44Z, the first /oc review on PR #869):
17:33:45.16 [start-action display=Get opencode version; id=run_agent.version]
17:33:45.16 VERSION=$(curl -sf https://api.github.com/repos/anomalyco/opencode/releases/latest ...)
17:33:45.29 ##[error]Process completed with exit code 1.
17:33:45.29 [end-action id=run_agent.version; outcome=failure; conclusion=failure; duration_ms=138]
17:33:45.29 [start-action display=Run opencode; id=run_agent.run_opencode]
17:33:45.29 [end-action id=run_agent.run_opencode; outcome=skipped; conclusion=skipped; duration_ms=0]
17:33:45.38 Post-step ... Decision: agent/failed (run concluded: failure)
duration_ms=138 - a fast refusal, not a network stall. The agent never started; the post-step applied agent/failed to ticket #869's PR.
The same class took down four further runs that evening (17:28, 17:31, and four at 18:24), which sat in_progress for 40-45 minutes with no comment posted - and each had to be cancelled by hand before the loop could continue.
Why it matters
- One unauthenticated HTTPS call from a vendored action is a single point of failure for the entire agentic pipeline. It is invisible: the failure surfaces as
agent/failedon a ticket that was never attempted, which reads as an agent failure rather than infrastructure. - The 45-minute wedges cost real wall-clock time and manual cancellation every time, and they mask genuine agent work (a maintainer cannot distinguish a wedged run from a busy one without reading logs that do not exist for in-progress runs).
- Versions are fetched at all only because the workflows reference
@latest.
What to look at
.github/workflows/opencode.yml,triage.yml,wiki-update.yml- theanomalyco/opencode/github@lateststep. Options, cheapest first:- Pin each to a release tag (e.g.
@v2.2.6) or a commit SHA. If the action honours an explicit version input, the pre-step curl disappears; if it still resolveslatestinternally, at least a pinned ref removes surprise upgrades. Check the action's own metadata for aversioninput first. - If the curl cannot be avoided, give the run's steps a timeout (
timeout-minuteson the step) so a hang fails fast instead of wedging, and exportGITHUB_TOKENin the step env (many such actions fall back to it when present).
- Pin each to a release tag (e.g.
- Whatever is chosen, add a check that a failed agent step is distinguishable from infrastructure: the run name or an env marker that names
run_agent.versionas the cause would stop theagent/failedmisattribution.
Acceptance criteria
- With the chosen pin/token/timeout in place, an
opencode.ymlrun whoserun_agent.versionstep would have failed now either runs the agent or fails fast (minutes, not 45) with a name that points at the version step, not at the agent. - A test or a documented manual check verifies the agent step still runs end to end after the change (one
/oc reviewround trip on any ticket). triage.ymlandwiki-update.ymlare updated the same way; a grep for@latestover.github/workflows/*.ymlreturns nothing new.
Correction (later the same evening): only half of this is proven
A mitigation commit (workflows: bound the vendored opencode step ...) added timeout-minutes: 5 to the Run opencode step in all three workflows, on the theory that the version curl was hanging and wedging runs. Its first run disproved the wedge half:
42407186680 19:40:34 [start-action display=Get opencode version; id=run_agent.version]
42407186680 19:40:34 [end-action id=run_agent.version; outcome=success; duration_ms=239]
42407186680 19:40:36 [start-action display=Run opencode; id=run_agent.run_opencode]
42407186680 19:45:46 ##[error]The action has timed out.
42407186680 19:45:46 [end-action id=run_agent.run_opencode; outcome=failure; duration_ms=310648]
The version curl succeeded in 239ms, and the five minutes were spent by the agent itself, which my cap then killed. The cap was applied to the whole Run opencode step - version fetch and agent work - not to the fetch, so it aborts legitimate tickets. It has been reverted (a142246c15).
What remains proven: the curl fails fast sometimes (run 42396752964, 138ms, exit 1, agent step skipped) - that is the #870 defect and the -f/unauthenticated diagnosis stands.
What is NOT proven: that the same curl caused the 40-45 minute in_progress wedges. Those runs never produced a readable log, and the observed symptom matches the documented opencode client wedge (AGENTS.md: "75+ minutes of silence after ~11 minutes of work, every nudge blocked"), whose instrument is the watchdog's WATCHDOG_RUN_STALE_MIN rule - not a step timeout. Anyone re-diagnosing this should start from a wedged run's log, not from the one fast failure.
Second correction: the wedge is the AGENT step, and this is now proven, not inferred
Step-level state for every run cancelled during the outage (the jobs API keeps step conclusions after cancellation; the log blob is deleted, so this is the only surviving evidence):
run 42396708704 #869 review 17:31:16 -> cancelled 18:23:52 steps 1-11 success, 12 "Run opencode" cancelled
run 42396955223 #869 review 17:34:11 -> cancelled 18:23:50 steps 1-11 success, 12 "Run opencode" cancelled
run 42396466453 #868 DEV 17:28:21 -> cancelled 18:23:54 steps 1-11 success, 12 "Run opencode" cancelled
run 42404202466 #868 DEV 19:02:02 -> cancelled 20:32:18 steps 1-11 success, 12 "Run opencode" cancelled
run 42414325324 #869 review 21:07:22 -> cancelled 21:45:53 steps 1-11 success, 12 "Run opencode" cancelled
run 42414337985 #866 DEV 21:07:32 -> cancelled 21:45:56 steps 1-11 success, 12 "Run opencode" cancelled
run 42415342242 #869 review 21:19:58 -> cancelled 21:45:55 steps 1-11 success, 12 "Run opencode" cancelled
run 42415540057 #869 review 21:22:18 -> cancelled 21:45:55 steps 1-11 success, 12 "Run opencode" cancelled
Steps 1-11 (checkout, dedupe guard, model selection, JDK 8, QEMU, ISO build) succeeded in every case, so the version pre-step is reached and passed - consistent with the one readable failure log where it succeeded in 239 ms. The wedge is always inside step 12, the agent itself: 23 to 90 minutes of no output, and not one of the eight produced a comment, a verdict or a PR.
So the defect is the documented client wedge in AGENTS.md ("the opencode client can wedge with status stuck at in_progress... 75+ minutes of silence"), and the instrument that already exists for it is the watchdog's WATCHDOG_RUN_STALE_MIN cancellation - which never fired tonight because WATCHDOG_DRY_RUN is still 1 in the scheduled sweeps. Two actions follow from that, neither of which is a workflow change:
- Turn the watchdog's cancellation on for the scheduled sweeps (flip the default to
0, or set the secret), since eight hand-cancelled runs is exactly the evidence the dry-run period was meant to gather. - Keep the title/accent of this ticket on the fast-fail half (the unauthenticated curl in run 42396752964, 138 ms, exit 1), which is real and separate: a hung agent vs. a refused version fetch need different fixes and only the second is fixed by pinning or authenticating the fetch.
FINAL: root cause is the inference account's quota, and it is not a repo defect
Run 42407186680 is the only run tonight whose log survived, and its agent step (step 12) contains the answer verbatim:
19:40:37 opencode session ses_e487909a1ffeJTzOSFynuY3HqA (projectID 84b9a6a02..., v1.19.5)
19:40:38 INFO stream { providerID: "opencode", modelID: "gpt-5.4-nano", agent: "title", small: true }
19:40:38 INFO llm runtime selected { llm.provider: "opencode", llm.model: "gpt-5.4-nano" }
19:40:38 ERROR stream error { url: "https://opencode.ai/inference/openai/v1/responses",
statusCode: 402, isRetryable: false,
responseBody: {"error":{"type":"invalid_request_error",
"message":"Insufficient account funds"}} }
AI_APICallError: Insufficient account funds
AI_APICallError: Free usage limit reached. Free models work in OpenCode
(https://opencode.ai); subscribe to OpenCode Go to keep going:
https://opencode.ai/go isRetryable: true
<no further output for the remaining 5m10s of the step>
So the wedge is not the version curl, and not the documented client bug: the opencode.ai inference account is out of funds/quota. The first call the agent makes (the tiny gpt-5.4-nano title model) is refused with 402 Insufficient account funds, and a second refusal is explicitly isRetryable: true - so the client retries forever, produces no output, and never exits. That is the exact signature of all eight cancelled runs: setup steps 1-11 green, step 12 silent until cancellation, zero comments.
Nothing in this repository can fix it. Two routes, both outside today's scope:
- Account side (immediate): top up / subscribe on opencode.ai (the "OpenCode Go" link above). Every pending run then proceeds normally - the rest of the pipeline is healthy (CI, reviews, my validation all ran fine tonight).
- Repo side (a decision, not a fix): re-route the three roles in
.github/scripts/model-config.jsfrom theopencode/gateway to OpenRouter, whose key the workflow already exports asOPENROUTER_API_KEY. Checked and this is NOT a prefix swap:crouton-alpha-free,inkling-2-small-freeanddeepseek-v4.1-flash-freedo not exist on OpenRouter, so the map would need real model IDs (and OpenRouter's own credit/free-tier limits). That is a model-selection decision for the maintainer, not a bug fix.
Retained from earlier corrections, still true: the unauthenticated version curl in the vendored action fails fast sometimes (run 42396752964, 138 ms, exit 1) - a separate, real defect worth pinning/authenticating - and my timeout-minutes: 5 mitigation was wrong and is reverted (a142246c15).
Investigation update (2026-11-21)
Re-checked against current master 066f0d0d89. The issue is still valid; no part of it has been fixed. New evidence and one correction to the original proposal:
-
Still unpinned, all three workflows.
grep -rn "@latest" .github/workflows/*.ymlreturns:
opencode.yml:160,triage.yml:70,wiki-update.yml:81- alluses: anomalyco/opencode/github@latest.@latestcurrently resolves tov1.19.6, published 2026-11-17: the action upgraded itself four days ago without any change on our side. -
Reproduced in a real run.
wiki-updaterun39366214347(2026-10-20) failed atrun_agent.version:
VERSION=$(curl -sf https://api.github.com/repos/anomalyco/opencode/releases/latest ...)->##[error]Process completed with exit code 1.induration_ms=81, thenrun_opencodeand every following stepoutcome=skipped. The agent never ran. -
Correction to mitigation Fix typo: 'recieve' should be 'receive' in AbstractPointerDriver.java #2 in the original report: exporting
GITHUB_TOKENdoes not help. That run's env dump shows the step already hadGITHUB_TOKEN,OPENCODE_API_KEYandOPENROUTER_API_KEYexported, and the curl still failed in 81 ms.curldoes not readGITHUB_TOKEN; the header would have to be passed explicitly. Only pinning the ref (or giving the action an explicit version input, if it has one) removes the call, or a step-level timeout bounds it. -
The wedge half is real and costs the full job timeout.
wiki-updateruns39120356848(2026-10-18) and35506663371(2026-09-20) each sat ~30 minutes before being cancelled by hand; the jobtimeout-minutesis 60 (wiki-update) and 90 (opencode, triage). -
Why it survived this long: it is intermittent. Last 40 runs each:
opencode.yml9 success / 0 failure,triage.yml1 success / 0 failure,wiki-update.yml13 success / 1 failure / 2 cancelled. The IP rate limit bites unpredictably, so the next occurrence is a lottery, not a matter of if. -
Adjacent defect, NOT part of this ticket:
wiki-update.yml:87-88hardcodesmodel: opencode/deepseek-v4.1-flash-free/variant: highand bypasses.github/scripts/model-config.js(that model is quota-exhausted today). File separately; do not fold it into this fix.
Revised acceptance criteria
anomalyco/opencode/githubpinned to an explicit tag or SHA inopencode.yml,triage.ymlandwiki-update.yml;grep -r "@latest" .github/workflows/*.ymlreturns nothing.- A version-step failure can no longer masquerade as an agent failure: a step-level
timeout-minuteson the agent step and/or a signal that namesrun_agent.version, so a hang fails in minutes rather than at the job timeout. - A test (or documented manual check) proves the agent step still runs end to end after the change; the repo already has the pattern for this in
.github/scripts/tests/wiring tests. - The three workflows stay consistent with each other.
Triage Addendum (auto, 2026-11-21)
- Area / Kind: area/build + kind/bug
- Blast radius: L2 (CI config only: three workflow files + one wiring test; no JNode source, boot path, or public API)
- Expected scope: Pin
anomalyco/opencode/github@latestto one explicit tag/SHA inopencode.yml(~160),triage.yml(~72) andwiki-update.yml(~81); add a step-leveltimeout-minuteson therun_agentstep calibrated below each job timeout (the reverted 5-minute cap killed a legitimate 5m10s run); addnode:testcoverage in.github/scripts/tests/(extendmodel-config-wiring.test.jsor a sibling) asserting the same pin in all three and no@latest. No-go: unrelated workflow reformatting, the hardcodedwiki-update.ymlmodel (separate ticket), JNode sources/ASM/public API. - Test path:
node --test .github/scripts/tests/*.test.js(per.github/AGENTS.md:308), then one/oc reviewround trip on any ticket to prove the agent step still runs end to end. - Merge signal: human-review (bug; CI workflow change, small scope, test path exists)
- Gaps: non-blocking: calibrate the timeout per job (5m proved too low); check whether the pinned action exposes a
versioninput that removes the internal curl; the 402/quota wedge is operational, not repo-fixable, so this ticket stays on the fast-fail/pin half. Out of scope: hardcoded model inwiki-update.yml. - Full report:
## Triagecomment below.
✅ Ticket Runner Status
| Field | Value |
|---|---|
| Phase | DONE |
| Turn | 2/7 |
| Retries | 0/3 |
| PR | #981 |
| Review in progress | no |
| Started | 2026-11-21T08:52:14.410Z |
Activity
LSantha commentedon Nov 7, 2026
/oc triage issue #870
Triage run ONLY. Load the jnode-triage-issue skill and obey it. Output is exactly one ## Triage comment plus kind/area label edits. FORBIDDEN in this run: git checkout -b, git push, gh pr create, any branch, any PR.
workflows: bound the vendored opencode step so a hung version fetch f…
Revert "workflows: bound the vendored opencode step so a hung version…
LSantha commentedon Nov 21, 2026
/run
Fix the version-step single point of failure described in this issue (see the "Investigation update (2026-11-21)" section in the body for the reproduction).
Required outcome:
anomalyco/opencode/githubto an explicit tag or SHA in.github/workflows/opencode.yml,.github/workflows/triage.ymland.github/workflows/wiki-update.yml. After the changegrep -rn "@latest" .github/workflows/*.ymlmust return nothing. All three must use the same pin.timeout-minutesso a hang fails in minutes rather than at the job timeout, and/or make the failure namerun_agent.version. Do NOT attempt to fix it by exportingGITHUB_TOKEN: a real run (39366214347) had that env var already exported and the curl still exited 1 in 81 ms.node:testsuite in.github/scripts/tests/- follow the existing wiring-test pattern that pins workflow clauses. Include a check that the three workflows stay consistent with each other.Out of scope: the hardcoded model in
wiki-update.yml(that is a separate ticket). Keep the change minimal and consistent with the existing style of these files; do not reformat unrelated workflow steps.LSantha commentedon Nov 21, 2026
/oc triage issue #870
Triage run ONLY. Load the jnode-triage-issue skill and obey it. Output is exactly one ## Triage comment plus kind/area label edits. FORBIDDEN in this run: git checkout -b, git push, gh pr create, any branch, any PR.
The previous triage run on 2026-11-07 produced no report (the agent run failed). The issue body now carries an "Investigation update (2026-11-21)" section with the reproduction; confirm kind/bug and area/build, and note that the adjacent wiki-update.yml hardcoded-model defect is explicitly out of scope here.
LSantha commentedon Nov 21, 2026
Triage
.github/workflows/opencode.yml:160,triage.yml:72,wiki-update.yml:81)run_agent.versioncurl (api.github.com/repos/anomalyco/opencode/releases/latest, unauthenticated,curl -sf) exits 1 in 81-138 ms,run_opencodeskipped: run 39366214347 / 42396752964; expected agent run, actualagent/failedwith no work attemptedanomalyco/opencode/github@latestuses to the same explicit tag/SHA; add a step-leveltimeout-minutesonrun_agentcalibrated below each job timeout (5m was reverted after killing a legitimate 5m10s run); extendnode:testwiring coverage for the pin and three-workflow consistency. No-go: unrelated step reformatting, the hardcodedwiki-update.ymlmodel, JNode sources/ASM/public API.node --test .github/scripts/tests/*.test.js; then one/oc reviewround trip to prove the agent step still runs end to end.versioninput that removes the internal curl; the 402/quota wedge is operational, not repo-fixable, so this ticket stays on the fast-fail/pin half. Out of scope:wiki-update.ymlhardcoded model.github run
LSantha commentedon Nov 21, 2026
/oc Please proceed with this task.
LSantha commentedon Nov 21, 2026
Created PR #981
github run
Fix timeout/test; PR refs #870
#870 - Pinned opencode action; added timeouts/tests (#981)