fix: continue to use resumed session after confirmation is cancelled (#1548)

This commit is contained in:
Yingjie He
2025-03-06 16:51:31 -08:00
committed by GitHub
parent 6cb6e1d918
commit fb444728f0
5 changed files with 82 additions and 25 deletions
@@ -9,11 +9,13 @@ import { Content, ToolRequestMessageContent, ToolResponseMessageContent } from '
import { snakeToTitleCase } from '../utils';
interface ToolCallWithResponseProps {
isCancelledMessage: boolean;
toolRequest: ToolRequestMessageContent;
toolResponse?: ToolResponseMessageContent;
}
export default function ToolCallWithResponse({
isCancelledMessage,
toolRequest,
toolResponse,
}: ToolCallWithResponseProps) {
@@ -27,17 +29,19 @@ export default function ToolCallWithResponse({
<div className="w-full">
<Card className="">
<ToolCallView toolCall={toolCall} />
{toolResponse ? (
<ToolResultView
result={
toolResponse.toolResult.status === 'success'
? toolResponse.toolResult.value
: undefined
}
/>
) : (
<LoadingPlaceholder />
)}
{!isCancelledMessage ? (
toolResponse ? (
<ToolResultView
result={
toolResponse.toolResult.status === 'success'
? toolResponse.toolResult.value
: undefined
}
/>
) : (
<LoadingPlaceholder />
)
) : undefined}
</Card>
</div>
);