feat: ship agent-first mission control v0.2.57
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
buildTaskAgentOptions,
|
||||
taskAgentLabel,
|
||||
} from '../src/utils/taskAgentOptions'
|
||||
|
||||
describe('live task assignee options', () => {
|
||||
it('combines only local assignment concepts with the live OpenClaw inventory', () => {
|
||||
const options = buildTaskAgentOptions([
|
||||
{ id: 'iris', name: 'Iris' },
|
||||
{ id: 'new-specialist', name: 'New Specialist' },
|
||||
])
|
||||
|
||||
expect(options).toEqual([
|
||||
{ id: '', label: 'Nicht zugewiesen' },
|
||||
{ id: 'bao', label: 'Bao' },
|
||||
{ id: 'iris', label: 'Iris' },
|
||||
{ id: 'new-specialist', label: 'New Specialist' },
|
||||
])
|
||||
expect(options.some(option => option.id === 'programmer')).toBe(false)
|
||||
})
|
||||
|
||||
it('preserves a persisted unknown assignee while OpenClaw is disconnected', () => {
|
||||
const options = buildTaskAgentOptions([], ['retired-agent'])
|
||||
|
||||
expect(options).toContainEqual({
|
||||
id: 'retired-agent',
|
||||
label: 'retired-agent',
|
||||
})
|
||||
expect(taskAgentLabel('retired-agent', options)).toBe('retired-agent')
|
||||
})
|
||||
|
||||
it('prefers the live display name for an already persisted agent id', () => {
|
||||
const options = buildTaskAgentOptions(
|
||||
[{ id: 'product-owner', name: 'Product Owner' }],
|
||||
['product-owner'],
|
||||
)
|
||||
|
||||
expect(taskAgentLabel('product-owner', options)).toBe('Product Owner')
|
||||
expect(options.filter(option => option.id === 'product-owner')).toHaveLength(1)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user