💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
@@ -270,7 +270,7 @@ function CodeBlockWithCopy({ part, index, copiedIdx, setCopiedIdx }) {
|
||||
)
|
||||
}
|
||||
|
||||
function FeedItem({ msg }) {
|
||||
function FeedItem({ msg, activeAgents, onModeChange }) {
|
||||
const isUser = msg.role === 'user'
|
||||
const isSystem = msg.role === 'system'
|
||||
const rank = getRank(msg.role)
|
||||
@@ -352,7 +352,7 @@ function FeedItem({ msg }) {
|
||||
const result = r && (r.content !== undefined || r.is_error !== undefined)
|
||||
? { content: r.content, is_error: r.is_error }
|
||||
: null
|
||||
return <ToolCallBlock key={`tc${i}`} call={seg.call} result={result} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
return <ToolCallBlock key={`tc${i}`} call={seg.call} result={result} activeAgents={activeAgents} onModeChange={onModeChange} />
|
||||
}
|
||||
return null
|
||||
})
|
||||
@@ -365,7 +365,7 @@ function FeedItem({ msg }) {
|
||||
const result = resultData
|
||||
? { content: resultData.result, is_error: resultData.is_error }
|
||||
: null
|
||||
return <ToolCallBlock key={tc.tool_call_id || i} call={tc} result={result} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
return <ToolCallBlock key={tc.tool_call_id || i} call={tc} result={result} activeAgents={activeAgents} onModeChange={onModeChange} />
|
||||
})}
|
||||
{cleanContent && (
|
||||
<div className="feed-content">
|
||||
@@ -385,7 +385,7 @@ function FeedItem({ msg }) {
|
||||
)
|
||||
}
|
||||
|
||||
function StreamingItem({ content, thinking, toolCalls, segments }) {
|
||||
function StreamingItem({ content, thinking, toolCalls, segments, activeAgents, onModeChange }) {
|
||||
const rank = RANKS.general
|
||||
const cleanContent = content.replace(/<think[^>]*>[\s\S]*?<\/think>/gi, '')
|
||||
const hasToolCalls = toolCalls && toolCalls.length > 0
|
||||
@@ -434,14 +434,14 @@ function StreamingItem({ content, thinking, toolCalls, segments }) {
|
||||
)
|
||||
}
|
||||
if (seg.type === 'tool') {
|
||||
return <ToolCallBlock key={`tc${i}`} call={seg.call} result={seg.result} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
return <ToolCallBlock key={`tc${i}`} call={seg.call} result={seg.result} activeAgents={activeAgents} onModeChange={onModeChange} />
|
||||
}
|
||||
return null
|
||||
})
|
||||
) : (
|
||||
<>
|
||||
{hasToolCalls && toolCalls.map((tc, i) => (
|
||||
<ToolCallBlock key={tc.call?.tool_call_id || i} call={tc.call} result={tc.result} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
<ToolCallBlock key={tc.call?.tool_call_id || i} call={tc.call} result={tc.result} activeAgents={activeAgents} onModeChange={onModeChange} />
|
||||
))}
|
||||
{cleanContent && (
|
||||
<div className="feed-content">
|
||||
@@ -882,7 +882,7 @@ export default function Studio({ api }) {
|
||||
<span className="feed-summary-toggle">{summarizedExpanded ? 'masquer' : 'voir'}</span>
|
||||
</div>
|
||||
{summarizedExpanded && summarizedMsgs.map(msg => (
|
||||
<FeedItem key={msg.id} msg={msg} />
|
||||
<FeedItem key={msg.id} msg={msg} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
@@ -894,7 +894,7 @@ export default function Studio({ api }) {
|
||||
<>
|
||||
{renderSummaryBlock()}
|
||||
{activeMsgs.slice(0, visibleCount).map(msg => (
|
||||
<FeedItem key={msg.id} msg={msg} />
|
||||
<FeedItem key={msg.id} msg={msg} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
))}
|
||||
<div className="feed-collapsed-messages" onClick={handleToggleCollapsed}>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
@@ -911,7 +911,7 @@ export default function Studio({ api }) {
|
||||
<>
|
||||
{renderSummaryBlock()}
|
||||
{activeMsgs.map(msg => (
|
||||
<FeedItem key={msg.id} msg={msg} />
|
||||
<FeedItem key={msg.id} msg={msg} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
))}
|
||||
</>
|
||||
)
|
||||
@@ -935,7 +935,7 @@ export default function Studio({ api }) {
|
||||
<div className="studio-feed" ref={feedRef}>
|
||||
{renderMessages()}
|
||||
{(streaming || streamThinking || loading || streamToolCalls.length > 0) && (
|
||||
<StreamingItem content={streaming} thinking={streamThinking} toolCalls={streamToolCalls} segments={streamSegments} />
|
||||
<StreamingItem content={streaming} thinking={streamThinking} toolCalls={streamToolCalls} segments={streamSegments} activeAgents={activeAgents} onModeChange={handleToolModeChange} />
|
||||
)}
|
||||
<div ref={messagesEnd} style={{ height: '24px' }} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user