feat: 完成第二版类型清理

This commit is contained in:
claude-code-best
2026-03-31 23:03:47 +08:00
parent 4c0a655a1c
commit d7a729ca68
604 changed files with 595 additions and 953 deletions

View File

@@ -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(' ')

View File

@@ -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,