mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-22 03:07:02 +00:00
fix: user message not showing on quick tasks (when using queue)
This commit is contained in:
parent
f95a315fbf
commit
47b1d8569a
2 changed files with 7 additions and 4 deletions
|
|
@ -558,8 +558,7 @@ async def step_solve(options: Chat, request: Request, task_lock: TaskLock):
|
|||
|
||||
task_lock.add_conversation('assistant', answer_content)
|
||||
|
||||
# Send response to user
|
||||
yield sse_json("confirmed", {"question": new_task_content})
|
||||
# Send response to user (don't send confirmed if simple response)
|
||||
yield sse_json("wait_confirm", {"content": answer_content, "question": new_task_content})
|
||||
except Exception as e:
|
||||
logger.error(f"Error generating simple answer in multi-turn: {e}")
|
||||
|
|
|
|||
|
|
@ -624,8 +624,12 @@ const chatStore = (initial?: Partial<ChatStore>) => createStore<ChatStore>()(
|
|||
|
||||
const currentChatStore = getCurrentChatStore();
|
||||
//Make sure to add user Message on replay and avoid duplication of first msg
|
||||
if(type === "replay" && question &&
|
||||
!(currentChatStore.tasks[currentTaskId].messages.length === 1)) {
|
||||
if(question && !(currentChatStore.tasks[currentTaskId].messages.length === 1)) {
|
||||
//Replace the optimistic update if existent.
|
||||
const lastMessage = currentChatStore.tasks[currentTaskId]?.messages.at(-1);
|
||||
if(lastMessage?.role === "user" && lastMessage.id && lastMessage.content === question) {
|
||||
currentChatStore.removeMessage(currentTaskId, lastMessage.id)
|
||||
}
|
||||
addMessages(currentTaskId, {
|
||||
id: generateUniqueId(),
|
||||
role: "user",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue