refactor(agent): remove implicit agent mention trigger in comment threads

This commit is contained in:
yiling
2026-07-27 14:49:41 +08:00
parent 9bfa174348
commit bb71e6bb2a
9 changed files with 10 additions and 106 deletions
@@ -14,7 +14,6 @@ export class AgentChatPromptBuilder {
private totalPages?: number
private commentTimestamp?: number
private pathContext?: string
private explicitMention = false
private attachedFiles: string[] = []
private referencedAssets: string[] = []
private userInfo?: { name: string; role: string }
@@ -84,11 +83,6 @@ export class AgentChatPromptBuilder {
return this
}
withExplicitMention(explicitMention?: boolean): this {
this.explicitMention = !!explicitMention
return this
}
build(): string {
const effectiveType = this.proxyType
@@ -180,12 +174,6 @@ export class AgentChatPromptBuilder {
}
}
if (this.explicitMention) {
instruction += `\n\nThe user explicitly mentioned you in their message. You MUST reply to this message.`
} else {
instruction += `\n\nThe user did not explicitly mention you, but is replying in a thread where you are the participant. Let's decide if you should reply or not. If the user is not directly addressing you or doesn't need a response from you, you may choose to not reply. To choose not to reply, respond with exactly and only the text: __NO_REPLY__.`
}
if (this.userInfo) {
instruction += `\n\nUser Info:\nName: ${this.userInfo.name}\nRole: ${this.userInfo.role}`
}