Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cody): fix chat context review logic #6602

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jan 11, 2025

CLOSE https://linear.app/sourcegraph/issue/CODY-4671

Fixes a regression where the agent would mark a context as needed but got filtered out during the validation step

  • Simplify the context review logic by directly extracting context names from the response and fetching the full content for the requested files.
  • Remove unnecessary callbacks and optimize the context fetching process.
  • Add a helper function to check if the response is ready to answer.

Test plan

Manual testing:

  1. Ask in new chat: "how does agentic context work in @_cody_repo"
  2. Add a follow up: "how many loop does deep cody run for the review step?"

Before

Deep Cody requested a file:

image

But it wasn't included in the final selected context:

image

After:

image

Fixes a regression where the agent would mark a context as needed but got filtered out during the validation step

- Simplify the context review logic by directly extracting context names from the response and fetching the full content for the requested files.
- Remove unnecessary callbacks and optimize the context fetching process.
- Add a helper function to check if the response is ready to answer.
@abeatrix abeatrix changed the title feat(cody): improve context review logic fix(cody): fix chat context review logic Jan 11, 2025
reviewed.push(...this.context.filter(c => isUserAddedItem(c)))
// When there are context items matched, we will replace the current context with
// the reviewed context list, but first we will make sure all the user added context
// items are nor removed from the updated context list. We will let the prompt builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*not

@abeatrix
Copy link
Contributor Author

I have yet to find the causality for this but when I build this PR locally I don't see deep cody as listed options but I do see it on main and my own branches.

Oh it's been moved out of the model list! Here is a demo: https://sourcegraph.slack.com/archives/C89KCDK5J/p1736447482340629

More context: https://sourcegraph.slack.com/archives/C05MW2TMYAV/p1736536440381029

Thanks for taking a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants