Skip to content

fix(gateway): keep native images on resolved session key - #48922

Closed
tt-a1i wants to merge 1 commit into
NousResearch:mainfrom
tt-a1i:codex/native-image-session-key-handoff
Closed

fix(gateway): keep native images on resolved session key#48922
tt-a1i wants to merge 1 commit into
NousResearch:mainfrom
tt-a1i:codex/native-image-session-key-handoff

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pass the resolved gateway session key into inbound message preprocessing
  • buffer native image paths under the same key consumed by _run_agent
  • add a regression test for source-derived vs canonical session-key mismatch

Fixes #48912

Validation

  • .venv/bin/python -m pytest tests/gateway/test_native_image_buffer_isolation.py -q -o addopts=
  • .venv/bin/python -m pytest tests/gateway/test_native_image_buffer_isolation.py tests/gateway/test_video_context_note.py tests/gateway/test_shared_group_sender_prefix.py tests/gateway/test_reply_to_injection.py tests/gateway/test_stt_config.py tests/gateway/test_session.py tests/gateway/test_telegram_audio_vs_voice.py -q -o addopts=
  • .venv/bin/python -m py_compile gateway/run.py
  • git diff --check

Review

  • Subagent read-only review: no findings; safe to commit/PR.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery tool/vision Vision analysis and image generation P2 Medium — degraded but workaround exists labels Jun 19, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #48919 (competing fix for the same issue #48912, different mechanism — it re-resolves the session key for the queued follow-up re-entry in _notify_long_running, whereas this PR threads the caller-resolved session_key into _prepare_inbound_message_text at the buffer-write site). Both build on the per-session native-image-buffer isolation introduced by merged #18202. Same goal, distinct code sites — not a duplicate; maintainers should pick the preferred mechanism (or combine both, since #48919 covers the queued-followup branch and this covers the direct write site).

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Acknowledged: noted competing PR(s) #48919, #48912, #18202, #48919. My approach differs and is complementary, not mutually exclusive. Open to consolidating if reviewers prefer one direction.

@teknium1

teknium1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #57648. Your commit was cherry-picked onto current main with your authorship preserved in git log (rebase-merge). We added a small follow-up on top reordering the queued-follow-up session-key resolution so it happens before the inbound-text prep buffers images. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists tool/vision Vision analysis and image generation 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