-
Notifications
You must be signed in to change notification settings - Fork 36
fix(image_generate,resource_copy): add fallback for attachment key mi… #92
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,9 @@ func authorizeObjectKey(ctx context.Context, store objectstore.Store, key string | |
| return nil | ||
| } | ||
| info, err := store.Head(ctx, key) | ||
| if err != nil && objectstore.IsNotFound(err) && attachment && !strings.HasPrefix(key, "attachments/") { | ||
| info, err = store.Head(ctx, "attachments/"+key) | ||
| } | ||
|
Comment on lines
+126
to
+128
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an attachment is passed as Useful? React with 👍 / 👎. |
||
| if err != nil { | ||
| return &tools.ExecutionError{ErrorClass: errorFetchFailed, Message: fmt.Sprintf("read resource metadata failed: %s", err.Error())} | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setter is never used by the production registration path:
registerStoredArtifactToolsstill constructsimagegeneratetool.NewToolExecutor(...)without chainingWithMessageAttachmentStore(attachmentStore). As a result, in normal worker/desktop compositionmessageAttachmentStoreremains nil, so the fallback added below for unprefixed attachment keys is dead code andinput_imagesthat only exist in the message-attachment bucket still fail.Useful? React with 👍 / 👎.