Skip to content

Conversation

@Raezil
Copy link
Collaborator

@Raezil Raezil commented Nov 24, 2025

No description provided.

@Raezil Raezil merged commit 3b21c27 into main Nov 24, 2025
1 check passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +91 to +95
h.Write([]byte(prompt))
for _, f := range files {
h.Write([]byte(f.Name))
h.Write([]byte(f.MIME))
h.Write(f.Data)

Choose a reason for hiding this comment

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

P1 Badge Prevent collisions between Generate and GenerateWithFiles caches

The cache key for GenerateWithFiles is derived solely from the prompt and file contents (lines 91‑95), so when files is nil or empty the key becomes exactly the same sha256(prompt) used by Generate (line 72). After a plain Generate call caches a response, a subsequent GenerateWithFiles call with no attachments will return that cached plain-response without executing the file-aware path, even though many implementations produce different outputs for multi-line prompts or do extra wrapping when invoked via GenerateWithFiles. This can surface incorrect responses whenever callers sometimes pass files and sometimes don’t for the same prompt string.

Useful? React with 👍 / 👎.

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