-
Notifications
You must be signed in to change notification settings - Fork 50
LCORE-383: Fix attachments in /conversations #285
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
This is the other HACKY PR #286 |
|
I would love feedback from anyone about which direction should be pursued. Thanks! |
|
We do a lot of cleanup here |
|
@eranco74 So thats what I originally thought however there really is very little cleanup that actually happens there (at least cleanup that would help with this issue) this is because the attachment is appended to the content. |
|
@coderabbitai configuration |
CodeRabbit configurationlanguage: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
reviews:
profile: chill
request_changes_workflow: false
high_level_summary: true
high_level_summary_placeholder: '@coderabbitai summary'
high_level_summary_in_walkthrough: false
auto_title_placeholder: '@coderabbitai'
auto_title_instructions: ''
review_status: true
commit_status: true
fail_commit_status: false
collapse_walkthrough: false
changed_files_summary: true
sequence_diagrams: true
estimate_code_review_effort: true
assess_linked_issues: true
related_issues: true
related_prs: true
suggested_labels: true
labeling_instructions: []
auto_apply_labels: false
suggested_reviewers: true
auto_assign_reviewers: false
in_progress_fortune: true
poem: true
path_filters: []
path_instructions: []
abort_on_close: true
disable_cache: false
auto_review:
enabled: true
auto_incremental_review: true
ignore_title_keywords: []
labels: []
drafts: false
base_branches: []
ignore_usernames: []
finishing_touches:
docstrings:
enabled: true
unit_tests:
enabled: true
pre_merge_checks:
docstrings:
mode: warning
threshold: 80
title:
mode: warning
requirements: ''
description:
mode: warning
issue_assessment:
mode: warning
custom_checks: []
tools:
ast-grep:
rule_dirs: []
util_dirs: []
essential_rules: true
packages: []
shellcheck:
enabled: true
ruff:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_rules: []
disabled_rules: []
enabled_categories: []
disabled_categories: []
enabled_only: false
level: default
biome:
enabled: true
hadolint:
enabled: true
swiftlint:
enabled: true
phpstan:
enabled: true
level: default
phpmd:
enabled: true
phpcs:
enabled: true
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
checkov:
enabled: true
detekt:
enabled: true
eslint:
enabled: true
flake8:
enabled: true
rubocop:
enabled: true
buf:
enabled: true
regal:
enabled: true
actionlint:
enabled: true
pmd:
enabled: true
clang:
enabled: true
cppcheck:
enabled: true
semgrep:
enabled: true
circleci:
enabled: true
clippy:
enabled: true
sqlfluff:
enabled: true
prismaLint:
enabled: true
pylint:
enabled: true
oxc:
enabled: true
shopifyThemeCheck:
enabled: true
luacheck:
enabled: true
brakeman:
enabled: true
dotenvLint:
enabled: true
htmlhint:
enabled: true
checkmake:
enabled: true
osvScanner:
enabled: true
chat:
art: true
auto_reply: true
integrations:
jira:
usage: auto
linear:
usage: auto
knowledge_base:
opt_out: false
web_search:
enabled: true
code_guidelines:
enabled: true
filePatterns: []
learnings:
scope: auto
issues:
scope: auto
jira:
usage: auto
project_keys: []
linear:
usage: auto
team_keys: []
pull_requests:
scope: auto
mcp:
usage: auto
disabled_servers: []
code_generation:
docstrings:
language: en-US
path_instructions: []
unit_tests:
path_instructions: []
|
Description
This PR is one of 2 that is being proposed to close LCORE-383.
Basically what is happening is that attachment content is being appended to messages when accessing them through the
/conversationsendpoint.This error can be seen below along with what it looks like after the fix.
Before Fix
This is when the attachment is sent before using the


/conversationsendpoint to reload the saved conversation.This is after the
/conversationsendpoint is used to reload the conversation.After Fix
This is when the attachment is sent before using the


