Skip to content

refactor(tui): let embedders supply the confirmation dialog's session state#3654

Merged
Sayt-0 merged 1 commit into
mainfrom
refactor/tool-confirmation-session-state
Jul 15, 2026
Merged

refactor(tui): let embedders supply the confirmation dialog's session state#3654
Sayt-0 merged 1 commit into
mainfrom
refactor/tool-confirmation-session-state

Conversation

@dgageot

@dgageot dgageot commented Jul 15, 2026

Copy link
Copy Markdown
Member

Follow-up to #3643, which applied the same treatment to the messages component the dialog embeds. NewToolConfirmationDialog previously 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 ConfirmationSessionState interface: the message list's messages.SessionState surface (already loosened in #3643) plus SetYoloMode for the session-wide "approve all tools" decision. service.EmbeddedSessionState gains YoloMode/SetYoloMode so embedders get a working implementation without pulling in the full application state. *service.SessionState satisfies 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 A flips the embedder's YoloMode).

… 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.
@dgageot
dgageot requested a review from a team as a code owner July 15, 2026 11:38
@Sayt-0
Sayt-0 merged commit 5b7f4d2 into main Jul 15, 2026
7 checks passed
@Sayt-0
Sayt-0 deleted the refactor/tool-confirmation-session-state branch July 15, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants