Commit 3d26096
feat(ai): default provider mode to gateway so signed-in users auto-use their plan
`levelcode.ai.providerMode` defaulted to `byok`, and the gateway only engages
when the mode is *explicitly* `gateway`. So a user could sign in, have an
active LevelCode plan, and still route AI through their own key — their paid
subscription silently unused because they never flipped the toggle.
Flip the default to `gateway`. This is safe because resolveGateway() already
falls back to BYOK whenever there's no token: signed-out users transparently
stay on BYOK, and signed-in users route through their metered plan with nothing
to toggle. An explicit `byok` choice is still honored (the mode stays a
first-class, user-selectable escape hatch).
- package.json: default byok → gateway; enum/markdown descriptions updated to
say gateway is the default and auto-falls back to BYOK when signed out.
- extension.js: matching fallback in providerMode() (byok → gateway) for the
unregistered-schema edge.
- test/providerMode.test.js: guards the default ('gateway'), that both modes
stay selectable, and that the default is safe signed out (no token → BYOK) —
so the revenue path can't silently regress to byok.
All extension tests pass (node test/*.test.js).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 1f44586 commit 3d26096
3 files changed
Lines changed: 49 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
| 360 | + | |
| 361 | + | |
362 | 362 | | |
363 | | - | |
364 | | - | |
| 363 | + | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments