Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/adapters/groupmind.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ export const groupmindAdapter = {

normalize(msg, config) {
const sender = msg.from || msg.sender || '?';
const body = (msg.body || '').slice(0, 500);
let body = (msg.body || '').slice(0, 500);
// Surface every attachment kind. 2026-07-19: petrus posted a screenshot
// that never reached the agent (bodies-only extraction) and got asked to
// re-post it - an attachment must never be invisible.
if (msg.image_url) body += ` [IMAGE ATTACHED: ${msg.image_url}]`;
if (msg.audio_url) body += ` [AUDIO ATTACHED: ${msg.audio_url}]`;
if (msg.file_url) body += ` [FILE ATTACHED: ${msg.file_name || msg.file_url}]`;
Comment on lines +61 to +63

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the GroupMind adapter imported by the CLI

When users run the documented ide-agent-kit platform watch --adapters groupmind path, bin/cli.mjs imports src/team-relay/adapters/groupmind.mjs, not this adapter. That production adapter remains unchanged and its normalize() still discards image_url, audio_url, and file_url, so attachments remain invisible in the unified CLI poller while the new test passes only against an unused duplicate.

Useful? React with 👍 / 👎.

Comment on lines +61 to +63

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve attachment markers through notification truncation

For any message whose caption is at least 200 characters, these markers are appended after the caption and then removed by formatLine()'s 200-character slice; the legacy poller applies the same slice when constructing its notification line. Since rooms check consumes those notification lines, the attachment is still invisible in precisely that input scenario despite being present in the structured queue.

Useful? React with 👍 / 👎.

const ts = msg.created_at || new Date().toISOString();
const room = msg._room || '';

Expand Down
7 changes: 6 additions & 1 deletion src/team-relay/room-poller.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ export async function startRoomPoller({ rooms, apiKey, handle, interval, config,
if (normalizedSender === ownerHandle) hasOwnerMessage = true;
if ((m.body || '').toLowerCase().includes(mentionNeedle)) hasMention = true;

const body = (m.body || '').slice(0, 500);
let body = (m.body || '').slice(0, 500);
// Surface attachments (2026-07-19 lost-screenshot lesson): an
// image/audio/file must never be invisible to the agent.
if (m.image_url) body += ` [IMAGE ATTACHED: ${m.image_url}]`;
if (m.audio_url) body += ` [AUDIO ATTACHED: ${m.audio_url}]`;
if (m.file_url) body += ` [FILE ATTACHED: ${m.file_name || m.file_url}]`;
const ts = m.created_at || new Date().toISOString();

// Write to structured queue
Expand Down
17 changes: 17 additions & 0 deletions test/unified-poller.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,20 @@ describe('groupmind reply targets', () => {
assert.ok(!line.includes('\n'), line);
});
});

describe('groupmind attachment surfacing', () => {
// 2026-07-19: a posted screenshot never reached the agent (bodies-only
// extraction) and petrus was asked to re-post it. Never again.
it('normalize appends image/audio/file labels to the body', () => {
const base = { id: 'x', from: 'petrus', created_at: '2026-08-27T09:00:00Z', _room: 'r' };
const cfg = { poller: { handle: '@test' } };
const img = groupmindAdapter.normalize({ ...base, body: 'look', image_url: 'https://x/i.jpg' }, cfg);
assert.ok(img.payload.body.includes('[IMAGE ATTACHED: https://x/i.jpg]'), img.payload.body);
const aud = groupmindAdapter.normalize({ ...base, body: 'listen', audio_url: 'https://x/a.ogg' }, cfg);
assert.ok(aud.payload.body.includes('[AUDIO ATTACHED: https://x/a.ogg]'), aud.payload.body);
const fil = groupmindAdapter.normalize({ ...base, body: 'take', file_url: 'https://x/f.bin', file_name: 'f.bin' }, cfg);
assert.ok(fil.payload.body.includes('[FILE ATTACHED: f.bin]'), fil.payload.body);
const plain = groupmindAdapter.normalize({ ...base, body: 'no extras' }, cfg);
assert.ok(!plain.payload.body.includes('ATTACHED'), plain.payload.body);
});
});
Loading