Cody doesn't know when to ignore the context

Sometimes I’ll ask a general question in the middle of a chat session like “how does ktor’s generateSessionId work?” and Cody will respond

After carefully reviewing all the provided codebase context, I cannot find any information about how Ktor’s generateSessionId works. The codebase snippets do not contain any implementation, usage, or documentation of this specific function.
Without making assumptions or using information not present in the given context, I cannot provide any information about how Ktor’s generateSessionId works based solely on the provided codebase context.

The answer is not to be found in my code base but in ktor’s; an external one.

I could not reproduce your issue with the provided prompt.
Maybe it helps if you ask in the middle of a chat session like this:

how does ktor’s generateSessionId generally work?

Alternatively, you can begin a new session for general questions and remove all @-mentioned chips from the input prompt box.

I hope this is useful.

To reproduce you could ask the question on this repo: GitHub - ktorio/ktor-documentation: Documentation for the Ktor framework.

I think there is some aggressive context filtering going on.

I tried on on Cody Web Chat with your initial prompt and without repo context and the answer is “I don’t have access to the …”

But when I reformulate the prompt into: “how does ktor’s generateSessionId in general work?” then I got the following answer:

Ktor is a Kotlin framework for building asynchronous servers and clients. The generateSessionId function is part of Ktor’s Sessions feature, which allows you to associate data with a particular client session.

The generateSessionId function generates a unique identifier for a new session. The exact implementation details may vary based on the version of Ktor you are using, but generally it works as follows:

  1. It generates a cryptographically secure random value, typically using a secure random number generator provided by the operating system or Java’s SecureRandom class.
  2. The random value is encoded into a string representation, often using a URL-safe Base64 encoding scheme.
  3. Optionally, additional information like a timestamp or server identifier may be incorporated into the session ID to make it even more unique across different servers or server restarts.
  4. The generated session ID string is returned and can be used to identify the session when storing or retrieving session data.
    The goal is to generate a session ID that is sufficiently random and unique to prevent collisions or guessing of session IDs by malicious parties. The specific entropy, length, and encoding used may vary based on the security requirements of your application.

Without access to the Ktor codebase, I can’t provide more implementation details, but in general, generateSessionId aims to create a cryptographically secure unique identifier for associating data with a particular client session.

I did not checked the answer against the repository for facts.

What model did you use? Sonnet 3.5 claims to have access until April 2024 where Anthropic mentioned training cut-off at February 2024.

I used Claude 3.5. I can get useful results when I disable chat context. I think the UX would be improved if the product detected queries like mine which are not contextual and acted accordingly. In this case, when it detects no context fit, it could see if there is a match elsewhere (in its own memory or on the Internet).

It is usually possible if you clear the ‘@’ mentions in your chat box. Remember that it uses the previous messages and context if asked in between a longer conversation.
For general questions without context, it’s better to use a new chat session.