refactor(tui): let embedders supply the confirmation dialog's session state#3654
Merged
Merged
Conversation
… state Same seam as the message list (the dialog embeds it): accept a narrow interface — the list's surface plus SetYoloMode for the all-tools decision — instead of the concrete *service.SessionState, and give EmbeddedSessionState the mutable session-wide approval.
Sayt-0
approved these changes
Jul 15, 2026
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.
Follow-up to #3643, which applied the same treatment to the messages component the dialog embeds.
NewToolConfirmationDialogpreviously demanded a concrete*service.SessionState, which blocked embedders that host the dialog outside the full TUI — Docker Sandboxes' Gordon panel was forking a 262-line copy of the confirmation dialog as a direct result.The dialog now accepts a narrow
ConfirmationSessionStateinterface: the message list'smessages.SessionStatesurface (already loosened in #3643) plusSetYoloModefor the session-wide "approve all tools" decision.service.EmbeddedSessionStategainsYoloMode/SetYoloModeso embedders get a working implementation without pulling in the full application state.*service.SessionStatesatisfies the interface unchanged, so existing callers (chat page,tui.go) require no edits.A new test covers both the render path (an embedder-provided state produces a working dialog view) and the approval path (pressing
Aflips the embedder'sYoloMode).