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 repo name being Symbol(@@pendingOperation) if repo is local #7042

Merged
merged 10 commits into from
Feb 12, 2025

Conversation

mrnugget
Copy link
Contributor

Without this fix, when using Cody in a local repo that's not on the connected instance, this could show up in the prompt:

Codebase context from file tailscale.py in repository Symbol(@@PendingOperation)

Problem #1 was that the caller of getRepoNamesContainingUri didn't skip the @@pendingOperation sentinel value.

Problem #2 was that if we didn't find a repository name on the instance, we didn't fall back to the local name. We only did that for dot-com users.

With box fixes it now contains this:

Codebase context from file README.md in repository github.com/mrnugget/tailscale-mcp

Test plan

  • Add debug (or print statement) to const { prompt } = await this.buildPrompt(prompter, chatBuilder, signal, versions.codyAPIVersion) in ChatHandler.ts
  • Open Cody on a local repository that has a remote url, but that's not in a Sourcegraph instance.
  • Observe the prompt containing wrong values, when running without this fix.
  • Observe prompt containing repo name when running with fix.

Without this fix, when using Cody in a local repo that's not on the
connected instance, this could show up in the prompt:

> Codebase context from file tailscale.py in repository Symbol(@@PendingOperation)

Problem #1 was that the caller of `getRepoNamesContainingUri` didn't
skip the `@@pendingOperation` sentinel value.

Problem #2 was that if we didn't find a repository name on the instance,
we didn't fall back to the local name. We only did that for dot-com
users.
@mrnugget mrnugget requested a review from umpox February 11, 2025 14:15
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@beyang beyang enabled auto-merge (squash) February 11, 2025 20:36
@umpox umpox disabled auto-merge February 11, 2025 22:15
@mrnugget mrnugget merged commit 8071d40 into main Feb 12, 2025
21 checks passed
@mrnugget mrnugget deleted the mrn/fix-local-repo-name branch February 12, 2025 11:02
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.

3 participants