fix: re-requesting image when all agents are done

This means the agents are no longer parallel. Which will eventually be a
bottleneck, but I need to spend a bit more time on allowing for it to be
parallel, but now is not the time.

TODO: add a ticket
This commit is contained in:
2025-04-27 14:45:23 +01:00
parent 84d66a1c3b
commit a9ecd5818a
2 changed files with 5 additions and 14 deletions

View File

@ -139,25 +139,25 @@ func NewOrchestratorAgent(log *log.Logger, noteAgent NoteAgent, contactAgent cli
})
agent.ToolHandler.AddTool("noteAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
go noteAgent.GetNotes(info.UserId, info.ImageId, imageName, imageData)
noteAgent.GetNotes(info.UserId, info.ImageId, imageName, imageData)
return "noteAgent called successfully", nil
})
agent.ToolHandler.AddTool("contactAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
go contactAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
contactAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
return "contactAgent called successfully", nil
})
agent.ToolHandler.AddTool("locationAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
go locationAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
locationAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
return "locationAgent called successfully", nil
})
agent.ToolHandler.AddTool("eventAgent", func(info client.ToolHandlerInfo, args string, call client.ToolCall) (any, error) {
go eventAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
eventAgent.RunAgent(info.UserId, info.ImageId, imageName, imageData)
return "eventAgent called successfully", nil
})

View File

@ -44,15 +44,6 @@ const getAllValues = (object: object): Array<string> => {
return loop([], object);
};
// On fast connections (or locally), the DB will send the complete update before the image has been fully saved.
// This is because it shouldn't really be an update, and that is hacky but hey. It works.
// The tech debt will be collected eventually.
//
// AND MORE IMPORTANTLY. The fucking AI agents aren't done.
// hhhhhhhhhhhhhhhhhhhhmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// wait groups.
const BIG_SHAME_TIMEOUT = 5000;
const SearchImageContext = createContext<SearchImageStore>();
export const SearchImageContextProvider: Component<ParentProps> = (props) => {
const [images, { refetch }] = createResource(() =>
@ -68,7 +59,7 @@ export const SearchImageContextProvider: Component<ParentProps> = (props) => {
<SearchImageContext.Provider
value={{
images,
onRefetchImages: () => setTimeout(refetch, BIG_SHAME_TIMEOUT),
onRefetchImages: refetch,
}}
>
{props.children}