Auth reliability + error handling alignment + request integrity fixes #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Numman has been tied up the last couple of weeks, so I handled this on his behalf and consolidated the scattered fixes into one coherent, fully‑tested implementation. This lands the missing headless auth fallback, aligns error handling with OpenCode conventions, maps usage‑limit 404s to retryable 429s, and preserves AGENTS/tool‑call integrity in the request transformer. It also adds OpenCode variants support (modern config) and a cross‑platform one‑command installer that safely updates the global config and clears plugin cache. The result is fewer auth failures, correct retries, no more silent loss of instructions, and an easier install/update path for users.
Fixes / How it’s rectified
xdg-openis missing. We now detect missing openers and safely skip spawn, letting users open the URL manually while the callback server stays alive.~/.config/opencode/AGENTS.md#68 — AGENTS.md content is preserved: we protect instruction markers and only filter exact OpenCode system prompts (case‑insensitive signatures), so custom instructions stay intact.Adds / Enhancements
npx -y opencode-openai-codex-auth@latest(global config only, backs up config, clears plugin cache). Includes--legacyfor old OpenCode.PRs re‑implemented (no direct merge)
Supersedes: #84 #81 #52 #88 #86 #59 #63 #73 #90 #91
This PR incorporates the intent of each, with additional edge‑case handling and tests.
Tests
CC / Thanks
@christso @CasualDeveloper @paflopes @connorads @mosfor @paarth-a @code-yeongyu @llajas @aryasaatvik @cau1k
and contributors in the threads:
@daniel-sc @kearygriffin @haininhhoang94 @kim0 @Srini-B @hyprbased @emrosenf @tbrandenburg @jhartumc @ramarivera @mariomeissner @EvanZhouDev @mrairdon-midmark @mkoorn @EvanNotFound @jasonish @igormaneschy @Tarquinen @mikhail-shemelin @junhoyeo @tayiorbeii @ivankazzzz