Skip to content

Commit b2894bf

Browse files
authored
Merge pull request #2467 from nanocoai/Koshkoshinsk/fix/welcome-duplicate-message
fix(welcome): stop emitting the greeting twice
2 parents b779a0b + ca52d2c commit b2894bf

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

container/agent-runner/src/destinations.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ describe('buildSystemPromptAddendum — multi-destination routing guidance', ()
2727

2828
const prompt = buildSystemPromptAddendum('Casa');
2929

30-
expect(prompt).toContain('Default routing');
30+
expect(prompt).toContain('default to addressing the destination it came `from`');
3131
expect(prompt).toContain('from="name"');
3232
expect(prompt).toContain('`casa`');
3333
expect(prompt).toContain('`whatsapp-mg-17780`');
3434
});
3535

36-
it('requires explicit wrapping even for a single destination', () => {
36+
it('describes message wrapping for a single destination', () => {
3737
seedDestination('casa', 'Casa', 'whatsapp', 'group-1@g.us');
3838

3939
const prompt = buildSystemPromptAddendum('Casa');
4040

41-
expect(prompt).toContain('All output must be wrapped');
41+
expect(prompt).toContain('Wrap each delivered message');
4242
expect(prompt).toContain('<message to="name">');
4343
expect(prompt).toContain('`casa`');
4444
});
@@ -47,17 +47,17 @@ describe('buildSystemPromptAddendum — multi-destination routing guidance', ()
4747
const prompt = buildSystemPromptAddendum('Casa');
4848

4949
expect(prompt).toContain('no configured destinations');
50-
expect(prompt).not.toContain('Default routing');
50+
expect(prompt).not.toContain('default to addressing');
5151
});
5252

5353
it('includes default-routing and wrapping instructions for single destination', () => {
5454
seedDestination('casa', 'Casa', 'whatsapp', 'group-1@g.us');
5555

5656
const prompt = buildSystemPromptAddendum('Casa');
5757

58-
expect(prompt).toContain('All output must be wrapped');
58+
expect(prompt).toContain('Wrap each delivered message');
5959
expect(prompt).toContain('<message to="name">');
60-
expect(prompt).toContain('Default routing');
60+
expect(prompt).toContain('default to addressing the destination it came `from`');
6161
expect(prompt).toContain('`casa`');
6262
});
6363
});

container/agent-runner/src/destinations.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ function buildDestinationsSection(): string {
115115
}
116116
}
117117
lines.push('');
118-
lines.push('**All output must be wrapped.** Use `<message to="name">...</message>` for content to send, or `<internal>...</internal>` for scratchpad.');
119-
lines.push('You can include multiple `<message>` blocks in one response to send to multiple destinations.');
120-
lines.push('Bare text (outside of `<message>` or `<internal>` blocks) is not allowed and will not be delivered.');
118+
lines.push(
119+
'Wrap each delivered message in a `<message to="name">…</message>` block; include several blocks in one response to address several destinations. `<internal>…</internal>` marks thinking you don\'t want sent — anything outside these tags is also treated as scratchpad.',
120+
);
121121
lines.push('');
122122
lines.push(
123-
'**Default routing**: when replying to an incoming message, address the same destination the message came `from` every inbound `<message>` tag carries a `from="name"` attribute that names the origin destination. Only address a different destination when the request itself asks you to (e.g., "tell Laura that…").',
123+
'When replying to an incoming message, default to addressing the destination it came `from` (every inbound `<message>` tag carries a `from="name"` attribute). Pick a different destination when the request asks for it (e.g., "tell Laura that…").',
124124
);
125125
lines.push('');
126126
lines.push(
127-
'To send a message mid-response (e.g., an acknowledgment before a long task), call the `send_message` MCP tool with the `to` parameter set to a destination name.',
127+
'The `send_message` MCP tool is the same delivery, available mid-turn — handy for a quick acknowledgment ("on it") before a slow tool call. Each `send_message` call and each final-response `<message>` block lands as its own message in the conversation, so they read as a sequence rather than as one combined reply.',
128128
);
129129
return lines.join('\n');
130130
}

container/skills/welcome/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You've just been connected to a new user. This your time to shine and make a str
99

1010
## What to do
1111

12-
1. Send a short, warm greeting using `send_message`
12+
1. Send a short, warm greeting
1313
2. State your name (from your system prompt / CLAUDE.md)
1414
3. Signal that you're capable of a lot — but don't list everything upfront. Be intriguing, not encyclopedic
1515
4. Ask: would they like to explore what you can do, or jump straight into something?

0 commit comments

Comments
 (0)