feat(gateway): keep driver and agent model options up to date + add modelgateway#9
Conversation
- Add modelSource toggle (gateway vs own key) for flexible model routing - Fix agentExecute body: model is now a flat string, removed provider/cua/apiKey from body - Remove apiKey from sessions/start body; auth is header-only via x-bb-api-key - Make modelApiKey optional in credentials; only send x-model-api-key header in own key mode - Only send x-bb-project-id header when non-empty - Update model list to latest versions (Claude 4.6, Gemini 3) - Default all model selectors to anthropic/claude-sonnet-4-6 - Tag all sessions with n8n metadata
shrey150
left a comment
There was a problem hiding this comment.
Approving to unblock, but would consider:
- renaming "own key" -> "user provided key" (both on name and value)
- removing all logic for project ID
| if (modelApiKey) { | ||
| headers['x-model-api-key'] = modelApiKey as string; | ||
| } | ||
| const projectId = (browserbaseProjectId as string)?.trim(); |
There was a problem hiding this comment.
Is there a reason we need to keep this header around? Should we remove since it's basically a no-op?
There was a problem hiding this comment.
as to not break any potential existing n8n workflows, addressed again below as well
| }, | ||
| { | ||
| name: 'Own API Key', | ||
| value: 'ownKey', |
There was a problem hiding this comment.
Thoughts on renaming to User-provided API key & value: 'userProvidedKey' for clarity?
| { | ||
| displayName: 'Model Info', | ||
| name: 'modelNotice', | ||
| name: 'modelNoticeByok', |
There was a problem hiding this comment.
is there a reason you renamed here? assuming this is Byok = Bring Your Own Key? in this case, let's make it modelNoticeBYOK? but again, not sure if we need the rename
There was a problem hiding this comment.
the info is different based on whether or not you use the gateway
There was a problem hiding this comment.
can change to uppercase
| } | ||
| headers['x-model-api-key'] = modelApiKey; | ||
| } | ||
| const projectId = (credentials.browserbaseProjectId as string)?.trim(); |
There was a problem hiding this comment.
Again wondering if we need project ID at all
There was a problem hiding this comment.
projectId is optional, i have it here still since if you use the old credential setup/want to pass projectId to scope it you can but it's not required/shown that its not required when you setup your creds.
Summary