-
Notifications
You must be signed in to change notification settings - Fork 346
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 missing current repo context in jetbrains #6649
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be useful to know exactly why this works now, I'm assuming it didn't work at the time, unless this was just a mistake we missed.
Have we verified that the context is correctly included in the chat message too?
I verified it works now. I took some time to read sqs PR so I can tell you exactly what happened: Look at vscode/src/chat/initialContext.ts:201 That said I think entering that first branch is right, we have remote repos.
So giving up just because VSC git extension is not initialised is in fact incorrect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for looking into it! Makes sense from my perspective 👍
5bdaa0d
to
3a4f2a3
Compare
I added one small improvement: |
@pkukielka LGTM! |
a55c6ec
to
e2114b7
Compare
@pkukielka , @umpox I don't think this is right. For enterprise with remote search, my understanding is that there is no local tree context. Let's use this Slack thread to clarify: https://sourcegraph.slack.com/archives/C05AGQYD528/p1736959465468939?thread_ts=1736948828.528379&cid=C05AGQYD528 |
…n non-dotcom (#6695) When remote search is enabled (that is, Enterprise, etc.) and the current repo is not indexed remotely: - Do *not* add a phony "current repo" context item to default context. - *Do* show an indication that the current repo is not available as context, and link to a helpful resource. (Part of CODY-4676.) #6649 make a change to show a "current repo" context item when remote search is available, but the current repo is not indexed remotely. That is not right. We want current repo context to be backed by remote search (although even with remote search there is a local layer on top with `git status`, we do not support 100% local context ala symf when remote search is enabled.) ## Test plan 1. Sign in to a dotcom account. Verify that default context, @-mentions show "Current Repository" and fetch context from it, etc. This behavior has not changed in this PR and must still work. 2. Sign in to an Enterprise account and open a workspace that *is* indexed remotely. There should be a "Current Repository" context item by default; the @-mentions menu should contain "Current Context github.com/foo", etc. This behavior also has not changed in this PR and must still work. 3. While still signed in to Enterprise, open a workspace that is *not* indexed remotely. There should not be a "Current Repository" context item by default. There should be a new "Current Repository/Not yet available" menu item, and activating that menu item should open a browser. 4. Run `pnpm -C web dev` and verify that Cody Web still works as in step 2 above. ![Screenshot 2025-01-20 at 13 17 22](https://github.com/user-attachments/assets/aed6d36b-3fc5-4584-bbc6-373db146af36)
Fixes https://linear.app/sourcegraph/issue/CODY-3906/agent-allow-use-of-existing-fallback-that-looks-at-gitconfig-to-get
Fixes https://linear.app/sourcegraph/issue/CODY-4140/jetbrains-cody-current-repo-no-longer-available-as-context
I think that was a simple mistake introduced by https://linear.app/sourcegraph/issue/CODY-3906/agent-allow-use-of-existing-fallback-that-looks-at-gitconfig-to-get
If I remove code you can see in the diff it simply works.
All git based methods themselves check if they can be executed so this safeguard was not adding any value there from what I can see.
Test plan
Current Repository
should be visible in the chat context by defaultCurrent Repository
@
and then Start typingCurrent Repository
- suggestion to add should appear and you should be able to accept it