fix: recover interactive input after resume - #88
Conversation
The upstream createAgentSessionRuntime creates a new InteractiveMode during switchSession but never calls init() on it. This leaves the editor's submit action unbound, causing typed input to be displayed in the input box instead of being sent as a message after resuming a session. Calling init() is safe: it has an isInitialized guard and is idempotent.
|
Review note: I do not think this PR fixes the reported resume input issue as written. The added code calls The interactive layer is created separately in Suggested next step: please trace why |
|
Updated this PR with a real interactive-layer fix. What changed:
Local verification passed:
|
Problem
After resuming a session via
/resume, the interactive UI can stop submitting later input correctly. Text remains in the input surface instead of flowing through the active session prompt loop.Root Cause
The first fix attempted to call
runtime.session.init(), butruntime.sessionis anAgentSession, not the upstreamInteractiveMode, so that path is effectively a no-op. The actual resume path replaces the activeAgentSessionand invokes the interactive mode setRebindSession callback.Fix
Install a GLM-side interactive rebind recovery hook in
runChatSession:rebindCurrentSession()behavior after session replacementAgentSession.init()callVerification
pnpm test tests/runtime/chat-runtime.test.tspnpm test tests/runtime/chat-runtime.test.ts tests/session/create-session.test.tspnpm testpnpm build