Code Review flow fails on large MRs due to context window limits

Summary

Duo Code Review struggles with large merge requests due to context window limitations enforced in Duo Workflow Service. When reviewing substantial MRs, the LLM doesn't receive all files, resulting in incomplete reviews.

Problem

In testing with a large MR, Duo Code Review produced significantly fewer comments compared to other tools. LangSmith logs revealed:

  • "Previous message was too large for context window and was omitted. Please respond based on the visible context."
  • "Unable to access MR data due to context window limitations"
  • LLM only saw a fraction of the files, missing most of the MR content

Root Cause

Context limits are enforced in Duo Workflow Service code before requests reach the LLM. While limits were increased previously, they're insufficient for larger MRs.

Proposed Solution

Increase context window limits in Duo Workflow Service for code review operations to handle larger MRs.

References

Edited by 🤖 GitLab Bot 🤖