mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
fix(goal,ui): gate inline prompt by real long-task signal; soften copy
This commit is contained in:
parent
34175ab94d
commit
2a1b8cbcbf
@ -3664,7 +3664,7 @@ export default {
|
||||
goBack: 'Go back',
|
||||
},
|
||||
goal: {
|
||||
inlinePrompt: 'Looks like this spans several turns. Set it as a goal so I can track it?',
|
||||
inlinePrompt: 'Want me to track this as a goal?',
|
||||
inlinePromptAccept: 'Yes',
|
||||
inlinePromptDecline: 'No thanks',
|
||||
autoFollowup: 'Auto continuation',
|
||||
|
||||
@ -3756,7 +3756,7 @@ export default {
|
||||
goBack: '返回上一页',
|
||||
},
|
||||
goal: {
|
||||
inlinePrompt: '看起来这要跨好几轮。设为目标,我帮你跟着?',
|
||||
inlinePrompt: '这件事要不要设成目标,我帮你跟着?',
|
||||
inlinePromptAccept: '好',
|
||||
inlinePromptDecline: '不用',
|
||||
autoFollowup: '自动延续',
|
||||
|
||||
@ -1094,7 +1094,26 @@ const showGoalSetPrompt = computed(() => {
|
||||
// Need at least one user → assistant exchange so the prompt has
|
||||
// context to derive a suggested title from.
|
||||
const hasAssistantReply = messages.value.some(m => m.role === 'assistant')
|
||||
return hasAssistantReply
|
||||
if (!hasAssistantReply) return false
|
||||
// Heuristic: don't claim "this looks multi-turn" without evidence. Fire
|
||||
// the prompt only when at least one signal of a real ongoing task is
|
||||
// present. Without these the prompt fires after one-shot Q&A like
|
||||
// "三句话告诉我 X" and the copy lies to the user.
|
||||
const userTurns = messages.value.filter(m => m.role === 'user').length
|
||||
if (userTurns >= 2) return true // multiple user messages = ongoing thread
|
||||
// Single-turn case: only suggest if the agent did non-trivial work.
|
||||
return messages.value.some(m => {
|
||||
if (m.role !== 'assistant') return false
|
||||
const md: any = (m as any).metadata
|
||||
if (!md) return false
|
||||
// Tool calls — strongest signal of real work.
|
||||
if (Array.isArray(md.toolCalls) && md.toolCalls.length > 0) return true
|
||||
// Plan steps — Plan-Execute agent ran a multi-step plan.
|
||||
if (md.plan && Array.isArray(md.plan.steps) && md.plan.steps.length > 1) return true
|
||||
// Multiple ReAct iterations / segments — agent looped.
|
||||
if (Array.isArray(md.segments) && md.segments.length > 3) return true
|
||||
return false
|
||||
})
|
||||
})
|
||||
|
||||
// Build a sensible default title from the conversation's first user
|
||||
|
||||
Loading…
Reference in New Issue
Block a user