Skip to content

Commit

Permalink
fix: unable to start a new thread when tool call in progress (#698)
Browse files Browse the repository at this point in the history
* fix: unable to start a new thread when tool call in progress
- internally indicates chat is no longer running when switching threads

Signed-off-by: Ryan Hopper-Lowe <[email protected]>

* chore: remove unused agent prop from Agent component

Signed-off-by: Ryan Hopper-Lowe <[email protected]>

---------

Signed-off-by: Ryan Hopper-Lowe <[email protected]>
  • Loading branch information
ryanhopperlowe authored Nov 27, 2024
1 parent 0cf1ee7 commit a8c7918
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 24 deletions.
1 change: 0 additions & 1 deletion ui/admin/app/components/agent/Agent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { ScrollArea } from "~/components/ui/scroll-area";
import { useDebounce } from "~/hooks/useDebounce";

type AgentProps = {
agent: AgentType;
className?: string;
onRefresh?: (threadId: string | null) => void;
};
Expand Down
1 change: 1 addition & 0 deletions ui/admin/app/components/chat/ChatContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function useMessageSource(threadId?: Nullish<string>) {

return () => {
source.close();
setIsRunning(false);
};
}, [threadId, addContent]);

Expand Down
39 changes: 16 additions & 23 deletions ui/admin/app/routes/_auth.agents.$agent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,23 @@ export default function ChatAgent() {

return (
<div className="h-full flex flex-col overflow-hidden relative">
<ChatProvider
id={agent.id}
threadId={threadId}
onCreateThreadId={updateThreadId}
>
<AgentProvider agent={agent}>
<ResizablePanelGroup
direction="horizontal"
className="flex-auto"
<ResizablePanelGroup direction="horizontal" className="flex-auto">
<ResizablePanel className="">
<AgentProvider agent={agent}>
<Agent onRefresh={updateThreadId} key={agent.id} />
</AgentProvider>
</ResizablePanel>
<ResizableHandle withHandle />
<ResizablePanel>
<ChatProvider
id={agent.id}
threadId={threadId}
onCreateThreadId={updateThreadId}
>
<ResizablePanel className="">
<Agent
agent={agent}
onRefresh={updateThreadId}
key={agent.id}
/>
</ResizablePanel>
<ResizableHandle withHandle />
<ResizablePanel>
<Chat className="bg-sidebar" />
</ResizablePanel>
</ResizablePanelGroup>
</AgentProvider>
</ChatProvider>
<Chat className="bg-sidebar" />
</ChatProvider>
</ResizablePanel>
</ResizablePanelGroup>
</div>
);
}

0 comments on commit a8c7918

Please sign in to comment.