Commit 4322e97
committed
fix(upstream): let an explicit OPENROUTER_API_KEY override stored opencode auth
The wrapper only seeded auth.json when no openrouter credential existed. Anyone
who had previously run 'opencode /connect' would have their port.env key
silently ignored and the run billed to the old key — close to undebuggable.
An explicitly provided key now always wins. Other providers in auth.json are
preserved rather than clobbered, and a corrupt auth.json recovers instead of
failing the run.1 parent 0ca906a commit 4322e97
1 file changed
Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
| 85 | + | |
77 | 86 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
| |||
0 commit comments