fix(agentctl): forwardAttachment journey uses explicit attachmentIds
Update runAttachmentForwardJourney to call platform.forwardAttachment with attachmentIds so headless forward works without source message lookup. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -4,6 +4,8 @@ Agent control plane for Pearcord — send the same IPC messages the UI sends, re
|
||||
|
||||
**Phase 659 (v0.8.638):** Added `runDmPollVoteJourney` to verify DM single-choice idempotent vote apply, multi-select, anonymous poll creation, pre-vote edit guard behavior, close-state vote blocking, DM poll deletion, thread-scoped poll voting in `dm_thread`, and no synthetic unread/mention bump from poll updates; smoke `test:agentctl-dm-poll-phase659`.
|
||||
|
||||
**Phase 665 batch 2 (v0.8.640):** `runAttachmentForwardJourney` uses `platform.forwardAttachment` with explicit `attachmentIds`; bundle `test:phase665-media-batch2`.
|
||||
|
||||
**Phase 665 (v0.8.640):** `runAttachmentLightboxJourney`, `runAttachmentMeshFetchJourney`, `runAttachmentForwardJourney`, `runGroupDmAttachmentQuotaJourney`, `runAttachmentSlowmodeBlockedJourney`; bundle `test:agentctl-phase665-attachments`.
|
||||
|
||||
**Phase 664 (v0.8.639):** `runVoiceNoteDmJourney`, `runVoiceNoteLockCancelJourney`, `runVoiceNoteSlowmodeBlockedJourney`, `runVoiceNoteMeshReplayJourney`, `runVoiceNoteGroupDmQuotaJourney`; bundle `test:agentctl-phase664-voice-notes`.
|
||||
|
||||
+14
-5
@@ -2402,22 +2402,31 @@ class HeadlessSession {
|
||||
mimeType: 'image/png'
|
||||
})
|
||||
const sent = await this.sendGuildMessageWithAttachments('origin', [row.id])
|
||||
const buf = await this.platform.readAttachmentBytes(row.id)
|
||||
const chB = await this.createGuildChannel('forward-target')
|
||||
if (!chB?.id || chB.id === chA) throw new Error('expected distinct target channel')
|
||||
let forwarded
|
||||
if (this.platform.forwardAttachment) {
|
||||
forwarded = await this.platform.forwardAttachment({
|
||||
messageId: sent.id,
|
||||
targetChannelId: chB.id,
|
||||
attachmentIds: [row.id]
|
||||
})
|
||||
} else {
|
||||
const buf = await this.platform.readAttachmentBytes(row.id)
|
||||
const restaged = await this.stageGuildAttachment({
|
||||
data: buf,
|
||||
filename: 'forwarded.png',
|
||||
mimeType: 'image/png'
|
||||
})
|
||||
const forwarded = await this.sendGuildMessageWithAttachments('forwarded copy', [restaged.id])
|
||||
if (!forwarded?.id) throw new Error('expected forwarded message')
|
||||
forwarded = { message: await this.sendGuildMessageWithAttachments('forwarded copy', [restaged.id]) }
|
||||
}
|
||||
if (!forwarded?.message?.id) throw new Error('expected forwarded message')
|
||||
const v = await this.refreshView()
|
||||
const atts = v.attachmentsByMessage?.[forwarded.id] || []
|
||||
const atts = v.attachmentsByMessage?.[forwarded.message.id] || []
|
||||
if (!atts.length) throw new Error('expected attachment on forwarded message')
|
||||
return {
|
||||
sourceMessageId: sent.id,
|
||||
forwardedMessageId: forwarded.id,
|
||||
forwardedMessageId: forwarded.message.id,
|
||||
targetChannelId: chB.id
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user