From 2ed2fbc28453e1895a9840eb9b3b56e64a692450 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 20:51:45 +0000 Subject: [PATCH 1/3] Initial plan From 2005b3df5fe7909c5649bc9b599249cb035dfe53 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 20:53:51 +0000 Subject: [PATCH 2/3] Docs: clarify @arg type vs signature type hint relationship Agent-Logs-Url: https://github.com/nihilok/run/sessions/c554870a-7425-42dd-9b72-58df6c35826a Co-authored-by: nihilok <70285461+nihilok@users.noreply.github.com> --- run/docs/arguments.md | 2 ++ run/docs/attributes-and-interpreters.md | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/run/docs/arguments.md b/run/docs/arguments.md index c28cce4..02063f4 100644 --- a/run/docs/arguments.md +++ b/run/docs/arguments.md @@ -47,6 +47,8 @@ Type hints (`str`, `int`, `float`/`number`, `bool`, `object`/`obj`/`dict`) are u - `bool`/`boolean` — parsed as a boolean (truthy: `true`, `1`, `yes`) - `object`/`obj`/`dict` — parsed from a JSON string into a native object/dict +Signature type hints take precedence over any type keyword in a matching `@arg` attribute. The `@arg` type is only consulted when the function has no typed signature (e.g., legacy shell functions using `$1`, `$2`). See [`@arg` type vs. signature type hint](./attributes-and-interpreters.md#descriptions-and-args) for the full precedence rules. + ## Quoting and spaces Arguments are passed as plain CLI tokens. Quote values containing spaces or shell-sensitive characters: ```bash diff --git a/run/docs/attributes-and-interpreters.md b/run/docs/attributes-and-interpreters.md index cd1e586..2ff6400 100644 --- a/run/docs/attributes-and-interpreters.md +++ b/run/docs/attributes-and-interpreters.md @@ -4,7 +4,7 @@ Attributes live in comments (`# @key value`) and adjust how a function is expose ## Descriptions and args - `@desc` — one-line summary shown in listings and MCP tool schemas. -- `@arg [type] ` — add human-readable parameter docs. Names should match the signature. Optional type keyword (`string`, `integer`, `float`/`number`, `boolean`, `object`/`dict`) sets the JSON schema type for MCP. +- `@arg [type] ` — add human-readable parameter docs. Names should match the signature. Optional type keyword (`string`, `integer`, `float`/`number`, `boolean`, `object`/`dict`) sets the JSON schema type for MCP when the function has no typed signature. - `@instructions ` — top-level MCP guidance line appended to server `initialize.instructions`. This is single-line and repeatable; lines are aggregated in merged/source order. ```bash @@ -14,6 +14,13 @@ Attributes live in comments (`# @key value`) and adjust how a function is expose deploy(env: str, version = "latest") { ... } ``` +> **`@arg` type vs. signature type hint:** The type keyword in `@arg` and the type annotation in the function signature serve related but distinct purposes: +> +> - **Signature type hint** (e.g., `env: str`) is the primary driver. When a typed signature is present, it controls the MCP JSON schema type *and*, in polyglot functions (Python, Node.js, Ruby), drives automatic runtime value conversion. +> - **`@arg` type keyword** (e.g., `# @arg env string …`) is a fallback used when the function has no typed signature — for example, shell functions that rely on positional variables (`$1`, `$2`). In that case, the `@arg` type sets the MCP schema type. +> - **`@arg` description** is always used regardless of whether a signature type hint is present. +> - The two do not need to agree, but keeping them consistent is recommended. If they conflict, the signature type hint wins for MCP schema generation. + Top-level MCP instruction example: ```bash From 81ef41f9877be556d15b4db5c072131e7e2575dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 21:00:32 +0000 Subject: [PATCH 3/3] Fix Clippy duration_suboptimal_units in mcp_server_test.rs Agent-Logs-Url: https://github.com/nihilok/run/sessions/19e0dd22-cb97-45c0-b210-bd89a79b0355 Co-authored-by: nihilok <70285461+nihilok@users.noreply.github.com> --- run/tests/mcp_server_test.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run/tests/mcp_server_test.rs b/run/tests/mcp_server_test.rs index b94aa5e..9a3d3dd 100644 --- a/run/tests/mcp_server_test.rs +++ b/run/tests/mcp_server_test.rs @@ -546,7 +546,7 @@ greet(name: str) echo "Hello, $name!" writeln!(stdin, "{}", serde_json::to_string(&call_request).unwrap()).unwrap(); stdin.flush().unwrap(); - std::thread::sleep(Duration::from_millis(1000)); + std::thread::sleep(Duration::from_secs(1)); child.kill().expect("Failed to kill process"); let output = child.wait_with_output().unwrap(); @@ -604,7 +604,7 @@ fail() { writeln!(stdin, "{}", serde_json::to_string(&call_request).unwrap()).unwrap(); stdin.flush().unwrap(); - std::thread::sleep(Duration::from_millis(1000)); + std::thread::sleep(Duration::from_secs(1)); child.kill().expect("Failed to kill process"); let output = child.wait_with_output().unwrap(); @@ -994,7 +994,7 @@ check() { // Allow extra time because the MCP server spawns a subprocess to run the function. // Existing tests use 500 ms for requests that don't fork; we need more here. - std::thread::sleep(std::time::Duration::from_millis(2000)); + std::thread::sleep(std::time::Duration::from_secs(2)); child.kill().expect("Failed to kill process"); let output = child.wait_with_output().unwrap();