Show a chat error when the workflow service rejects a request
What does this MR do and why?
Show a chat error when the workflow service rejects a request and raises InvalidRequestException.
Currently, when a user using Duo agentic chat sends a new message with a resume_checkpoint_ts that does not exist, the Python code will close the connection and return an error, but this error is not displayed to the user. This leaves the message the user just sent with no response. If the user reloads the page, their message will disappear as well.
resume_checkpoint_ts is sent when:
- Retrying a message. Sends the
parent_tsof the user message they are retying. Creates a new branch in the thread. - Switching branch sends the last
thread_tsof the branch the user wants to switch to. After they retried, if they want to switch back to another branch.
This MR will detect the error and display it to the user. 3 places raise InvalidRequestException and the errors the frontend renders are:
- When the client sends a
resume_checkpoint_tsthat does not exist (main reason for MR) - The user client sends
resume_checkpoint_tson a chat that does not accept it. - When on a flow based chat and no content is sent.
References
Retry epic: gitlab-org#21289
How to set up and validate locally
Invalid resume_checkpoint_ts (Main reason for MR)
- In
gitlab-ai-gateway/duo_workflow_service/server.pyupdateresume_checkpoint_ts=start_workflow_request.startRequest.resume_checkpoint_tstoresume_checkpoint_ts="123" gdk restart duo-workflow-service- Send any new message
When flow does not accept retries
- In
gdk rails cFeature.enable(:agentic_chat_flow_registry_migration) - Reload page after 5 seconds, and start a new Duo agentic chat.
- In
gitlab-ai-gateway/duo_workflow_service/server.pyupdateresume_checkpoint_ts=start_workflow_request.startRequest.resume_checkpoint_tstoresume_checkpoint_ts="123" gdk restart duo-workflow-service- Send any new message
Flow with no content:
- In
gdk rails cFeature.enable(:agentic_chat_flow_registry_migration) - Reload page after 5 seconds, and start a new Duo agentic chat.
- Send any message.
- In
gitlab-ai-gateway/duo_workflow_service/server.pyupdateworkflow_task = asyncio.create_task(workflow.run(goal))toworkflow_task = asyncio.create_task(workflow.run("")) gdk restart duo-workflow-service- Send any new message
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
