| Files | Last commit | Last update |
|---|---|---|
feat: agent-desktop mcp (#519) * feat: serve every command as an MCP tool with agent-desktop mcp Tools, schemas and argv are read from the clap command tree at runtime, so adding or removing a command changes the MCP surface with no MCP edit. Each call runs this binary as a child process, keeping the one-process-per-command model the adapters assume. Tested with unit tests over every generated tool, a process test of the stdio server, and a live GTK3 app under Xvfb, openbox and AT-SPI. * fix: bound mcp concurrency and message size, reject malformed messages A runaway client could start unbounded child processes or send one unbounded line. Calls now cap at 8 in flight with a retryable tool error, messages over 4 MiB are refused without stopping the server, and non-object JSON gets Invalid Request. Adds tests that flag-shaped values never become flags and that global flags cannot be set per call, plus a security note in the MCP guide. * fix: honor mcp cancellation and say what tools cannot set (#525) * fix: honor mcp cancellation and say what tools cannot set - notifications/cancelled now kills the call's child and frees its slot. Calls are registered before their thread starts, so a cancel that arrives first still lands. Before, a cancelled call ran to the end and held one of the 8 slots. - Server instructions and the MCP guide say global flags (session, agent id, headed, wait-for, trace) come only from the server's command line, and map the skills' CLI syntax to tool calls. Drops the 'removes nothing' claim and corrects the wrong-type error sentence. - mcp parse errors report command mcp instead of unknown, through one root_command() shared by main and the diagnostic. - key-down and key-up help says they fail closed, as mouse-down and mouse-up already do. - Tests: global flags go after mcp as documented and cover a boolean and a value flag; the NUL case now reaches spawn and checks its message. Tested: fmt, clippy -D warnings on the Linux host set, cargo test -p agent-desktop under dbus and Xvfb, and a live MCP client: cancel returns in about 20 ms and frees the slot (before: no reply in 15 s, next call busy). * fix: never start a cancelled mcp call and release every request id Review on the previous commit found two defects: a cancel that arrived before the call spawned still ran the command until the kill, and a tools/call rejected before running (unknown tool, bad arguments) left its id registered forever. - A Calls registry (src/mcp/calls.rs) owns the request-id lifecycle. The read loop admits an id, the call spawns under the registry lock, so a cancel lands either before the spawn (nothing runs) or after it (the child is killed), and respond() releases the id on every path. - A cancelled call gets no response, as the MCP cancellation spec asks. - A tools/call whose id is already in flight gets Invalid Request instead of silently sharing a slot. - stderr is captured again, so the no-envelope error keeps the child's stderr as before this branch. Tested: fmt, clippy -D warnings, cargo test -p agent-desktop under dbus and Xvfb, unit tests for cancel-before-start and id release (each fails when its check is removed), and a live MCP client: a cancelled call is killed and gets no response, an id is reusable after a protocol error, a duplicate in-flight id is refused, and a freed slot is reused. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> * fix: let a cancelled mcp call release held input before it is killed Cancelling a headed drag on Linux while its button was down SIGKILLed the CLI, so its input-release handler never ran and the desktop kept the button held. A cancelled child now gets SIGTERM first. The CLI's existing Linux handler releases held keys and buttons (it waits up to 2 s for that) and exits. The child is killed only if it is still running 3 s later. The wait runs on its own thread so the read loop never blocks. Windows has no SIGTERM and still kills at once. Adds libc to the binary on unix for kill(2). Tested: fmt, clippy -D warnings, cargo test --locked -p agent-desktop under dbus and Xvfb, a unit test that a cancelled child sees SIGTERM before any kill (fails when SIGTERM is skipped), a check that a child ignoring SIGTERM is killed after 3 s, and a live headed drag under Xvfb, openbox and AT-SPI cancelled mid-drag over MCP: button[1] stayed down before this change and is up after it. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> | 5 days ago | |
feat: agent-desktop mcp (#519) * feat: serve every command as an MCP tool with agent-desktop mcp Tools, schemas and argv are read from the clap command tree at runtime, so adding or removing a command changes the MCP surface with no MCP edit. Each call runs this binary as a child process, keeping the one-process-per-command model the adapters assume. Tested with unit tests over every generated tool, a process test of the stdio server, and a live GTK3 app under Xvfb, openbox and AT-SPI. * fix: bound mcp concurrency and message size, reject malformed messages A runaway client could start unbounded child processes or send one unbounded line. Calls now cap at 8 in flight with a retryable tool error, messages over 4 MiB are refused without stopping the server, and non-object JSON gets Invalid Request. Adds tests that flag-shaped values never become flags and that global flags cannot be set per call, plus a security note in the MCP guide. * fix: honor mcp cancellation and say what tools cannot set (#525) * fix: honor mcp cancellation and say what tools cannot set - notifications/cancelled now kills the call's child and frees its slot. Calls are registered before their thread starts, so a cancel that arrives first still lands. Before, a cancelled call ran to the end and held one of the 8 slots. - Server instructions and the MCP guide say global flags (session, agent id, headed, wait-for, trace) come only from the server's command line, and map the skills' CLI syntax to tool calls. Drops the 'removes nothing' claim and corrects the wrong-type error sentence. - mcp parse errors report command mcp instead of unknown, through one root_command() shared by main and the diagnostic. - key-down and key-up help says they fail closed, as mouse-down and mouse-up already do. - Tests: global flags go after mcp as documented and cover a boolean and a value flag; the NUL case now reaches spawn and checks its message. Tested: fmt, clippy -D warnings on the Linux host set, cargo test -p agent-desktop under dbus and Xvfb, and a live MCP client: cancel returns in about 20 ms and frees the slot (before: no reply in 15 s, next call busy). * fix: never start a cancelled mcp call and release every request id Review on the previous commit found two defects: a cancel that arrived before the call spawned still ran the command until the kill, and a tools/call rejected before running (unknown tool, bad arguments) left its id registered forever. - A Calls registry (src/mcp/calls.rs) owns the request-id lifecycle. The read loop admits an id, the call spawns under the registry lock, so a cancel lands either before the spawn (nothing runs) or after it (the child is killed), and respond() releases the id on every path. - A cancelled call gets no response, as the MCP cancellation spec asks. - A tools/call whose id is already in flight gets Invalid Request instead of silently sharing a slot. - stderr is captured again, so the no-envelope error keeps the child's stderr as before this branch. Tested: fmt, clippy -D warnings, cargo test -p agent-desktop under dbus and Xvfb, unit tests for cancel-before-start and id release (each fails when its check is removed), and a live MCP client: a cancelled call is killed and gets no response, an id is reusable after a protocol error, a duplicate in-flight id is refused, and a freed slot is reused. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> * fix: let a cancelled mcp call release held input before it is killed Cancelling a headed drag on Linux while its button was down SIGKILLed the CLI, so its input-release handler never ran and the desktop kept the button held. A cancelled child now gets SIGTERM first. The CLI's existing Linux handler releases held keys and buttons (it waits up to 2 s for that) and exits. The child is killed only if it is still running 3 s later. The wait runs on its own thread so the read loop never blocks. Windows has no SIGTERM and still kills at once. Adds libc to the binary on unix for kill(2). Tested: fmt, clippy -D warnings, cargo test --locked -p agent-desktop under dbus and Xvfb, a unit test that a cancelled child sees SIGTERM before any kill (fails when SIGTERM is skipped), a check that a child ignoring SIGTERM is killed after 3 s, and a live headed drag under Xvfb, openbox and AT-SPI cancelled mid-drag over MCP: button[1] stayed down before this change and is up after it. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> | 5 days ago | |
feat: agent-desktop mcp (#519) * feat: serve every command as an MCP tool with agent-desktop mcp Tools, schemas and argv are read from the clap command tree at runtime, so adding or removing a command changes the MCP surface with no MCP edit. Each call runs this binary as a child process, keeping the one-process-per-command model the adapters assume. Tested with unit tests over every generated tool, a process test of the stdio server, and a live GTK3 app under Xvfb, openbox and AT-SPI. * fix: bound mcp concurrency and message size, reject malformed messages A runaway client could start unbounded child processes or send one unbounded line. Calls now cap at 8 in flight with a retryable tool error, messages over 4 MiB are refused without stopping the server, and non-object JSON gets Invalid Request. Adds tests that flag-shaped values never become flags and that global flags cannot be set per call, plus a security note in the MCP guide. * fix: honor mcp cancellation and say what tools cannot set (#525) * fix: honor mcp cancellation and say what tools cannot set - notifications/cancelled now kills the call's child and frees its slot. Calls are registered before their thread starts, so a cancel that arrives first still lands. Before, a cancelled call ran to the end and held one of the 8 slots. - Server instructions and the MCP guide say global flags (session, agent id, headed, wait-for, trace) come only from the server's command line, and map the skills' CLI syntax to tool calls. Drops the 'removes nothing' claim and corrects the wrong-type error sentence. - mcp parse errors report command mcp instead of unknown, through one root_command() shared by main and the diagnostic. - key-down and key-up help says they fail closed, as mouse-down and mouse-up already do. - Tests: global flags go after mcp as documented and cover a boolean and a value flag; the NUL case now reaches spawn and checks its message. Tested: fmt, clippy -D warnings on the Linux host set, cargo test -p agent-desktop under dbus and Xvfb, and a live MCP client: cancel returns in about 20 ms and frees the slot (before: no reply in 15 s, next call busy). * fix: never start a cancelled mcp call and release every request id Review on the previous commit found two defects: a cancel that arrived before the call spawned still ran the command until the kill, and a tools/call rejected before running (unknown tool, bad arguments) left its id registered forever. - A Calls registry (src/mcp/calls.rs) owns the request-id lifecycle. The read loop admits an id, the call spawns under the registry lock, so a cancel lands either before the spawn (nothing runs) or after it (the child is killed), and respond() releases the id on every path. - A cancelled call gets no response, as the MCP cancellation spec asks. - A tools/call whose id is already in flight gets Invalid Request instead of silently sharing a slot. - stderr is captured again, so the no-envelope error keeps the child's stderr as before this branch. Tested: fmt, clippy -D warnings, cargo test -p agent-desktop under dbus and Xvfb, unit tests for cancel-before-start and id release (each fails when its check is removed), and a live MCP client: a cancelled call is killed and gets no response, an id is reusable after a protocol error, a duplicate in-flight id is refused, and a freed slot is reused. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> * fix: let a cancelled mcp call release held input before it is killed Cancelling a headed drag on Linux while its button was down SIGKILLed the CLI, so its input-release handler never ran and the desktop kept the button held. A cancelled child now gets SIGTERM first. The CLI's existing Linux handler releases held keys and buttons (it waits up to 2 s for that) and exits. The child is killed only if it is still running 3 s later. The wait runs on its own thread so the read loop never blocks. Windows has no SIGTERM and still kills at once. Adds libc to the binary on unix for kill(2). Tested: fmt, clippy -D warnings, cargo test --locked -p agent-desktop under dbus and Xvfb, a unit test that a cancelled child sees SIGTERM before any kill (fails when SIGTERM is skipped), a check that a child ignoring SIGTERM is killed after 3 s, and a live headed drag under Xvfb, openbox and AT-SPI cancelled mid-drag over MCP: button[1] stayed down before this change and is up after it. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> | 5 days ago | |
feat: accept stdin for text commands (#373) * feat: accept stdin for text commands * docs: clarify stdin input rules and examples * fix: tighten stdin input and output handling * test: adapt MCP text checks to stdin input * test: reject stdin input through MCP * refactor: move snapshot owner selection helper * style: format stdin help attribute | 4 days ago | |
feat: accept stdin for text commands (#373) * feat: accept stdin for text commands * docs: clarify stdin input rules and examples * fix: tighten stdin input and output handling * test: adapt MCP text checks to stdin input * test: reject stdin input through MCP * refactor: move snapshot owner selection helper * style: format stdin help attribute | 4 days ago | |
feat: agent-desktop mcp (#519) * feat: serve every command as an MCP tool with agent-desktop mcp Tools, schemas and argv are read from the clap command tree at runtime, so adding or removing a command changes the MCP surface with no MCP edit. Each call runs this binary as a child process, keeping the one-process-per-command model the adapters assume. Tested with unit tests over every generated tool, a process test of the stdio server, and a live GTK3 app under Xvfb, openbox and AT-SPI. * fix: bound mcp concurrency and message size, reject malformed messages A runaway client could start unbounded child processes or send one unbounded line. Calls now cap at 8 in flight with a retryable tool error, messages over 4 MiB are refused without stopping the server, and non-object JSON gets Invalid Request. Adds tests that flag-shaped values never become flags and that global flags cannot be set per call, plus a security note in the MCP guide. * fix: honor mcp cancellation and say what tools cannot set (#525) * fix: honor mcp cancellation and say what tools cannot set - notifications/cancelled now kills the call's child and frees its slot. Calls are registered before their thread starts, so a cancel that arrives first still lands. Before, a cancelled call ran to the end and held one of the 8 slots. - Server instructions and the MCP guide say global flags (session, agent id, headed, wait-for, trace) come only from the server's command line, and map the skills' CLI syntax to tool calls. Drops the 'removes nothing' claim and corrects the wrong-type error sentence. - mcp parse errors report command mcp instead of unknown, through one root_command() shared by main and the diagnostic. - key-down and key-up help says they fail closed, as mouse-down and mouse-up already do. - Tests: global flags go after mcp as documented and cover a boolean and a value flag; the NUL case now reaches spawn and checks its message. Tested: fmt, clippy -D warnings on the Linux host set, cargo test -p agent-desktop under dbus and Xvfb, and a live MCP client: cancel returns in about 20 ms and frees the slot (before: no reply in 15 s, next call busy). * fix: never start a cancelled mcp call and release every request id Review on the previous commit found two defects: a cancel that arrived before the call spawned still ran the command until the kill, and a tools/call rejected before running (unknown tool, bad arguments) left its id registered forever. - A Calls registry (src/mcp/calls.rs) owns the request-id lifecycle. The read loop admits an id, the call spawns under the registry lock, so a cancel lands either before the spawn (nothing runs) or after it (the child is killed), and respond() releases the id on every path. - A cancelled call gets no response, as the MCP cancellation spec asks. - A tools/call whose id is already in flight gets Invalid Request instead of silently sharing a slot. - stderr is captured again, so the no-envelope error keeps the child's stderr as before this branch. Tested: fmt, clippy -D warnings, cargo test -p agent-desktop under dbus and Xvfb, unit tests for cancel-before-start and id release (each fails when its check is removed), and a live MCP client: a cancelled call is killed and gets no response, an id is reusable after a protocol error, a duplicate in-flight id is refused, and a freed slot is reused. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> * fix: let a cancelled mcp call release held input before it is killed Cancelling a headed drag on Linux while its button was down SIGKILLed the CLI, so its input-release handler never ran and the desktop kept the button held. A cancelled child now gets SIGTERM first. The CLI's existing Linux handler releases held keys and buttons (it waits up to 2 s for that) and exits. The child is killed only if it is still running 3 s later. The wait runs on its own thread so the read loop never blocks. Windows has no SIGTERM and still kills at once. Adds libc to the binary on unix for kill(2). Tested: fmt, clippy -D warnings, cargo test --locked -p agent-desktop under dbus and Xvfb, a unit test that a cancelled child sees SIGTERM before any kill (fails when SIGTERM is skipped), a check that a child ignoring SIGTERM is killed after 3 s, and a live headed drag under Xvfb, openbox and AT-SPI cancelled mid-drag over MCP: button[1] stayed down before this change and is up after it. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> | 5 days ago | |
feat: agent-desktop mcp (#519) * feat: serve every command as an MCP tool with agent-desktop mcp Tools, schemas and argv are read from the clap command tree at runtime, so adding or removing a command changes the MCP surface with no MCP edit. Each call runs this binary as a child process, keeping the one-process-per-command model the adapters assume. Tested with unit tests over every generated tool, a process test of the stdio server, and a live GTK3 app under Xvfb, openbox and AT-SPI. * fix: bound mcp concurrency and message size, reject malformed messages A runaway client could start unbounded child processes or send one unbounded line. Calls now cap at 8 in flight with a retryable tool error, messages over 4 MiB are refused without stopping the server, and non-object JSON gets Invalid Request. Adds tests that flag-shaped values never become flags and that global flags cannot be set per call, plus a security note in the MCP guide. * fix: honor mcp cancellation and say what tools cannot set (#525) * fix: honor mcp cancellation and say what tools cannot set - notifications/cancelled now kills the call's child and frees its slot. Calls are registered before their thread starts, so a cancel that arrives first still lands. Before, a cancelled call ran to the end and held one of the 8 slots. - Server instructions and the MCP guide say global flags (session, agent id, headed, wait-for, trace) come only from the server's command line, and map the skills' CLI syntax to tool calls. Drops the 'removes nothing' claim and corrects the wrong-type error sentence. - mcp parse errors report command mcp instead of unknown, through one root_command() shared by main and the diagnostic. - key-down and key-up help says they fail closed, as mouse-down and mouse-up already do. - Tests: global flags go after mcp as documented and cover a boolean and a value flag; the NUL case now reaches spawn and checks its message. Tested: fmt, clippy -D warnings on the Linux host set, cargo test -p agent-desktop under dbus and Xvfb, and a live MCP client: cancel returns in about 20 ms and frees the slot (before: no reply in 15 s, next call busy). * fix: never start a cancelled mcp call and release every request id Review on the previous commit found two defects: a cancel that arrived before the call spawned still ran the command until the kill, and a tools/call rejected before running (unknown tool, bad arguments) left its id registered forever. - A Calls registry (src/mcp/calls.rs) owns the request-id lifecycle. The read loop admits an id, the call spawns under the registry lock, so a cancel lands either before the spawn (nothing runs) or after it (the child is killed), and respond() releases the id on every path. - A cancelled call gets no response, as the MCP cancellation spec asks. - A tools/call whose id is already in flight gets Invalid Request instead of silently sharing a slot. - stderr is captured again, so the no-envelope error keeps the child's stderr as before this branch. Tested: fmt, clippy -D warnings, cargo test -p agent-desktop under dbus and Xvfb, unit tests for cancel-before-start and id release (each fails when its check is removed), and a live MCP client: a cancelled call is killed and gets no response, an id is reusable after a protocol error, a duplicate in-flight id is refused, and a freed slot is reused. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> * fix: let a cancelled mcp call release held input before it is killed Cancelling a headed drag on Linux while its button was down SIGKILLed the CLI, so its input-release handler never ran and the desktop kept the button held. A cancelled child now gets SIGTERM first. The CLI's existing Linux handler releases held keys and buttons (it waits up to 2 s for that) and exits. The child is killed only if it is still running 3 s later. The wait runs on its own thread so the read loop never blocks. Windows has no SIGTERM and still kills at once. Adds libc to the binary on unix for kill(2). Tested: fmt, clippy -D warnings, cargo test --locked -p agent-desktop under dbus and Xvfb, a unit test that a cancelled child sees SIGTERM before any kill (fails when SIGTERM is skipped), a check that a child ignoring SIGTERM is killed after 3 s, and a live headed drag under Xvfb, openbox and AT-SPI cancelled mid-drag over MCP: button[1] stayed down before this change and is up after it. --------- Co-authored-by: roboeve[bot] <311457182+roboeve[bot]@users.noreply.github.com> | 5 days ago |
| Files | Last commit | Last update |
|---|---|---|
| 5 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 4 days ago | ||
| 4 days ago | ||
| 5 days ago | ||
| 5 days ago |