Skip to content

Commit bc9f0bc

Browse files
committed
test: build the surrogate-pair fixture from its code point
1 parent 497aa37 commit bc9f0bc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

packages/agent-core/test/session/session-advisor.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ describe('SessionAdvisor', () => {
208208
it('caps each advisory note at 500 code points', async () => {
209209
const fixture = await createFixture({ advisorAlias: 'advisor' });
210210
const steer = vi.spyOn(fixture.main.turn, 'steer').mockReturnValue(null);
211-
// Keep this character as a surrogate pair to test code-point slicing.
212-
const note = ` ${'a'.repeat(499)}𝐀extra `;
211+
// U+1D400 MATHEMATICAL BOLD CAPITAL A. Must stay a surrogate pair: this test
212+
// proves the cap slices by code point rather than by UTF-16 code unit.
213+
const surrogatePair = String.fromCodePoint(0x1d400);
214+
const note = ` ${'a'.repeat(499)}${surrogatePair}extra `;
213215
queueReview(fixture.scripted, note);
214216

215217
await runMainTurn(fixture.main);
@@ -221,7 +223,7 @@ describe('SessionAdvisor', () => {
221223
[
222224
{
223225
type: 'text',
224-
text: `<advisory>\nThe following notes are from a second reviewing model. Weigh them; do not blindly obey.\n- ${'a'.repeat(499)}𝐀\n</advisory>`,
226+
text: `<advisory>\nThe following notes are from a second reviewing model. Weigh them; do not blindly obey.\n- ${'a'.repeat(499)}${surrogatePair}\n</advisory>`,
225227
},
226228
],
227229
{ kind: 'hook_result', event: 'advisor' },

0 commit comments

Comments
 (0)