mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
feat: 完成第二版类型清理
This commit is contained in:
@@ -113,7 +113,7 @@ function extractConversationContext(
|
||||
|
||||
for (const msg of assistantMessages.reverse()) {
|
||||
// Extract text content from assistant message
|
||||
const textBlocks = msg.message.content
|
||||
const textBlocks = (Array.isArray(msg.message.content) ? msg.message.content : [])
|
||||
.filter(c => c.type === 'text')
|
||||
.map(c => ('text' in c ? c.text : ''))
|
||||
.join(' ')
|
||||
|
||||
@@ -343,7 +343,7 @@ export function buildTranscriptEntries(messages: Message[]): TranscriptEntry[] {
|
||||
for (const block of msg.message.content) {
|
||||
// Only include tool_use blocks — assistant text is model-authored
|
||||
// and could be crafted to influence the classifier's decision.
|
||||
if (block.type === 'tool_use') {
|
||||
if (typeof block !== 'string' && block.type === 'tool_use') {
|
||||
blocks.push({
|
||||
type: 'tool_use',
|
||||
name: block.name,
|
||||
|
||||
Reference in New Issue
Block a user