-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: support session media references end-to-end #9127
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
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a2dd4b7
feat: support session media references end-to-end
a9f3210
Merge branch 'main' into web-shell-mid-turn-image-injection
qwen-code-dev-bot b92a0a7
Merge remote-tracking branch 'origin/main' into web-shell-mid-turn-im…
qwen-code-dev-bot cde5023
fix(cli): catalog session media routes and update mid-turn replay met…
qwen-code-dev-bot bc2266e
fix(daemon): harden session media per review feedback
qwen-code-dev-bot 9da264c
fix(daemon): bound media content and fix resume/echo edge cases
qwen-code-dev-bot 8fab381
fix(daemon): resolve round-4 session media findings
qwen-code-dev-bot 74f63d7
Merge remote-tracking branch 'origin/main' into web-shell-mid-turn-im…
qwen-code-dev-bot eae62e2
Merge remote-tracking branch 'origin/main' into web-shell-mid-turn-im…
qwen-code-dev-bot db1ad9f
fix(daemon): resolve round-5 session-media critical findings (#9127)
qwen-code-dev-bot 2b10ad4
fix(daemon): resolve round-6 session-media critical findings (#9127)
qwen-code-dev-bot 35f9f29
fix(daemon): resolve round-7 session-media critical findings (#9127)
qwen-code-dev-bot 19d1b93
fix(daemon): resolve round-8 session-media critical findings (#9127)
qwen-code-dev-bot ed9c931
Merge remote-tracking branch 'origin/main' into web-shell-mid-turn-im…
qwen-code-dev-bot 6586d11
fix(daemon): correct session media recovery and queue isolation
516a093
fix(daemon): remove media with deleted queue items
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Session media references | ||
|
|
||
| ## Problem | ||
|
|
||
| Image prompts currently repeat base64 data in request JSON, pending queues, | ||
| SSE events, and the replay ring. Mid-turn batches amplify this because several | ||
| images can be emitted in one event. | ||
|
|
||
| ## Design | ||
|
|
||
| The daemon stores uploaded image bytes in a session-owned temporary | ||
| directory and returns a small media reference: | ||
|
|
||
| ```ts | ||
| { | ||
| type: 'image'; | ||
| mediaId: string; | ||
| mimeType: string; | ||
| size: number; | ||
| } | ||
| ``` | ||
|
|
||
| Prompt and mid-turn APIs accept these references. Queues, reconciliation | ||
| snapshots, SSE events, and persisted user-message metadata retain only | ||
| references. Immediately before an ACP prompt or mid-turn drain crosses into the | ||
| child, the bridge resolves references to the protocol's inline base64 content | ||
| blocks. | ||
|
|
||
| The TypeScript session client hydrates references in replay/live events and | ||
| queue snapshots through the authenticated media download route. Existing UI | ||
| reducers and renderers therefore continue receiving their current inline image | ||
| shape without carrying base64 through the daemon event bus. | ||
|
|
||
| ## Ownership and limits | ||
|
|
||
| - Media is scoped to the resolved daemon session and protected by the | ||
| existing session client authorization. | ||
| - Each object is limited to 8 MiB, each live session to 100 MiB and 256 objects, | ||
| and the daemon retains at most 512 MiB across sessions. | ||
| - Objects remain available across client detach and reload for up to three | ||
| hours; explicit close, kill, and daemon shutdown remove them immediately. | ||
| - References from another or unavailable session fail instead of falling back to a | ||
| primary runtime. | ||
|
|
||
| Legacy inline media remains accepted and echoed unchanged for older clients. | ||
| Media-reference-capable clients avoid placing those bytes in the replay ring. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.