Loading
Paginate the Duo session chat log and cap duoMessages
What does this MR do and why?
Paginate the Duo session chat log and cap duoMessages
Reading a session's chat log through duoMessages returned every message with no bound, and the session page polled it every 10 seconds.
References
https://gitlab.com/gitlab-org/gitlab/-/work_items/635073
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Enable FF
duo_workflow_cap_duo_messages - Run a workflow that takes multiple steps (e.g. ask Developer
@duo-developer-gitlab-duo - Write a python script that tells me the time, but it's always wrong.) - Check you can get the messages, newest first, with pagination, within
messages:
query testCheckPointPagination{
duoWorkflowWorkflows(workflowId: "gid://gitlab/Ai::DuoWorkflows::Workflow/4960") {
nodes {
id
latestCheckpoint {
threadTs
duoMessages { content role threadTs parentTs alternativeCount }
messages(last: 2) {
nodes { content messageType role threadTs }
pageInfo { hasPreviousPage hasNextPage startCursor endCursor }
}
}
}
}
}- To test the cap, set
DUO_MESSAGES_CAPinworkflow_event_type.rbto 2, and rerun the above query. TheduoMessagesshould be limited to 2 with the FF on, and not limited with it off.
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.
Edited by Roman Eisner