Skip to content

fix(gateway): key native image handoff by the same resolved session key (#48912) - #57648

Merged
teknium1 merged 3 commits into
mainfrom
fix/native-image-session-key
Jul 3, 2026
Merged

fix(gateway): key native image handoff by the same resolved session key (#48912)#57648
teknium1 merged 3 commits into
mainfrom
fix/native-image-session-key

Conversation

@teknium1

@teknium1 teknium1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Gateway native-image handoff no longer drops user images when the buffered write key and the consume key disagree (issue #48912). Two salvaged fixes plus a follow-up reorder make the pending-native-image buffer use the same resolved session key at SET and CONSUME.

Root cause: _prepare_inbound_message_text buffered native image paths under _session_key_for_source(source) while the run site consumed them under session_entry.session_key; after compression-continuation healing / thread-anchor remapping the keys differ, pop() returns [], and the model receives a text-only turn even though the log said "attached inline".

Changes

Validation

Test Result
tests/gateway/test_native_image_buffer_isolation.py pass
tests/gateway/test_queued_native_image_session_key.py pass

Closes #48912. Salvages #48922 and #48919 with both contributors' authorship preserved.

Infographic

native-image-handoff

tt-a1i and others added 3 commits July 3, 2026 02:39
…e buffering

The cherry-picked #48919 fix resolved next_session_key AFTER
_prepare_inbound_message_text had already buffered native image paths
under the stale key. Reorder so the write key and the consume key are
the same resolved key.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jul 3, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Core-team salvage (@teknium1) folding #48922 (@tt-a1i) and #48919 (@LeonSGP43) with authorship preserved, plus a follow-up reorder so queued follow-up turns buffer under the consumed key. Closes #48912. Related, not duplicate — this is the canonical version; the salvaged PRs #48922/#48919 can be closed in its favor by a maintainer.

@teknium1
teknium1 merged commit 741bd9b into main Jul 3, 2026
31 checks passed
@teknium1
teknium1 deleted the fix/native-image-session-key branch July 3, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native image_input_mode silently drops user images on long-lived/threaded sessions (session-key handoff mismatch); text mode works

4 participants