Skip to content

fix: include toolCallID in image_generate artifact key to prevent ove…#87

Open
DivXPro wants to merge 1 commit into
qqqqqf-q:mainfrom
DivXPro:fix/imageGenArtifactKeyCollision
Open

fix: include toolCallID in image_generate artifact key to prevent ove…#87
DivXPro wants to merge 1 commit into
qqqqqf-q:mainfrom
DivXPro:fix/imageGenArtifactKeyCollision

Conversation

@DivXPro

@DivXPro DivXPro commented May 26, 2026

Copy link
Copy Markdown
Contributor

…rwrites

Multiple image_generate calls within the same run produced identical artifact keys (accountID/runID/generated-image.png), causing later calls to overwrite earlier images. Add toolCallID to the key path so each call produces a unique artifact key.

…rwrites

Multiple image_generate calls within the same run produced identical
artifact keys (accountID/runID/generated-image.png), causing later calls
to overwrite earlier images. Add toolCallID to the key path so each call
produces a unique artifact key.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

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

Copy link
Copy Markdown

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.

Reviewed commit: 0433828c1d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

accountID = execCtx.AccountID.String()
}
return filepath.ToSlash(fmt.Sprintf("%s/%s/%s", accountID, execCtx.RunID.String(), filename))
return filepath.ToSlash(fmt.Sprintf("%s/%s/%s/%s", accountID, execCtx.RunID.String(), toolCallID, filename))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle empty toolCallID when building artifact key

Including toolCallID unconditionally in the key path makes image_generate fail for execution paths that pass an empty ID. In the Lua runtime, executeToolWithPluginHooks is called with "" (src/services/worker/internal/executor/lua.go), so this now produces keys like account/run//generated-image.png; the filesystem object store rejects empty path segments in validateObjectKey (src/services/shared/objectstore/filesystem.go), causing PutObject to fail and the tool to return tool.upload_failed instead of an artifact. Please normalize/fallback the call ID (e.g., generate a default when blank) before building the key.

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.

1 participant