Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1242,20 +1242,6 @@ export default function ProjectSessionDetailPage({
// LEGACY: Old handleInterrupt removed - now using aguiInterrupt from useAGUIStream
// which calls the proper AG-UI interrupt endpoint that signals Claude SDK

const handleEndSession = () => {
// Use stop API to end the session
stopMutation.mutate(
{ projectName, sessionName, data: { reason: "end_session" } },
{
onSuccess: () => successToast("Session ended successfully"),
onError: (err) =>
errorToast(
err instanceof Error ? err.message : "Failed to end session",
),
},
);
};

// Duration calculation removed - startTime/completionTime no longer in status
const durationMs = undefined;

Expand Down Expand Up @@ -1904,7 +1890,6 @@ export default function ProjectSessionDetailPage({
setChatInput={setChatInput}
onSendChat={() => Promise.resolve(sendChat())}
onInterrupt={aguiInterrupt}
onEndSession={() => Promise.resolve(handleEndSession())}
onGoToResults={() => {}}
onContinue={handleContinue}
workflowMetadata={workflowMetadata}
Expand Down
30 changes: 5 additions & 25 deletions components/frontend/src/components/session/MessagesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export type MessagesTabProps = {
setChatInput: (v: string) => void;
onSendChat: () => Promise<void>;
onInterrupt: () => Promise<void>;
onEndSession: () => Promise<void>;
onGoToResults?: () => void;
onContinue: () => void;
workflowMetadata?: WorkflowMetadata;
Expand All @@ -39,9 +38,8 @@ export type MessagesTabProps = {
};


const MessagesTab: React.FC<MessagesTabProps> = ({ session, streamMessages, chatInput, setChatInput, onSendChat, onInterrupt, onEndSession, onGoToResults, onContinue, workflowMetadata, onCommandClick, isRunActive = false, showWelcomeExperience, welcomeExperienceComponent, activeWorkflow, userHasInteracted = false, queuedMessages = [], hasRealMessages = false }) => {
const MessagesTab: React.FC<MessagesTabProps> = ({ session, streamMessages, chatInput, setChatInput, onSendChat, onInterrupt, onGoToResults, onContinue, workflowMetadata, onCommandClick, isRunActive = false, showWelcomeExperience, welcomeExperienceComponent, activeWorkflow, userHasInteracted = false, queuedMessages = [], hasRealMessages = false }) => {
const [interrupting, setInterrupting] = useState(false);
const [ending, setEnding] = useState(false);
const [sendingChat, setSendingChat] = useState(false);
const [showSystemMessages, setShowSystemMessages] = useState(false);
const [agentsPopoverOpen, setAgentsPopoverOpen] = useState(false);
Expand Down Expand Up @@ -169,15 +167,6 @@ const MessagesTab: React.FC<MessagesTabProps> = ({ session, streamMessages, chat
}
};

const handleEndSession = async () => {
setEnding(true);
try {
await onEndSession();
} finally {
setEnding(false);
}
};

// Get filtered autocomplete items
const getFilteredItems = () => {
if (!autocompleteType) return [];
Expand Down Expand Up @@ -689,24 +678,15 @@ const MessagesTab: React.FC<MessagesTabProps> = ({ session, streamMessages, chat
Stop
</Button>
) : (
<Button
size="sm"
onClick={handleSendChat}
disabled={!chatInput.trim() || sendingChat || ending}
<Button
size="sm"
onClick={handleSendChat}
disabled={!chatInput.trim() || sendingChat}
>
{sendingChat && <Loader2 className="w-3 h-3 mr-1 animate-spin" />}
Send
</Button>
)}
<Button
variant="secondary"
size="sm"
onClick={handleEndSession}
disabled={ending || sendingChat || interrupting}
>
{ending && <Loader2 className="w-3 h-3 mr-1 animate-spin" />}
End session
</Button>
</div>
</div>
</div>
Expand Down
Loading