Skip to content

Commit c499d1e

Browse files
committed
fixes
1 parent be6220a commit c499d1e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

frontend/src/components/chat/acp/agent-panel.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,13 @@ const AgentPanel: React.FC = () => {
729729
}, [wsUrl]);
730730

731731
const handleNewSession = useEvent(async () => {
732-
if (isCreatingNewSession.current) {
733-
return;
734-
}
735732
if (!agent) {
736733
return;
737734
}
738735

739736
// If there is an active session, we should stop it
740737
if (activeSessionId) {
738+
setActiveSessionId(null);
741739
await agent.cancel({ sessionId: activeSessionId }).catch((error) => {
742740
logger.error("Failed to cancel active session", { error });
743741
});

frontend/src/components/chat/acp/thread.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { groupNotifications } from "use-acp";
55
import {
66
ConnectionChangeBlock,
77
ErrorBlock,
8+
ReadyToChatBlock,
89
SessionNotificationsBlock,
910
} from "./blocks";
1011

@@ -30,7 +31,15 @@ export const AgentThread = ({
3031
let combinedNotifications = groupNotifications(notifications);
3132

3233
// Filter out all connection changes unless it is the last one
34+
// Filter out available_commands_update
3335
combinedNotifications = combinedNotifications.filter((group, index) => {
36+
if (
37+
isSessionNotificationGroup(group) &&
38+
group[0].data.update.sessionUpdate === "available_commands_update"
39+
) {
40+
return false;
41+
}
42+
3443
const isLast = index === combinedNotifications.length - 1;
3544
if (isLast) {
3645
return true;
@@ -88,12 +97,13 @@ export const AgentThread = ({
8897
};
8998

9099
return (
91-
<div className="flex flex-col gap-4 px-2 pb-10">
100+
<div className="flex flex-col gap-4 px-2 pb-10 flex-1">
92101
{combinedNotifications.map((notification) => (
93102
<React.Fragment key={notification[0].id}>
94103
{renderNotification(notification)}
95104
</React.Fragment>
96105
))}
106+
{combinedNotifications.length === 0 && <ReadyToChatBlock />}
97107
</div>
98108
);
99109
};

0 commit comments

Comments
 (0)