refactor: dedupe enforceFinalTag resolution
This commit is contained in:
@@ -189,6 +189,9 @@ const appendUsageLine = (
|
||||
return updated;
|
||||
};
|
||||
|
||||
const resolveEnforceFinalTag = (run: FollowupRun["run"], provider: string) =>
|
||||
Boolean(run.enforceFinalTag || isReasoningTagProvider(provider));
|
||||
|
||||
export async function runReplyAgent(params: {
|
||||
commandBody: string;
|
||||
followupRun: FollowupRun;
|
||||
@@ -412,9 +415,7 @@ export async function runReplyAgent(params: {
|
||||
prompt: memoryFlushSettings.prompt,
|
||||
extraSystemPrompt: flushSystemPrompt,
|
||||
ownerNumbers: followupRun.run.ownerNumbers,
|
||||
enforceFinalTag:
|
||||
followupRun.run.enforceFinalTag ||
|
||||
isReasoningTagProvider(provider),
|
||||
enforceFinalTag: resolveEnforceFinalTag(followupRun.run, provider),
|
||||
provider,
|
||||
model,
|
||||
authProfileId: followupRun.run.authProfileId,
|
||||
@@ -662,9 +663,10 @@ export async function runReplyAgent(params: {
|
||||
prompt: commandBody,
|
||||
extraSystemPrompt: followupRun.run.extraSystemPrompt,
|
||||
ownerNumbers: followupRun.run.ownerNumbers,
|
||||
enforceFinalTag:
|
||||
followupRun.run.enforceFinalTag ||
|
||||
isReasoningTagProvider(provider),
|
||||
enforceFinalTag: resolveEnforceFinalTag(
|
||||
followupRun.run,
|
||||
provider,
|
||||
),
|
||||
provider,
|
||||
model,
|
||||
authProfileId: followupRun.run.authProfileId,
|
||||
|
||||
Reference in New Issue
Block a user