Skip to content

Commit 77bcbd6

Browse files
author
Petrus Pennanen
committed
tests: port #71's wire-format assertion - payload.reply_to is always a STRING id
1 parent 82f5d07 commit 77bcbd6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎test/reply-context.test.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('reply-context (shared by both pollers)', () => {
99
assert.equal(replyIdOf('abc'), 'abc');
1010
assert.equal(replyIdOf({ id: 'abc', from: 'x' }), 'abc');
1111
assert.equal(replyIdOf({ id: 123 }), '123');
12+
assert.equal(typeof replyIdOf({ id: 123 }), 'string');
1213
assert.equal(replyIdOf(null), null);
1314
assert.equal(replyIdOf(undefined), null);
1415
assert.equal(replyIdOf(''), null);

‎test/unified-poller.test.mjs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ describe('groupmind reply targets', () => {
177177
it('handles the OBJECT form of reply_to (server stores what clients POST)', () => {
178178
const objReply = { ...reply, reply_to: { id: 'aaa', from: '@claudeMB', body: 'the AgentOS fleet message' } };
179179
const ev = groupmindAdapter.normalize(objReply, { poller: { handle: '@test' } });
180+
// Ported from #71 (claudemm): object-form input must yield the id as a
181+
// STRING, so no consumer ever branches on the wire format.
182+
assert.equal(typeof ev.payload.reply_to, 'string');
180183
assert.equal(ev.payload.reply_to, 'aaa');
181184
assert.equal(ev.payload.reply_target.from, '@claudeMB');
182185
const line = groupmindAdapter.formatLine(ev);

0 commit comments

Comments
 (0)