dbus: add remote parameter to CreateSession

The D-Bus method was missing the remote parameter that session.Manager
already supports. Add it as the 6th arg after system_prompt so frontends
can create remote execution sessions via D-Bus.
This commit is contained in:
Levi Neely 2026-07-24 11:58:01 +02:00
parent 32abf7a00c
commit af7363cb1d
2 changed files with 7 additions and 3 deletions

View File

@ -217,7 +217,7 @@ func (a *DBusAdapter) stopWatcher(id string) {
// --- D-Bus exported methods --- // --- D-Bus exported methods ---
func (a *DBusAdapter) CreateSession(cwd, backendName, modelName, agentName, systemPrompt string) (string, *dbus.Error) { func (a *DBusAdapter) CreateSession(cwd, backendName, modelName, agentName, systemPrompt, remote string) (string, *dbus.Error) {
var args []string var args []string
if cwd != "" { if cwd != "" {
args = append(args, "cwd="+cwd) args = append(args, "cwd="+cwd)
@ -234,6 +234,9 @@ func (a *DBusAdapter) CreateSession(cwd, backendName, modelName, agentName, syst
if systemPrompt != "" { if systemPrompt != "" {
args = append(args, "system_prompt="+systemPrompt) args = append(args, "system_prompt="+systemPrompt)
} }
if remote != "" {
args = append(args, "remote="+remote)
}
if cwd == "" { if cwd == "" {
dir, _ := os.Getwd() dir, _ := os.Getwd()
args = append(args, "cwd="+dir) args = append(args, "cwd="+dir)
@ -669,6 +672,7 @@ var introspectXML = `<node>
<arg direction="in" type="s" name="model"/> <arg direction="in" type="s" name="model"/>
<arg direction="in" type="s" name="agent"/> <arg direction="in" type="s" name="agent"/>
<arg direction="in" type="s" name="systemPrompt"/> <arg direction="in" type="s" name="systemPrompt"/>
<arg direction="in" type="s" name="remote"/>
<arg direction="out" type="s"/> <arg direction="out" type="s"/>
</method> </method>
<method name="ListSessions"><arg direction="out" type="as"/></method> <method name="ListSessions"><arg direction="out" type="as"/></method>

View File

@ -35,7 +35,7 @@ All session operations go through the D-Bus interface.
| Method | Args | Returns | Purpose | | Method | Args | Returns | Purpose |
|---|---|---|---| |---|---|---|---|
| `CreateSession` | cwd, backend, model, agent, system_prompt | session_id | Create a new session | | `CreateSession` | cwd, backend, model, agent, system_prompt, remote | session_id | Create a new session |
| `ListSessions` | — | array of "id\tstate\tmodel\tagent" | Discover sessions | | `ListSessions` | — | array of "id\tstate\tmodel\tagent" | Discover sessions |
| `KillSession` | session_id | bool | Terminate a session | | `KillSession` | session_id | bool | Terminate a session |
| `RenameSession` | session_id, new_name | bool | Rename a session | | `RenameSession` | session_id, new_name | bool | Rename a session |
@ -119,7 +119,7 @@ dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-r
# Create a session # Create a session
dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \ dbus-send --session --dest=org.ollie.SessionManager --type=method_call --print-reply \
/org/ollie/SessionManager org.ollie.SessionManager.CreateSession \ /org/ollie/SessionManager org.ollie.SessionManager.CreateSession \
string:"$PWD" string:"" string:"" string:"default" string:"" string:"$PWD" string:"" string:"" string:"default" string:"" string:""
# Submit a prompt # Submit a prompt
dbus-send --session --dest=org.ollie.SessionManager --type=method_call \ dbus-send --session --dest=org.ollie.SessionManager --type=method_call \