mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2687
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/554
Author: @sergqwer
Created: 10/2/2026
Status: ❌ Closed
Base:
main← Head:pr/image-markers📝 Commits (1)
1273345serve: the vision markers inside a message's text stay text and no longer take a picture's place (#150 follow-up)📊 Changes
3 files changed (+70 additions, -5 deletions)
View changed files
📝
serve/frontend.py(+11 -4)📝
serve/server.py(+4 -1)📝
serve/test_server.py(+55 -0)📄 Description
Service.prepare()renders the chat template and tokenizes the whole prompt withparse_special=True. The template writes<|vision_start|><|image_pad|><|vision_end|>for each image item, and the #150 guard turns only an<|image_pad|>not preceded by<|vision_start|>back into text.Message text that contains the whole marker pair becomes the same special ids as a real image. That happens with an agent reading
serve/chat_template.jinja, these docs, or a tool result quoting them. If such text comes before a real picture:The counts still match, so nothing reports it. With Claude Code reading a repository and a screenshot in one conversation, this is an ordinary case.
Fix (
serve/server.py,Service.prompt_ids()):parse_special=False) tokens. The pieces between placeholders are tokenized as before, since a special token split the text there anyway.count_tokensuses the same ids.Test
test_the_whole_marker_in_text_before_images: each picture's rows follow its own marker, and the text keeps its literal tokens. Without the fix it finds 3vision_startwhere 2 belong. The #150 test is unchanged. Serve tests: 173 OK (7 skipped).This touches the first lines of
prepare(), as #529 does; whichever goes in second needs a one-line rebase.🤖 Generated with Claude Code
https://claude.ai/code/session_01VZy1yKaDDiA8a7svdwaHio
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.