Skip to content

fix(gateway): resume should follow compression continuations#15403

Closed
simbam99 wants to merge 1 commit into
NousResearch:mainfrom
simbam99:fix/gateway-resume-compression-redirection
Closed

fix(gateway): resume should follow compression continuations#15403
simbam99 wants to merge 1 commit into
NousResearch:mainfrom
simbam99:fix/gateway-resume-compression-redirection

Conversation

@simbam99

Copy link
Copy Markdown
Contributor

Summary

Gateway /resume was restoring the titled parent session after compression instead of the live continuation child that actually holds the transcript.

This aligns gateway resume behavior with the CLI by resolving the resumed session ID through SessionDB.resolve_resume_session_id() before switching sessions.

Problem

Context compression ends the current session and creates a child continuation linked via parent_session_id.

The gateway /resume flow already resolved a title to a session ID, but it did not follow the compression continuation chain afterward. That meant:

  • /resume <title> could switch to the compressed parent session
  • the restored transcript could be empty or stale
  • gateway behavior diverged from the CLI, which already follows the continuation descendant

Fix

  • Update GatewayRunner._handle_resume_command() in gateway/run.py to pass the resolved target session through resolve_resume_session_id()
  • Keep the change best-effort with a debug log fallback if continuation resolution fails
  • Add a regression test in tests/gateway/test_resume_command.py that creates a compressed parent + child continuation and verifies /resume switches to the child and counts its messages

How to test

uv run --extra dev pytest tests/gateway/test_resume_command.py

Result:

20 workers [10 items]
..........                                                               [100%]
============================= 10 passed in 6.24s ==============================

Manual check: in a gateway session, trigger /compress to create a continuation child, then run /resume <title> — the gateway now reopens the live child transcript instead of the compressed parent.

No platform-specific code paths were touched (no file I/O, process management, or shell command changes), so behavior should be identical on Linux and macOS.

Files changed

  • gateway/run.py — route resolved session ID through resolve_resume_session_id()
  • tests/gateway/test_resume_command.py — regression test for compression-continuation resume

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/gateway Gateway runner, session dispatch, delivery labels Apr 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #10373 (same bug report for gateway resume not following compression continuations) and #13374 (TUI variant). This PR appears to be the fix.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #15418 — your commit was cherry-picked onto current main with your authorship preserved (rebase-merge). Also added your AUTHOR_MAP entry in scripts/release.py so release notes credit you correctly. Thanks!

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 P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants