fix: include toolCallID in image_generate artifact key to prevent ove…#87
fix: include toolCallID in image_generate artifact key to prevent ove…#87DivXPro wants to merge 1 commit into
Conversation
…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>
There was a problem hiding this comment.
💡 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)) |
There was a problem hiding this comment.
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 👍 / 👎.
…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.