feat(codex): add OpenCode OAuth usage fallback - #1077
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
All reported issues were addressed across 19 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Reviewed as part of a sweep across the open PRs. This is the largest change in the batch and it holds up well — the read-only discipline is real (no write, refresh, or lock anywhere on OpenCode's I want to flag one thing in particular because it looks alarming in the diff and is not: the Please restore the coverage that deletion took with itThe two deleted tests were the regression guard from #759 — "an active-but-failing provider must be surfaced, not silently dropped", with the expired Roughly: #[test]
fn fetch_provider_report_surfaces_provider_errors_instead_of_dropping_them() {
let report = fetch_provider_report(
"Sakana",
Err(anyhow::anyhow!(
"Sakana session expired or invalid. Refresh SAKANA_SESSION_COOKIE."
)),
);
assert!(report.outputs.is_empty());
assert_eq!(report.diagnostics.len(), 1);
assert!(report.diagnostics[0].message.contains("SAKANA_SESSION_COOKIE"));
}Smaller items
Note that no build or test leg has run on this branch — the first-time-contributor gate meant only cubic executed — so nothing here has been compiled in CI. Worth approving a CI run before merge given the size. |
|
CI update: I approved the blocked workflow runs, so this branch has now been compiled for the first time. Lint, Tests (ubuntu-latest) and Tests (windows-latest) all pass at |
An active provider whose fetch returns Err must surface a diagnostic rather than vanishing from the output. The tests that pinned this behavior covered partition_results, which was removed along with the fetch_all path, so the invariant was left unguarded even though the behavior moved intact into fetch_provider_report. Retarget the coverage at the current entry point, asserting the error message keeps its auth-refresh guidance and that a successful fetch stays diagnostic-free.
|
Thanks @j-chmielewski — I pushed First I confirmed the guard was genuinely gone rather than relocated. Running control patterns first so an empty result means something: Restored coverage against the current shape rather than resurrecting the deleted tests, since they referenced the removed
Red-green verified: patching the
One follow-up I did not do: the Still yours to decide: the TUI naming the same credential two ways ( |
…ount panel The Credential detail row rendered "managed by OpenCode" while the Actions row two lines below still rendered "Managed externally" for the same account, so one credential was described two different ways. Both rows now derive their wording from a single external_credential_manager helper. Also pairs the OpenCode fallback test with a saved-account case so the "no account buttons" assertions are exercised against a render that does show them, instead of passing vacuously on a fixture where the button block is unreachable.
|
Pushed one more small follow-up (6dc1146) on top of the regression-guard commit. Consistent naming for an OpenCode-sourced credential. Both rows now go through one Made the fallback test's negative assertions load-bearing.
Deliberately left alone as author's call: the empty-access-token |
openaiOAuth access token as a read-only Codex usage fallback when native sources return no successful result.Summary by cubic
Adds a read-only OpenCode OAuth fallback for Codex usage when native sources return no result. Clearly labels OpenCode-managed credentials and preserves provider diagnostics in the CLI and TUI.
New Features
openaiOAuth from OpenCode’s$XDG_DATA_HOME/opencode/auth.jsononly if store/file/keychain yield no usage; OpenAI API-key entries are ignored./connect. Native diagnostics are preserved.credential_sourcetoUsageOutput("opencode"when used). TUI marks “managed by OpenCode” and hides account actions. Discovery honors XDG;has_credentials()includes the OpenCode candidate.Bug Fixes
fetch_provider_report.Written for commit 6dc1146. Summary will update on new commits.