mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
feat: 完成第二版类型清理
This commit is contained in:
@@ -15,16 +15,16 @@ function isCompletedBackgroundBash(
|
||||
msg: RenderableMessage,
|
||||
): msg is NormalizedUserMessage {
|
||||
if (msg.type !== 'user') return false
|
||||
const content = msg.message.content[0]
|
||||
if (content?.type !== 'text') return false
|
||||
if (!content.text.includes(`<${TASK_NOTIFICATION_TAG}`)) return false
|
||||
const content0 = Array.isArray(msg.message.content) ? msg.message.content[0] : undefined
|
||||
if (!content0 || typeof content0 === 'string' || content0?.type !== 'text') return false
|
||||
if (!content0.text.includes(`<${TASK_NOTIFICATION_TAG}`)) return false
|
||||
// Only collapse successful completions — failed/killed stay visible individually.
|
||||
if (extractTag(content.text, STATUS_TAG) !== 'completed') return false
|
||||
if (extractTag(content0.text, STATUS_TAG) !== 'completed') return false
|
||||
// The prefix constant distinguishes bash-kind LocalShellTask completions from
|
||||
// agent/workflow/monitor notifications. Monitor-kind completions have their
|
||||
// own summary wording and deliberately don't collapse here.
|
||||
return (
|
||||
extractTag(content.text, SUMMARY_TAG)?.startsWith(
|
||||
extractTag(content0.text, SUMMARY_TAG)?.startsWith(
|
||||
BACKGROUND_BASH_SUMMARY_PREFIX,
|
||||
) ?? false
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user