fix(agent): address readiness review findings

Tighten shared-agent readiness checks, surface not-ready toasts in the
selector, validate chat-model overrides in resolveChatModelID, and
improve configure deep-links for shared agents.
This commit is contained in:
wizardchen
2026-06-25 21:42:13 +08:00
committed by lyingbug
parent 9ca4e1f23a
commit 47478491c9
8 changed files with 177 additions and 26 deletions
@@ -92,3 +92,11 @@ test('getAgentNotReadyReasonKeys requires rerank only in agent mode with KB sear
{ isAgentMode: true, isSharedAgent: false },
), ['summary_model', 'rerank_model'])
})
test('getAgentNotReadyReasonKeys does not treat current shared context as shared without sourceTenantId', () => {
assert.deepEqual(getAgentNotReadyReasonKeys(
{ model_id: 'deleted-chat' },
[{ id: 'chat-1', type: 'KnowledgeQA' }],
{ isAgentMode: false, isSharedAgent: false },
), ['summary_model'])
})
+12
View File
@@ -0,0 +1,12 @@
/** Locale-aware conjunction for short UI lists (e.g. missing config items). */
export function formatLocalizedList(items: string[], locale = 'en-US'): string {
if (items.length === 0) return ''
if (typeof Intl !== 'undefined' && typeof Intl.ListFormat !== 'undefined') {
try {
return new Intl.ListFormat(locale, { style: 'long', type: 'conjunction' }).format(items)
} catch {
// Unsupported locale — fall through.
}
}
return items.join(', ')
}