Repository navigation
Qt starts ACP agents through the shared agent owners; Android declares it starts none - #2111
Merged
Merged
Conversation
AgentConversation owns attach/resume/start; AgentTurnEvents owns the agent-event handlers both Conversation and QtConversation inherit; SessionTitles/FirstPromptTitle own titling for MainScreen and the Qt ACP view. Agent spawning moves to OperationalSessionSources.spawn_agent behind AgentProcesses (Android: NoAgentProcesses refuses). Qt gets a QtSurfaceBinding (tool/terminal live blocks, permission asks through QtQuestion), and --agent on toad.qt.main attaches a launch binding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… surface The connection owns whether agents spawn (LocalCoreConnection does, a UI profile does not), and toad.qt.main / qt_drive select their connection as the TUI does. AgentBinding.launched resolves -a for both. Qt's run_worker shows a failed worker instead of holding it unread, call_later awaits a coroutine callback, notify is shared InputAttention, a closed Qt view retires its agent surface, and the scripted peer gains a terminal step for one FULL_TURN that the TUI test and the Qt drive both send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…close as Textual's A live tool call is a QtToolTranscriptFragment (AgentActivityPresentation.tool: title, status, details behind the disclosure), a terminal the same with its output open; no row_markdown copies in tool_output. Qt's workspace finish closes a view's receivers and history reads before deleting it, as Textual's teardown does; QtConversation owns the history retirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… -a, chosen buses toad.qt.main (now split, client_start loading after the first frame) selects its connection with CoreConnection.select and attaches -a through AgentBinding.launched; a chosen bus is read by the connection the window runs on (CoreConnection.chosen), so a local desktop window switches buses as Textual does and Android keeps decoding in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
detach already closes them (forget -> close_core_events); a second close unsubscribed the activity rows twice. The history's reads end there now that QtConversation.close_core_events retires the history for every Qt conversation, thread views included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…ntry only After #2108 the local route lives in toad.client.local_connection. It is this machine's own bus, the one connection agents start under: its LocalCoreConnection carries SpawnsAgentProcesses and reads a chosen bus with select_connection. toad.qt.main (the desktop entry, after its first frame) selects the connection and hands it to client_start.serve_launch, so the shared Qt modules and Android's start never import it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
trissim
force-pushed
the
fork-qt-acp-agents
branch
from
November 18, 2026 07:49
0cc93da to
9116ace
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.
Desktop Qt now starts ACP agents and runs a full agent turn the way the TUI does, through owners both frontends inherit. Android declares through its connection that it starts none.
The five pieces
toad/qt/agent_surface.py).QtSurfaceBindingis the QtSurfaceBinding, and the agent attaches it throughAgentConversation.agent_surface.subscribe_agent→AgentEventSubscription→ the view's declared handlers). This replaces Textual'spost_message.QtLiveToolFragment(QtToolTranscriptFragment)→AgentActivityPresentation.tool: title and ✓, details behind the disclosure).QtTerminalBlock) are the same presentation with their output open, attached byTerminalExecution.attachas its view. This replaces Textual'sTerminalToolpath.AgentTurnEvents(new) holds the Update / Thinking / RequestPermission / ToolCall / AvailableCommandsUpdate handlers once. Textual'sConversationand Qt'sQtConversationboth inherit them, and the Textual copies are deleted.OperationalSessionSources.create_agentasksapp.agent_processes.spawn_agentbuilds and binds theAgent;agent_refusedsays why and presents the view without one. Creation moved out ofsession_presentation.AgentProcesses(new, a light module) is a capability the Core connection owns.LocalCoreConnection(intoad.client.local_connectionsince client: the local route's Core lives in its own module; Qt never imports it #2108: this machine's own bus) spawns agents.RemoteCoreConnection, reached through a UI profile, refuses: the ACP child writes its prompts under the local route's maintenance gate, which a remote client does not hold.QtAcpSessionViewimplementsAgentConversation.AgentConversationnow holds the concrete start chain once (attach_launch,resume_agent_session,start_native_session,start_unbound_session,_start_agent). Each frontend answers onlypresent_without_agent,defer_agent_startandagent_surface.launch.attach_to(self, self)when first shown.SessionTitles/FirstPromptTitle, for bothMainScreenand the Qt view).toad.qt.main, after its first frame, selects its Core withlocal_connection.select_connection, astoaddoes, and hands it toclient_start.serve_launch.--comms-profile PROFILEgives a remote Core; otherwise this machine's bus, or--comms-root ROOT.local_connection. The shared Qt modules (client_start,window, …) never do, and Android's start, always remote, never loads it (checked in-process:toad.client.local_connectionis absent fromsys.modulesafter importingtoad.qt.android,client_startandwindow).-a NAMEattaches throughAgentBinding.launched, whichtoad -anow uses too.session_navigation.start_agent_session.CoreConnection.chosen:select_connectiononLocalCoreConnection, its own member on a remote one), so a local desktop window switches buses and Android keeps decoding in place.QtQuestion(aChoiceQuestion), and the answer goes back throughPermissionRequest.answer. A file-write review also notifies the desktop, as Textual's does:notifyis now sharedInputAttention(each frontend answersdeliver), and Qt answersapp_focus.RemoteCoreConnection.agent_processes(NoAgentProcesses) refuses with a reason. There is nogetandroidapilevelcheck.Failures Qt was hiding, now surfaced and fixed
QtConversation.run_worker(the sharedAsyncioPublications.run_worker) kept each worker task in_workersand never read its result.AttributeError: 'QtWindowAttention' object has no attribute 'notify'.PermissionRequest.presentretired its projection and re-raised, but nothing read the raise. The question stayed on screen and its answer was refused (binding in _projectionswas False).run_workernow shows and saves a failed worker (app.show_error), as a failed Textual worker ends that app.notifyexists on Qt.present's retire-then-raise is unchanged: it re-raises, and it lets a failed presentation be presented again.QtConversation.call_latercalled a coroutine callback without awaiting it, soAgentSubmissionExecution.completenever ran (Python warned the coroutine was never awaited). It now awaits it, as Textual'scall_laterdoes.QtWorkspaceViews.finishnow retires the agent surface (retire_surface), as Textual's unmount does.QtConversation.close_core_eventsretires the history for every Qt conversation; thread views skipped this, so their reads outlived the window.QtAcpSessionView.modereadsession_details.identity.mode, which never existed. It now readssession_details.mode_name.Evidence: one stub turn, both frontends (no model)
The tests' scripted ACP peer gains a
terminalstep.support.agents.FULL_TURNis one turn of every kind: a reply, a thought, a completed tool call with output, a permission question, a terminal runningecho, and a closing line.tests/app/test_full_agent_turn.pysendsFULL_TURN, answers Allow, and checks the terminal output, the answer at the peer (Allow) and the terminal exit (0). It passes.tools/qt_drive.py agent_session OUT --comms-root ROOT, on a freshly seeded scratch root with fresh XDG state, offscreen, sends the sameFULL_TURN. Its rows:1-agent-ready:agent='Test peer'.2-permission-asked:Agent / TURN_REPLY one two three,TURN_THOUGHT,▶ 🔧 TURN_TOOL read ✔; questionTURN_PERMISSION.3-turn-over, after clicking Allow:▼ 🔧 $ echo TURN_TERMINAL_OUTPUT ✔ / $ echo TURN_TERMINAL_OUTPUT / TURN_TERMINAL_OUTPUT,· 🔧 echo TURN_TERMINAL_OUTPUT ✔,Agent / TURN_DONE;question_visible=False busy=False.answered: Allowandterminal_exit: 0. stderr was empty and no error notices were saved.qt_drivenow selects its Core like the app:SCENARIO OUTDIR (--comms-profile PROFILE | --comms-root ROOT), andshipped_runpasses--comms-profile.Gates (once, on 9116ace, rebased onto 3712ef8)
tools/shadow_check.py: shadowing 0 (baseline 0), exit 0.tools/qt_inherit_ratchet.py: Textual-loading shared modules 11 (baseline 11); toad.qt importing widgets/screens 0 (baseline 0); bare Qt classes 21 (baseline 21); parallel copies 0 (baseline 0); exit 0.tools/android/check.sh, assembled into a folder holding an older build's leftovers (apk: assemble owns the app folder; leftovers of older builds are removed and excluded #2109): function-local imports reaching an unshipped package or Textual UI 15 (baseline 15; KNOWN_LAZY did not grow). The shipped app ran every view kind and bound key on a scratch bus, rc 0. No APK was built.agent_sessiondrive on this head gave the rows above; the peer recordedanswered: Allowandterminal_exit: 0; stderr was empty and no error notices were saved.origin/mainin the same run. No new failures.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3