CodeNomad/dev-docs
Pascal André db1f552afd
fix(usage): use selected native V2 Codex credentials (#811)
## Summary

I replaced Codex Usage's legacy auth-file reads with the connected
OpenCode V2 daemon's selected ChatGPT OAuth credential. This addresses
the stale-file mismatch described in #808 without guessing WSL
credential paths or substituting another account.

- Resolve the provider integration in the owned session's native
location; use only its selected active credential and native accountID.
- Keep credentials server-only, OAuth refresh native-owned, and
credential export/generic RPC blocked through the browser proxy.
- Fence warm and pending quota results on account changes, reconnects
and session movement; scope the visible panel to its instance/session.
- Bound quota HTTP, reject redirects and sanitize errors. No SQLite
access or legacy/Codex CLI fallback.

The credential-list API requires OpenCode 2.0.20 for this feature only.
Older runtimes, expired native tokens and non-ChatGPT connections fail
closed; the global application minimum is unchanged. Other providers'
credential integrations are outside this focused fix.

## Validation

- Server/UI typechecks; 85 server tests; five UI unit tests; three
rendered browser scenarios; UI build and diff checks passed.
- A fresh native 2.0.20 Windows daemon with synthetic credentials
exercises the production adapter: selected OAuth/accountID, key-account
switch invalidating a warm snapshot, and recovery despite stale
auth.json. Quota HTTP is mocked; no shared daemon or real credentials
are used.
- This fixes the confirmed integration mismatch, but I have not
reproduced the author's real WSL/live account failure.

Closes #808.

Maintenance: existing `packages/server/src/server/http-server.ts`
(~2,317 lines) and `packages/ui/src/lib/api-client.ts` (~613 lines)
exceed the source-size guideline; their wiring changes remain small.
2026-09-30 17:29:13 +02:00
..
ui-harmonization-demo V2(ui): progressively harmonize the CodeNomad interface (#667) 2026-09-15 14:17:30 +01:00
architecture.md feat(browser): add autonomous native previews (#666) 2026-09-18 17:46:14 +02:00
ATTACHMENT_UX_PLAN.md feat(composer): unify native device attachments and project references (#729) 2026-09-24 23:12:44 +02:00
BROWSER_AUTOMATION.md fix(automation): remove the active-conversation targeting requirement (#746) 2026-09-22 10:15:37 +02:00
CACHE_REFRESH_CONVENTIONS.md fix(models): retain active-session selections across admission and refresh races (#771) 2026-09-24 21:16:40 +02:00
DEV_V2_CODE_REDUCTION.md feat(opencode): migrate CodeNomad to native V2 (#647) 2026-09-04 11:36:11 +01:00
DEVELOPER_MODE.md feat(browser): add autonomous native previews (#666) 2026-09-18 17:46:14 +02:00
INDEX.md docs(opencode): define stable runtime setup and update plan 2026-09-20 14:31:45 +02:00
MVP-PRINCIPLES.md feat(opencode): migrate CodeNomad to native V2 (#647) 2026-09-04 11:36:11 +01:00
OPENCODE_FIRST_INSTALL_RECOVERY.md fix(setup): recover interrupted Windows OpenCode installations (#783) 2026-09-25 23:52:35 +02:00
OPENCODE_V2_COMPATIBILITY.md fix(usage): use selected native V2 Codex credentials (#811) 2026-09-30 17:29:13 +02:00
OPENCODE_V2_POST_BETA.md fix(opencode): use native upgrade for live Windows runtime updates (#769) 2026-09-24 15:19:35 +02:00
PALETTE_REVIEW_2026-09-08.md V2(ui): progressively harmonize the CodeNomad interface (#667) 2026-09-15 14:17:30 +01:00
PALETTE_SOURCES.md V2(ui): progressively harmonize the CodeNomad interface (#667) 2026-09-15 14:17:30 +01:00
PLUGIN_ACTIVATION_CONTROLS.md feat(plugins): add scoped V2 plugin activation controls (#726) 2026-09-25 01:29:14 +02:00
pr724-go-to-destinations.png feat(ui): add workspace-root navigation to directory browser (#724) 2026-09-24 10:24:58 +02:00
pr724-go-to-filtered.png feat(ui): add workspace-root navigation to directory browser (#724) 2026-09-24 10:24:58 +02:00
pr729-attachments-fr-narrow.png feat(composer): unify native device attachments and project references (#729) 2026-09-24 23:12:44 +02:00
pr729-attachments-he-wide.png feat(composer): unify native device attachments and project references (#729) 2026-09-24 23:12:44 +02:00
SAVED_PALETTE_CALIBRATION_2026-09-11.md V2(ui): progressively harmonize the CodeNomad interface (#667) 2026-09-15 14:17:30 +01:00
SESSION_ENVIRONMENT.md fix(environment): refresh profile variables before each prompt (#714) 2026-09-19 18:18:56 +02:00
SESSION_HISTORY_NAVIGATION.md fix(ui): preserve semantic icons for historical timeline tools (#738) 2026-09-21 23:46:51 +02:00
SESSION_HISTORY_QUERIES.md feat(history): add global timeline and direct message-window navigation 2026-09-20 12:04:30 +02:00
SESSION_HISTORY_STRESS_REVIEW.md feat(history): persist timeline indexes and reconcile changed checkpoints 2026-09-20 23:21:03 +02:00
SESSION_PRUNING_DEPLOYMENT.md feat(pruning): restore opt-in selective deletion through native plugin RPC (#686) 2026-09-10 13:31:40 +02:00
SESSION_PRUNING_RPC.md feat(history): query full sessions and clean technical content through native RPC 2026-09-20 11:02:31 +02:00
SESSION_PRUNING_SAFETY.md feat(pruning): restore opt-in selective deletion through native plugin RPC (#686) 2026-09-10 13:31:40 +02:00
solidjs-llms.txt update blank session cleanup code for now session store logic 2025-11-27 20:18:22 -05:00
SUMMARY.md feat(v2): manage session families across worktrees (#649) 2026-09-17 22:57:37 +02:00
TAB_CHROME_REVIEW_2026-09-10.md V2(ui): progressively harmonize the CodeNomad interface (#667) 2026-09-15 14:17:30 +01:00
TAURI_WINDOWS_INPUT_DEADLOCK.md fix(tauri): prevent Windows input reentrancy deadlocks (#773) 2026-09-24 21:02:20 +02:00
technical-implementation.md fix(opencode): support earlier and modern V2 runtime contracts (#695) 2026-09-16 23:48:08 +02:00
TOOL_CALL_IMPLEMENTATION.md Split workspace into electron and ui packages 2025-11-17 12:06:58 +00:00
UI_MOTION_PROFILING.md fix(status): keep connected MCP indicators static at rest (#806) 2026-09-30 14:03:19 +02:00
user-interface.md Puff-up README 2025-11-14 23:26:13 +00:00
WORKTREE_SESSION_PLACEMENT.md fix(worktrees): unblock existing-worktree selection on large repositories (#740) 2026-09-21 17:33:11 +02:00