feat: configurable displayName prefix for agent messages in group chats (#255)
Add optional displayName field to agent config. When set, outbound agent responses are prefixed (e.g. "💜 Signo: Hello!"). Useful in multi-agent group chats where multiple bots share a channel and users need to tell them apart. Closes #252 Written by Cameron ◯ Letta Code "The details are not the details. They make the design." -- Charles Eames
This commit is contained in:
@@ -332,4 +332,46 @@ describe('normalizeAgents', () => {
|
||||
expect(agents[0].polling).toEqual(config.polling);
|
||||
expect(agents[0].integrations).toEqual(config.integrations);
|
||||
});
|
||||
|
||||
it('should pass through displayName', () => {
|
||||
const config: LettaBotConfig = {
|
||||
server: { mode: 'cloud' },
|
||||
agent: {
|
||||
name: 'Signo',
|
||||
displayName: '💜 Signo',
|
||||
},
|
||||
channels: {
|
||||
telegram: { enabled: true, token: 'test-token' },
|
||||
},
|
||||
};
|
||||
|
||||
const agents = normalizeAgents(config);
|
||||
|
||||
expect(agents[0].displayName).toBe('💜 Signo');
|
||||
});
|
||||
|
||||
it('should pass through displayName in multi-agent config', () => {
|
||||
const agentsArray: AgentConfig[] = [
|
||||
{
|
||||
name: 'Signo',
|
||||
displayName: '💜 Signo',
|
||||
channels: { telegram: { enabled: true, token: 't1' } },
|
||||
},
|
||||
{
|
||||
name: 'DevOps',
|
||||
displayName: '👾 DevOps',
|
||||
channels: { discord: { enabled: true, token: 'd1' } },
|
||||
},
|
||||
];
|
||||
|
||||
const config = {
|
||||
server: { mode: 'cloud' as const },
|
||||
agents: agentsArray,
|
||||
} as LettaBotConfig;
|
||||
|
||||
const agents = normalizeAgents(config);
|
||||
|
||||
expect(agents[0].displayName).toBe('💜 Signo');
|
||||
expect(agents[1].displayName).toBe('👾 DevOps');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user