mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
fix(agent): reject send tool when targeting the same conversation
Pass replyTarget through the full pipeline (ChatRequest → gateway identity → agent headers → MCP session) so the send tool can detect when the destination matches the current conversation and return an error guiding the agent to reply directly instead.
This commit is contained in:
@@ -9,6 +9,7 @@ export interface IdentityContext {
|
||||
channelIdentityId: string
|
||||
displayName: string
|
||||
currentPlatform?: string
|
||||
replyTarget?: string
|
||||
conversationType?: string
|
||||
sessionToken?: string
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ export const buildIdentityHeaders = (identity: IdentityContext, auth: AgentAuthC
|
||||
if (identity.currentPlatform) {
|
||||
headers['X-Memoh-Current-Platform'] = identity.currentPlatform
|
||||
}
|
||||
if (identity.replyTarget) {
|
||||
headers['X-Memoh-Reply-Target'] = identity.replyTarget
|
||||
}
|
||||
if (options?.isSubagent) {
|
||||
headers['X-Memoh-Is-Subagent'] = 'true'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user