fix: live reasoning, tool progress, in-flight session recovery (closes #367) - #383
Merged
Conversation
(cherry picked from commit 401e3b643d25e8dad8c06883b478b3c3073f07a5)
(cherry picked from commit 7ee093ba19978af23b79148df2f2347e2f1e5bde)
- static/ui.js: add loadInflightState() function (currently returns null — the typeof guard in sessions.js means reload recovery works via the else-path attachLiveStream call; this stub satisfies the guard cleanly and documents the extension point for future localStorage-backed state) - CHANGELOG.md: v0.50.21 entry; 960 tests (up from 949)
2 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Merges PR #367 by @Jordan-SkyLF. Rebased cleanly onto current master (v0.50.20). One addition made before merging:
loadInflightState()stub added tostatic/ui.js(the function was called with atypeofguard insessions.jsbut was undefined — theelsepath already handles reload recovery correctly, this stub resolves the guard cleanly and documents the extension point).What this delivers
Live reasoning cards — the generic thinking spinner now upgrades to a live reasoning card with lightbulb icon and scrollable reasoning text as the backend streams reasoning. Verified visually in browser.
tool_completeSSE events —on_tool()callback now accepts both the old 3-arg(name, preview, args)signature and the new 4-arg(event_type, name, preview, args)form.tool.completedevents transition live tool cards cleanly from running to done.In-flight session state across switches —
attachLiveStreamrefactored to a named function; partial assistant text mirrored intoINFLIGHTon every token;data-live-assistantDOM anchor preserved acrossrenderMessages()rebuilds.Reload recovery —
active_stream_id,pending_user_message,pending_attachments,pending_started_atpersisted on the session object before streaming, cleared on completion or exception.loadSession()detects a live stream and callsattachLiveStream(..., {reconnecting:true})to reattach.Session-scoped message queue — global
MSG_QUEUEreplaced withSESSION_QUEUESkeyed by session ID. Queued follow-ups stay attached to their originating session.newSession()idle reset — resetsS.busy=false,S.activeStreamId=null, updates cancel button and queue badge for the new session.Todos survive session reload —
loadTodos()reads fromS.session.messages(raw, includes tool messages) rather than the filteredS.messages.Review history
8ad112e.loadInflightStateundefined. Added stub before this merge.Browser QA
SESSION_QUEUES,queueSessionMessage,shiftQueuedSessionMessageall functional ✅loadInflightState,attachLiveStream,updateThinking,_thinkingMarkup,getPendingSessionMessage✅active_stream_id,pending_user_message,pending_attachments✅