Repository navigation
Persist typed tab identities and restore the ordered roster - #1162
Merged
Merged
Conversation
This was referenced Oct 23, 2026
trissim
marked this pull request as ready for review
October 23, 2026 20:37
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ab roster SessionNavigation.new now takes the tab identity, so every caller names one: - SessionNavigation.saved owns writing a native session's row and returns its AcpTab; launch and the test support's saved_tab both use it. - Thread tabs in tests pass MailboxTab(incarnation, root), as the restore path does. - The MCP permission observer called a deleted default_source; it now saves its real agent definition. TabOrder.editing writes the roster only when the open list changed, and the uncalled TabOrder.reorder is deleted. A saved AcpTab with no session row is now dropped at startup without a crash; a test covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Tabs persist declared TabIdentity values in the existing toad.db. AcpTab, MailboxTab, HistoryTab and PreviewTab own restoration; the shared parent derives Textual names. No counted session-N/comms-N/preview-N identities or mode parsing remain.
TabOrder owns the in-process roster. ApplicationLifetime calls its async load once after the existing off-thread DB.create. names, contains, recent, project and previous read _open only. Mutations await one serialized writer; DB.tab_roster replaces the persisted order in one transaction through DB._transaction (asyncio.to_thread). TabOrder holds its lock until an owned write finishes, including caller cancellation, through the existing join_retirement operation. No frame or sidebar update opens SQLite.
TabTargetGone carries the identity and reason. Missing ACP rows, foreign/replaced mailbox targets, foreign history roots and missing preview files raise it. The startup loop catches only that declared outcome, removes the current roster entry, logs the identity/reason and continues. All other exceptions propagate.
The existing model history callers were migrated to await writes and to initialize/load their fixture DB explicitly. No tests were run for this send-back.
Exact requested grep:
The sole roster write is DB.tab_roster; tab_reorder and tab_close were deleted. TabOrder query methods are at tab_order.py:40 (contains), :44 (names), :48 (recent), :62 (project) and :65 (previous). The per-tab TabTargetGone handler is application_lifetime.py:124-129.
Core dependency agent-comms#2896 is merged at da12825c5. Its declaration-derived NOT NULL widening permits Session.agent_session_id to stay absent until the ACP handshake fills it. No Toad carry tool or installer hook.
The earlier authorized DB copy check changed agent_session_id TEXT NOT NULL -> TEXT with sessions rows 0 -> 0; it used a private copy, never the live DB. The commander independently verified two-row preservation and NULL insertion after the Core change.
Assumed / behavior retained:
Runtime movement belongs to Drafts in Toad #1159 and agent-comms #2860. This branch does not edit or push #1159.