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:
@@ -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'])
|
||||
})
|
||||
|
||||
@@ -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(', ')
|
||||
}
|
||||
Reference in New Issue
Block a user