fix: polish reply threading + tool dedupe (thanks @mneves75) (#326)
This commit is contained in:
@@ -226,6 +226,8 @@ export type EmbeddedPiRunResult = {
|
||||
// True if a messaging tool (telegram, whatsapp, discord, slack, sessions_send)
|
||||
// successfully sent a message. Used to suppress agent's confirmation text.
|
||||
didSendViaMessagingTool?: boolean;
|
||||
// Texts successfully sent via messaging tools during the run.
|
||||
messagingToolSentTexts?: string[];
|
||||
};
|
||||
|
||||
export type EmbeddedPiCompactResult = {
|
||||
@@ -1253,6 +1255,7 @@ export async function runEmbeddedPiAgent(params: {
|
||||
toolMetas,
|
||||
unsubscribe,
|
||||
waitForCompactionRetry,
|
||||
getMessagingToolSentTexts,
|
||||
didSendViaMessagingTool,
|
||||
} = subscription;
|
||||
|
||||
@@ -1536,6 +1539,7 @@ export async function runEmbeddedPiAgent(params: {
|
||||
aborted,
|
||||
},
|
||||
didSendViaMessagingTool: didSendViaMessagingTool(),
|
||||
messagingToolSentTexts: getMessagingToolSentTexts(),
|
||||
};
|
||||
} finally {
|
||||
restoreSkillEnv?.();
|
||||
|
||||
@@ -778,6 +778,7 @@ export function subscribeEmbeddedPiSession(params: {
|
||||
toolMetas,
|
||||
unsubscribe,
|
||||
isCompacting: () => compactionInFlight || pendingCompactionRetry > 0,
|
||||
getMessagingToolSentTexts: () => messagingToolSentTexts.slice(),
|
||||
// Returns true if any messaging tool successfully sent a message.
|
||||
// Used to suppress agent's confirmation text (e.g., "Respondi no Telegram!")
|
||||
// which is generated AFTER the tool sends the actual answer.
|
||||
|
||||
Reference in New Issue
Block a user