@@ -60,7 +60,11 @@ import {
6060 defaultGroupActivation ,
6161 resolveGroupRequireMention ,
6262} from "./reply/groups.js" ;
63- import { stripMentions , stripStructuralPrefixes } from "./reply/mentions.js" ;
63+ import {
64+ CURRENT_MESSAGE_MARKER ,
65+ stripMentions ,
66+ stripStructuralPrefixes ,
67+ } from "./reply/mentions.js" ;
6468import {
6569 createModelSelectionState ,
6670 resolveContextTokens ,
@@ -429,7 +433,6 @@ export async function getReplyFromConfig(
429433 hasQueueDirective : false ,
430434 queueReset : false ,
431435 } ;
432- const marker = "[Current message - respond to this]" ;
433436 const existingBody = sessionCtx . BodyStripped ?? sessionCtx . Body ?? "" ;
434437 const cleanedBody = ( ( ) => {
435438 if ( ! existingBody ) return parsedDirectives . cleaned ;
@@ -439,15 +442,20 @@ export async function getReplyFromConfig(
439442 } ) . cleaned ;
440443 }
441444
442- const markerIndex = existingBody . indexOf ( marker ) ;
445+ const markerIndex = existingBody . indexOf ( CURRENT_MESSAGE_MARKER ) ;
443446 if ( markerIndex < 0 ) {
444447 return parseInlineDirectives ( existingBody , {
445448 modelAliases : configuredAliases ,
446449 } ) . cleaned ;
447450 }
448451
449- const head = existingBody . slice ( 0 , markerIndex + marker . length ) ;
450- const tail = existingBody . slice ( markerIndex + marker . length ) ;
452+ const head = existingBody . slice (
453+ 0 ,
454+ markerIndex + CURRENT_MESSAGE_MARKER . length ,
455+ ) ;
456+ const tail = existingBody . slice (
457+ markerIndex + CURRENT_MESSAGE_MARKER . length ,
458+ ) ;
451459 const cleanedTail = parseInlineDirectives ( tail , {
452460 modelAliases : configuredAliases ,
453461 } ) . cleaned ;
0 commit comments