/conversationsendpoint to reload the saved conversation.This is after the
/conversationsendpoint is used to reload the conversation.This is what the response of the
/conversationsendpoint looks like:{ "conversation_id": "09f05d2b-5cf5-4d83-8616-b106de972d67", "chat_history": [ { "messages": [ { "content": [ { "text": "What does this file say?", "type": "text" }, { "text": "data:text/plain;base64,SW5ncmVkaWVudHM6Ci0gNiBjdXBzIHRoaW5seSBzbGljZWQgYXBwbGVzCi0gMy80IGN1cCBzdWdhcgotIDIgdGFibGVzcG9vbnMgYWxsLXB1cnBvc2UgZmxvdXIKLSAxLzIgdGVhc3Bvb24gZ3JvdW5kIGNpbm5hbW9uCi0gMS80IHRlYXNwb29uIHNhbHQKLSAxLzggdGVhc3Bvb24gZ3JvdW5kIG51dG1lZwotIDEgdGFibGVzcG9vbiBsZW1vbiBqdWljZQotIDEgcGFja2FnZSAoMiBjcnVzdHMpIHJlZnJpZ2VyYXRlZCBwaWUgY3J1c3RzCgpJbnN0cnVjdGlvbnM6CjEuIFByZWhlYXQgb3ZlbiB0byA0MjUgZGVncmVlcyBGICgyMjAgZGVncmVlcyBDKS4KMi4gSW4gYSBsYXJnZSBib3dsLCBtaXggc2xpY2VkIGFwcGxlcywgc3VnYXIsIGZsb3VyLCBjaW5uYW1vbiwgc2FsdCwgbnV0bWVnLCBhbmQgbGVtb24ganVpY2UuCjMuIFBsYWNlIG9uZSBwaWUgY3J1c3QgaW4gYSBwaWUgZGlzaC4gRmlsbCB3aXRoIGFwcGxlIG1peHR1cmUuIENvdmVyIHdpdGggdGhlIHNlY29uZCBjcnVzdC4KNC4gU2VhbCBhbmQgZmx1dGUgZWRnZXMuIEN1dCBzbGl0cyBpbiB0aGUgdG9wIGNydXN0Lgo1LiBCYWtlIGluIHRoZSBwcmVoZWF0ZWQgb3ZlbiBmb3IgNDUgbWludXRlcyBvciB1bnRpbCBjcnVzdCBpcyBnb2xkZW4gYnJvd24uIEFsbG93IHRvIGNvb2wgYmVmb3JlIHNlcnZpbmcu", "type": "text" } ], "type": "user" }, { "content": "The decoded text from the base64 string is a recipe with ingredients and instructions for making a pie. Here is the content:\n\n**Ingredients:**\n- 6 cups thinly sliced apples\n- 3/4 cup sugar\n- 2 tablespoons all-purpose flour\n- 1/2 teaspoon ground cinnamon\n- 1/4 teaspoon salt\n- 1/8 teaspoon ground nutmeg\n- 1 tablespoon lemon juice\n- 1 package (2 crusts) refrigerated pie crusts\n\n**Instructions:**\n1. Preheat oven to 425 degrees F (220 degrees C).\n2. In a large bowl, mix sliced apples, sugar, flour, cinnamon, salt, nutmeg, and lemon juice.\n3. Place one pie crust in a pie dish. Fill with apple mixture. Cover with the second crust.\n4. Seal and flute edges. Cut slits in the top crust.\n5. Bake in the preheated oven for 45 minutes or until crust is golden brown. Allow to cool before serving.", "type": "assistant" } ], "started_at": "2025-07-24T17:40:21.098072Z", "completed_at": "2025-07-24T17:40:28.668180Z" } ] }I originally wanted to solve this by leveraging the session data in llama-stack to extract the attachment content, however because we pass the message as a string and not a list of
InterleavedContentItem's it directly appends the content to the message content string making it difficult to remove.This PR represents solving the issue in a non-hacky way but such that it doesn't fully meet the acceptance criteria of LCORE-383. Basically it just changes how we pass the
contentof theUserMessageto be a list of content items and not a string.The issue with this however is that we wouldn't have any of the metadata that is passed originally along with the
attachment.Type of change
Related Tickets & Documents
Checklist before requesting a review
Testing