fix(tui_gateway): stop live profile session reuse from hiding verification answers - #71834
Merged
teknium1 merged 1 commit intoAug 15, 2026
Conversation
19 tasks
Warm/live reuse was hard-coding the launch SessionDB, so app-global remote profile sessions fell back to collapsed in-memory history and dropped verification candidates that eager profile resume still showed.
teknium1
force-pushed
the
fix/live-session-payload-profile-db
branch
from
August 15, 2026 03:56
653873a to
0a8c844
Compare
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.
What does this PR do?
Warm/live reuse of a non-launch profile session was reading the process launch
state.dbwhen building the user-visible transcript, so verification-candidate rows that only exist in the profile DB disappeared even though a cold resume of the same session still showed them. Route_live_session_payloadthrough the existing profile-aware_session_db(session)helper so all surfaces agree.Bug Cause
_live_session_payloadhard-coded_get_db()(launch SessionDB). App-global remote profile sessions persist display history (includingfinish_reason=verification_requiredcandidates) undersession["profile_home"]/state.db. A miss on the launch DB fell back to collapsed in-memory model history, which already dropped those candidates.Reproduction Steps
session.resumeshows the candidate.session.activateor a secondsession.resumethat reuses the in-memory session.Expected: candidate remains in the payload, matching cold resume.
Before fix: candidate missing; only the collapsed model history remains.
Fix
Use
with _session_db(session) as db:before_live_visible_historyso profile sessions open the correct DB and launch sessions keep the shared handle. Addedtest_live_session_payload_reads_profile_db_not_launch_db.Related Issue
No issue
Type of Change
Changes Made
tui_gateway/server.py-_live_session_payloadreads history via_session_db(session)instead of launch_get_db()tests/test_tui_gateway_server.py- regression: profile DB has candidate, launch DB does not, live payload keeps candidateHow to Test
scripts/run_tests.sh tests/test_tui_gateway_server.py -k "live_visible_history or live_session_payload or reconcile_display or session_resume_live" -q scripts/run_tests.sh tests/tui_gateway/test_failed_turn_retention.py -qChecklist
Code
scripts/run_tests.shon relevant tests and they passDocumentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys - N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - N/A