Repository navigation
Align Agents provider and model setup with App Studio - #1071
Conversation
|
@mjudeikis-bot review. |
mjudeikis
left a comment
There was a problem hiding this comment.
No Critical or Warning findings. Three Notes below; all are contained portal-side issues.
Scope: portal-only change (Agents provider portal + one design doc). No Go, API, CRD, manifest, chart or codegen files are touched, so the server-path, tenancy and provider-contract categories do not apply.
Checked
Read beyond the diff
ProviderConnectionEditor.vuein full:connections/originalConnection/selectedConnection,fingerprintwatcher,discover(),connect(),probeRequest(),cancel(),canSaveNameOnly, and declaration order oftesting/catalogRequestagainst the new{ immediate: true }watch (no TDZ).Models.vue:saveModel,continueWithSavedProvider,openProvider,cancelCreate,cancelEditorAfterSave, and therouteOwnedvscreateRouteemit conditions.App.vue:addAgentCredential,onCreateSuccess,onCreateCancel,credentialMatchesFamily,createSuccessRoute,rememberProviderConnectionOrigin.resources.tssaveCredential(connectionWriteclassification, harness exclusion) andcredentialView;api.tsdiscoverProviderConnection;agentkit/ModelIDSelector.vueslots (search-action,statusexist);model-probe-result.ts.
Hunt categories
- Correctness: auto-refresh fires once per
catalogIdentitychange, no retry loop; stale-result fencing (isCurrent) and abort on unmount/identity change hold; harness credentials are excluded fromconnectionWrite, so the newisConnectionguard incredentialMatchesFamilydoes not drop them. Two Notes (empty refresh result, discarded diagnostic). - Concurrency: only the single
catalogRequestAbortController; superseded requests cannot writerefreshedModels. No findings. - Tenancy/kcp, provider contract, API/codegen/storage: not applicable, no such files changed.
uid/generationare read-only view fields added to the portalCredentialtype, nothing is written back. - Security: no global
fetch; refresh goes through the existingapi.discoverProviderConnectionverb; the API key is not logged or placed in the identity string (secretRef/secretKeyare names only). No findings. - Portal: no vendored
portalkit/agentkitcopy edited;InlineNotificationis the existing portalkit component;.k-icon-action,.k-spin,.sr-onlyalready exist. The removed.agents-provider-connectedCSS has no remaining references. The design doc is updated and consistent with the code. One Note on test coverage. - Tests: new editor tests cover auto-discover on empty catalog, manual ID during refresh, failure retaining cache, and late-result discard on connection switch; the router/create-route tests were rewritten for the new post-save navigation.
Commands run
cd providers/agents/portal && npm ci: ok.npx vue-tsc --noEmit: clean.npx vitest run: 81 files, 1370 tests passed.hack/sync-portalkit.sh --verify: portalkit copies in sync.- Root
make build/vet/lint, Go tests,verify-codegen,verify-provider-contract,verify-boilerplate: not run, no Go, API, manifest or chart files changed. - e2e: not run. The change is confined to portal Vue/TS covered by the vitest suites above. I did not render it in a browser, so I did not independently confirm the Chromium evidence in the PR body. That body notes the cross-provider visual comparator timed out, and the new Connection name field and the removed Provider connected card are not listed in the rendered evidence.
| const result = await api.discoverProviderConnection(selectedConnection.value, request.signal) | ||
| if (!isCurrent()) return | ||
| if (!result?.ok) throw new Error('Could not refresh models. Check the provider connection and try again.') | ||
| refreshedModels.value = result.models ?? [] |
There was a problem hiding this comment.
Note: A successful refresh with no models erases the cached choices
modelOptions is refreshedModels ?? cachedModels, and this line sets refreshedModels to [] whenever the verb returns ok without a models array (or an empty one). The picker then loses the saved discovered options that the PR says are preserved. Only a failed refresh keeps them. Keep the cache when the response carries no list:
if (result.models?.length) refreshedModels.value = result.models| try { | ||
| const result = await api.discoverProviderConnection(selectedConnection.value, request.signal) | ||
| if (!isCurrent()) return | ||
| if (!result?.ok) throw new Error('Could not refresh models. Check the provider connection and try again.') |
There was a problem hiding this comment.
Note: Refresh failure drops the provider diagnostic
A non-ok result throws a fixed message, so the user never sees the sanitized technicalDiagnostic that discover() surfaces through presentModelProbeResult. A provider that does not support listing and a revoked key now read the same. Reuse the presenter so both paths report alike:
if (!result?.ok) throw new Error(presentModelProbeResult(result || { ok: false, latencyMS: 0 }, 'discover').error || 'Could not refresh models.')
| :initial-family="route.type === 'harness' ? 'harness' : 'chat'" | ||
| :select-connection="route.type === 'from-connection'" | ||
| :continue-add-model-after-provider-connect="continueAddModelAfterProviderConnect" | ||
| :continue-add-model-after-provider-connect="continueAddModelAfterProviderConnect || agentCredentialSetup?.family === 'chat'" |
There was a problem hiding this comment.
Note: Agent-creation handoff change has no test
agentCredentialSetup?.family === 'chat' makes the Agent setup detour continue into Add model, and credentialMatchesFamily (line 488) now rejects connections. create-routes.test.ts only asserts the add-credential event is emitted, and element-router.test.ts covers the Models-tab detour, so nothing exercises this App-level path. Add a shell test: start agent creation, choose add credential, connect a provider, expect Add model with the connection selected, save a model, and expect a return to the agent draft with that model chosen.
Summary
Verification