Skip to content

🙌 OpenHands: AI-Driven Development

fix(plugins): reject unsupported Local launch parameters explicitly (#18622)

🐾 smolpaws83c9b64af66f
diff --git a/.pr/evidence/plugin-parameters/README.md b/.pr/evidence/plugin-parameters/README.md
new file mode 100644
index 0000000000..d0b0ba998e
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/README.md
@@ -0,0 +1,13 @@
+I am an AI agent helping Engel Nyst (@enyst) with project work.
+
+# Unsupported Local plugin parameters
+
+The issue accepts honoring a supported runtime contract or clearly rejecting an unsupported configuration before creation. Agent Server PluginSource does not have a parameters field in the supported floor or tested release; schema-boundary.json records exact source links and the observed runtime OpenAPI field names. This fix chooses explicit rejection. It does not add an unsupported field or claim runtime parameter delivery.
+
+The existing maintained F19.launch-parameters/local-delivery recipe is unchanged and reproduced the original actual-201/silently-dropped-fields defect twice on base. It is not reclassified as an xpass. unsupported-recipe.md separately proves the documented rejection alternative twice on each revision. phone-recipe.md repeats it at 390x844.
+
+Use `control-openhands bug run F19.launch-parameters --file RECIPE --name unsupported-local --attempts 2 --label LABEL --run RUN` with the same recipe on base and fix; then `control-openhands bug proof F19.launch-parameters --file RECIPE --baseline BASE_RUN --fix FIX_RUN --baseline-label BASE_LABEL --fix-label FIX_LABEL`. Saved verdicts include recipe hashes.
+
+For the real positive control, activate the checked-in CLI, export OH_VERIFY_RUN to an owned fixed run with a configured profile, and run `python .pr/evidence/plugin-parameters/positive-control.py`. It supplies no message, creates an inert plugin, drives trust and Start, verifies the actual 201 request coordinates and conversation navigation, deletes its conversations, and removes the fixture. No model response is requested.
+
+The screenshots/video are genuine Chromium captures. Private raw request bodies, credentials, profiles and session files are excluded. The fixed run was stopped and private state purged after the controls.
diff --git a/.pr/evidence/plugin-parameters/after-phone.png b/.pr/evidence/plugin-parameters/after-phone.png
new file mode 100644
index 0000000000..b61d6a60a0
Binary files /dev/null and b/.pr/evidence/plugin-parameters/after-phone.png differ
diff --git a/.pr/evidence/plugin-parameters/after.gif b/.pr/evidence/plugin-parameters/after.gif
new file mode 100644
index 0000000000..bd2dfea8f0
Binary files /dev/null and b/.pr/evidence/plugin-parameters/after.gif differ
diff --git a/.pr/evidence/plugin-parameters/after.mp4 b/.pr/evidence/plugin-parameters/after.mp4
new file mode 100644
index 0000000000..87edf944d2
Binary files /dev/null and b/.pr/evidence/plugin-parameters/after.mp4 differ
diff --git a/.pr/evidence/plugin-parameters/after.png b/.pr/evidence/plugin-parameters/after.png
new file mode 100644
index 0000000000..bb8018677b
Binary files /dev/null and b/.pr/evidence/plugin-parameters/after.png differ
diff --git a/.pr/evidence/plugin-parameters/before.png b/.pr/evidence/plugin-parameters/before.png
new file mode 100644
index 0000000000..8a81538057
Binary files /dev/null and b/.pr/evidence/plugin-parameters/before.png differ
diff --git a/.pr/evidence/plugin-parameters/desktop-proof.json b/.pr/evidence/plugin-parameters/desktop-proof.json
new file mode 100644
index 0000000000..66fea2dfb3
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/desktop-proof.json
@@ -0,0 +1,21 @@
+{
+ "ok": true,
+ "id": "F19.launch-parameters",
+ "verdict": "verified",
+ "blocks": [
+ {
+ "name": "unsupported-local",
+ "sha": "a2e2e2b6d9f2a8ab",
+ "verdict": "verified",
+ "reasons": [],
+ "baseline": {
+ "xfail": 2
+ },
+ "fix": {
+ "xpass": 2
+ },
+ "ignored": 0
+ }
+ ],
+ "hint": "Drop the Known failure note and the block's `# bug` marker in the fix's PR: the assertion now guards the corrected behavior as a normal recipe step."
+}
diff --git a/.pr/evidence/plugin-parameters/phone-proof.json b/.pr/evidence/plugin-parameters/phone-proof.json
new file mode 100644
index 0000000000..a6872c6b4c
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/phone-proof.json
@@ -0,0 +1,21 @@
+{
+ "ok": true,
+ "id": "F19.launch-parameters",
+ "verdict": "verified",
+ "blocks": [
+ {
+ "name": "unsupported-local",
+ "sha": "2a6967ed11442d4d",
+ "verdict": "verified",
+ "reasons": [],
+ "baseline": {
+ "xfail": 2
+ },
+ "fix": {
+ "xpass": 2
+ },
+ "ignored": 0
+ }
+ ],
+ "hint": "Drop the Known failure note and the block's `# bug` marker in the fix's PR: the assertion now guards the corrected behavior as a normal recipe step."
+}
diff --git a/.pr/evidence/plugin-parameters/phone-recipe.md b/.pr/evidence/plugin-parameters/phone-recipe.md
new file mode 100644
index 0000000000..8195274c0b
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/phone-recipe.md
@@ -0,0 +1,23 @@
+I am an AI agent helping Engel Nyst (@enyst) with project work.
+
+Paired proof for the documented acceptable alternative: unsupported Local parameters are identified before creation. The existing accepted-create delivery recipe is unchanged and was separately reproduced twice on base. This recipe does not claim runtime parameter support or an xpass of that accepted-create recipe.
+
+```sh known-bug F19.launch-parameters unsupported-local
+QA_PARAM_SOURCE="$OH_VERIFY_RUN/workspace/qa-unsupported-parameter-plugin"
+[ ! -L "$QA_PARAM_SOURCE" ]
+mkdir -p "$QA_PARAM_SOURCE/.plugin"
+printf '%s\n' '{"name":"qa-unsupported-parameter-plugin","version":"0.1.0","description":"Inert parameter configuration check; no skills or tools."}' > "$QA_PARAM_SOURCE/.plugin/plugin.json"
+trap 'rm -rf "$QA_PARAM_SOURCE"; control-openhands browser goto /conversations >/dev/null' EXIT
+QA_PARAM_PAYLOAD=$(jq -nc --arg source "$QA_PARAM_SOURCE" '[{source:$source,parameters:{city:"Paris",days:3,metric:true}}]' | base64 | tr -d '\n')
+QA_PARAM_QUERY=$(jq -rn --arg value "$QA_PARAM_PAYLOAD" '$value|@uri')
+control-openhands browser viewport phone
+control-openhands browser goto "/launch?plugins=$QA_PARAM_QUERY"
+control-openhands browser fill 'testid=plugin-0-param-city' Tokyo
+control-openhands browser fill 'testid=plugin-0-param-days' 7
+control-openhands browser check 'testid=plugin-0-param-metric'
+control-openhands browser check 'testid=trust-checkbox'
+control-openhands browser screenshot --feature F19.launch-parameters --name unsupported-local-phone
+control-openhands assert --field count --equals 1 --bug-shows 0 -- browser count 'testid=plugin-parameters-unsupported' # bug
+control-openhands assert --field text --equals 'This local backend does not support plugin parameters. Remove the parameters from the launch link before starting a conversation.' -- browser text 'testid=plugin-parameters-unsupported'
+control-openhands assert --field value --equals true -- browser eval 'document.querySelector("[data-testid=start-conversation-button]").disabled'
+```
diff --git a/.pr/evidence/plugin-parameters/positive-control.json b/.pr/evidence/plugin-parameters/positive-control.json
new file mode 100644
index 0000000000..abc86a7326
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/positive-control.json
@@ -0,0 +1,28 @@
+{
+ "cases": [
+ {
+ "parameters": "omitted",
+ "warning_count": 0,
+ "start_enabled": true,
+ "create_status": 201,
+ "sent_plugin_fields": [
+ "source"
+ ],
+ "message_supplied": false,
+ "delete_status": 200
+ },
+ {
+ "parameters": "empty-object",
+ "warning_count": 0,
+ "start_enabled": true,
+ "create_status": 201,
+ "sent_plugin_fields": [
+ "source"
+ ],
+ "message_supplied": false,
+ "delete_status": 200
+ }
+ ],
+ "model_response_requested": false,
+ "fixture_removed": true
+}
diff --git a/.pr/evidence/plugin-parameters/positive-control.py b/.pr/evidence/plugin-parameters/positive-control.py
new file mode 100644
index 0000000000..a15ba6a319
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/positive-control.py
@@ -0,0 +1,76 @@
+"""Real CLI positive control. Set OH_VERIFY_RUN to the owned fixed run.
+
+I am an AI agent helping Engel Nyst (@enyst) with project work.
+No message is supplied and no model response is requested. Fixture conversations
+and the inert plugin directory are removed in finally blocks.
+"""
+import base64
+import json
+import os
+from pathlib import Path
+import re
+import shutil
+import subprocess
+from urllib.parse import quote
+
+
+def cli(*args):
+ result = subprocess.run(
+ ["control-openhands", *args], capture_output=True, text=True, check=False
+ )
+ payload = json.loads(result.stdout)
+ if result.returncode:
+ raise RuntimeError(f"CLI action failed: {args[:2]}")
+ return payload
+
+
+run = Path(os.environ["OH_VERIFY_RUN"])
+source = run / "workspace" / "qa-coordinate-only-plugin"
+assert not source.exists() and not source.is_symlink()
+(source / ".plugin").mkdir(parents=True)
+(source / ".plugin/plugin.json").write_text(json.dumps({
+ "name": "qa-coordinate-only-plugin", "version": "0.1.0",
+ "description": "Inert launch check; no tools, skills, or messages.",
+}))
+cases = []
+try:
+ cli("browser", "viewport", "desktop")
+ for mode in ["omitted", "empty-object"]:
+ created_id = None
+ try:
+ plugin = {"source": str(source)}
+ if mode == "empty-object":
+ plugin["parameters"] = {}
+ query = quote(base64.b64encode(json.dumps([plugin]).encode()).decode(), safe="")
+ cli("browser", "goto", "/launch?plugins=" + query)
+ assert cli("browser", "count", "testid=plugin-parameters-unsupported")["count"] == 0
+ cli("browser", "check", "testid=trust-checkbox")
+ assert cli("browser", "enabled", "testid=start-conversation-button")["enabled"]
+ cli("browser", "network", "--clear")
+ cli("browser", "click", "testid=start-conversation-button")
+ cli("browser", "wait-url", "/conversations/[0-9a-f-]{36}")
+ created_id = re.search(r"/conversations/([0-9a-f-]{36})", cli("browser", "url")["url"])[1]
+ network = cli("browser", "network", "--filter", "/api/conversations$", "--bodies")
+ requests = [r for r in network["recent"] if r.get("method") == "POST"]
+ assert len(requests) == 1 and requests[0]["status"] == 201
+ sent = requests[0]["bodyFields"]["plugins"]
+ assert len(sent) == 1 and sent[0]["source"] == str(source)
+ assert "parameters" not in sent[0]
+ assert set(sent[0]) <= {"source", "ref", "repo_path"}
+ cli("browser", "screenshot", "--feature", "F19.launch-parameters", "--name", "positive-" + mode)
+ cases.append({"parameters": mode, "warning_count": 0,
+ "start_enabled": True, "create_status": 201,
+ "sent_plugin_fields": sorted(sent[0]),
+ "message_supplied": False})
+ finally:
+ if created_id:
+ removed = cli("api", "DELETE", "/api/conversations/" + created_id, "--write")
+ assert removed["status"] == 200
+ if cases and cases[-1]["parameters"] == mode:
+ cases[-1]["delete_status"] = removed["status"]
+ cli("browser", "goto", "/conversations")
+finally:
+ shutil.rmtree(source)
+
+print(json.dumps({"cases": cases, "model_response_requested": False,
+ "fixture_removed": not source.exists()}, indent=2))
diff --git a/.pr/evidence/plugin-parameters/schema-boundary.json b/.pr/evidence/plugin-parameters/schema-boundary.json
new file mode 100644
index 0000000000..b1fcd72abf
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/schema-boundary.json
@@ -0,0 +1,35 @@
+{
+ "attribution": "I am an AI agent helping Engel Nyst (@enyst) with project work.",
+ "canvas_minimum_agent_server": "1.51.0",
+ "tested_agent_server": "1.55.1",
+ "source_contracts": [
+ {
+ "tag": "v1.51.0",
+ "fields": [
+ "source",
+ "ref",
+ "repo_path"
+ ],
+ "source_url": "https://github.com/enyst/agent-sdk/blob/v1.51.0/openhands-sdk/openhands/sdk/plugin/types.py"
+ },
+ {
+ "tag": "v1.55.1",
+ "fields": [
+ "source",
+ "ref",
+ "repo_path"
+ ],
+ "source_url": "https://github.com/enyst/agent-sdk/blob/v1.55.1/openhands-sdk/openhands/sdk/plugin/types.py"
+ }
+ ],
+ "observed_runtime_plugin_schemas": [
+ {
+ "schema": "PluginSource",
+ "properties": [
+ "source",
+ "ref",
+ "repo_path"
+ ]
+ }
+ ]
+}
diff --git a/.pr/evidence/plugin-parameters/summary.json b/.pr/evidence/plugin-parameters/summary.json
new file mode 100644
index 0000000000..428eb89319
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/summary.json
@@ -0,0 +1,38 @@
+{
+ "attribution": "I am an AI agent helping Engel Nyst (@enyst) with project work.",
+ "issue": "https://github.com/enyst/playground/issues/127",
+ "baseline": "61a3bd93e642a0ff4def73b29496a73245628209",
+ "tested_product_revision": "dda45af019ad34c2870f2a846b0cffad144f8b8f",
+ "agent_server": "1.55.1",
+ "automation": "1.20.1",
+ "browser": "Chromium 151.0.7922.173",
+ "playwright": "1.63.0",
+ "node": "24.21.0",
+ "model_response_requested": false,
+ "cleanup": {
+ "run": "/workspace/work/fix-weekly-four/runs/fix-127",
+ "browser": {
+ "stopped": true,
+ "pid": 314469
+ },
+ "launcherStopped": true,
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "evidenceFiles": 14,
+ "privatePurged": true,
+ "evidenceFilesAfterPurge": 14,
+ "ok": true
+ },
+ "focused_tests_passed": 187,
+ "translation_locales": 16,
+ "runtime_contract": "PluginSource has source/ref/repo_path, no parameters; floor 1.51.0 and tested 1.55.1 source agree.",
+ "original_delivery_recipe": "Unchanged maintained accepted-create recipe reproduced twice on base (201 with parameters absent). It cannot xpass on a fix that correctly prevents unsupported creation.",
+ "verified_alternative": "Explicit Local pre-creation rejection: desktop 2 baseline xfail/2 fix xpass; phone 2 baseline xfail/2 fix xpass, identical recipe per comparison.",
+ "positive_control": "Omitted and empty-object parameters each enabled Start, POST returned 201, conversation navigation succeeded, then owned conversation was deleted (200).",
+ "cloud": "Existing Cloud path unchanged; not live tested here."
+}
diff --git a/.pr/evidence/plugin-parameters/task-cleanup.json b/.pr/evidence/plugin-parameters/task-cleanup.json
new file mode 100644
index 0000000000..8ee80853dd
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/task-cleanup.json
@@ -0,0 +1,102 @@
+{
+ "checked_at": "2026-10-17T23:40:38.477040+00:00",
+ "owned_runs": {
+ "base": {
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "private_purged": true,
+ "evidence_files_retained": 46
+ },
+ "fix-124": {
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "private_purged": true,
+ "evidence_files_retained": 12
+ },
+ "fix-125": {
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "private_purged": true,
+ "evidence_files_retained": 15
+ },
+ "fix-126-preliminary": {
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "private_purged": true,
+ "evidence_files_retained": 8
+ },
+ "fix-126-final": {
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "private_purged": true,
+ "evidence_files_retained": 8
+ },
+ "fix-127": {
+ "ports": {
+ "ingress": "closed",
+ "agentServer": "closed",
+ "automation": "closed",
+ "frontend": "closed",
+ "vscode": "closed"
+ },
+ "private_purged": true,
+ "evidence_files_retained": 14
+ }
+ },
+ "external_hosts": {
+ "processes": [
+ {
+ "variant": "base",
+ "pid": 310633,
+ "port": 21580,
+ "state": "owned-group-sigterm"
+ },
+ {
+ "variant": "fix",
+ "pid": 310635,
+ "port": 21680,
+ "state": "zombie-not-a-service"
+ },
+ {
+ "variant": "fix",
+ "pid": 316536,
+ "port": 21680,
+ "state": "owned-group-sigterm"
+ }
+ ],
+ "ports_closed": [
+ 21580,
+ 21680
+ ]
+ },
+ "unique_port_count": 27,
+ "evidence_files": 103,
+ "scope": "Only this four-fix task resources were stopped; shared images/dependencies and original weekly evidence were preserved.",
+ "all_owned_ports_closed": true,
+ "count_definition": "Unique regular files beneath the six owned run evidence directories; current symlink aliases are excluded."
+}
diff --git a/.pr/evidence/plugin-parameters/unsupported-recipe.md b/.pr/evidence/plugin-parameters/unsupported-recipe.md
new file mode 100644
index 0000000000..2189592d86
--- /dev/null
+++ b/.pr/evidence/plugin-parameters/unsupported-recipe.md
@@ -0,0 +1,23 @@
+I am an AI agent helping Engel Nyst (@enyst) with project work.
+
+Paired proof for the documented acceptable alternative: unsupported Local parameters are identified before creation. The existing accepted-create delivery recipe is unchanged and was separately reproduced twice on base. This recipe does not claim runtime parameter support or an xpass of that accepted-create recipe.
+
+```sh known-bug F19.launch-parameters unsupported-local
+QA_PARAM_SOURCE="$OH_VERIFY_RUN/workspace/qa-unsupported-parameter-plugin"
+[ ! -L "$QA_PARAM_SOURCE" ]
+mkdir -p "$QA_PARAM_SOURCE/.plugin"
+printf '%s\n' '{"name":"qa-unsupported-parameter-plugin","version":"0.1.0","description":"Inert parameter configuration check; no skills or tools."}' > "$QA_PARAM_SOURCE/.plugin/plugin.json"
+trap 'rm -rf "$QA_PARAM_SOURCE"; control-openhands browser goto /conversations >/dev/null' EXIT
+QA_PARAM_PAYLOAD=$(jq -nc --arg source "$QA_PARAM_SOURCE" '[{source:$source,parameters:{city:"Paris",days:3,metric:true}}]' | base64 | tr -d '\n')
+QA_PARAM_QUERY=$(jq -rn --arg value "$QA_PARAM_PAYLOAD" '$value|@uri')
+control-openhands browser viewport desktop
+control-openhands browser goto "/launch?plugins=$QA_PARAM_QUERY"
+control-openhands browser fill 'testid=plugin-0-param-city' Tokyo
+control-openhands browser fill 'testid=plugin-0-param-days' 7
+control-openhands browser check 'testid=plugin-0-param-metric'
+control-openhands browser check 'testid=trust-checkbox'
+control-openhands browser screenshot --feature F19.launch-parameters --name unsupported-local
+control-openhands assert --field count --equals 1 --bug-shows 0 -- browser count 'testid=plugin-parameters-unsupported' # bug
+control-openhands assert --field text --equals 'This local backend does not support plugin parameters. Remove the parameters from the launch link before starting a conversation.' -- browser text 'testid=plugin-parameters-unsupported'
+control-openhands assert --field value --equals true -- browser eval 'document.querySelector("[data-testid=start-conversation-button]").disabled'
+```
diff --git a/__tests__/api/agent-server-adapter.test.ts b/__tests__/api/agent-server-adapter.test.ts
index a458a316b1..124df62168 100644
--- a/__tests__/api/agent-server-adapter.test.ts
+++ b/__tests__/api/agent-server-adapter.test.ts
@@ -143,6 +143,55 @@ beforeEach(() => {
});
describe("buildStartConversationRequest", () => {
+ it.each([{ city: "Tokyo" }, { metric: false }, { days: 0 }])(
+ "rejects unsupported plugin parameters instead of silently stripping %o",
+ (parameters) => {
+ expect(() =>
+ buildStartConversationRequest({
+ settings: DEFAULT_SETTINGS,
+ plugins: [{ source: "local-plugin", parameters }],
+ }),
+ ).toThrow();
+ },
+ );
+
+ it.each(
+ [5, 0, true, false, "", "Tokyo", [], [false]].map((parameters) => ({
+ parameters,
+ })),
+ )(
+ "rejects malformed plugin parameters instead of silently stripping $parameters",
+ ({ parameters }) => {
+ // Launch links can carry JSON values outside PluginSpec's static type.
+ const plugins = JSON.parse(
+ JSON.stringify([{ source: "local-plugin", parameters }]),
+ );
+ expect(() =>
+ buildStartConversationRequest({ settings: DEFAULT_SETTINGS, plugins }),
+ ).toThrow();
+ },
+ );
+
+ it.each([undefined, null, {}])(
+ "keeps coordinate-only plugins when parameters are %o",
+ (parameters) => {
+ const payload = buildStartConversationRequest({
+ settings: DEFAULT_SETTINGS,
+ plugins: [
+ {
+ source: "local-plugin",
+ ref: "main",
+ repo_path: "plugin",
+ parameters,
+ },
+ ],
+ });
+ expect(payload.plugins).toEqual([
+ { source: "local-plugin", ref: "main", repo_path: "plugin" },
+ ]);
+ },
+ );
+
it("includes the resolved title LLM profile when configured", () => {
const payload = buildStartConversationRequest({
settings: DEFAULT_SETTINGS,
diff --git a/__tests__/api/agent-server-conversation-service.test.ts b/__tests__/api/agent-server-conversation-service.test.ts
index 5440453461..a9e8d4423b 100644
--- a/__tests__/api/agent-server-conversation-service.test.ts
+++ b/__tests__/api/agent-server-conversation-service.test.ts
@@ -2433,7 +2433,11 @@ describe("AgentServerConversationService", () => {
request: {},
});
const plugins = [
- { source: "github:OpenHands/example-plugin", ref: "v1" },
+ {
+ source: "github:OpenHands/example-plugin",
+ ref: "v1",
+ parameters: { city: "Tokyo", metric: false, days: 0 },
+ },
];
await AgentServerConversationService.createConversation({
diff --git a/__tests__/components/features/launch/plugin-launch-modal.test.tsx b/__tests__/components/features/launch/plugin-launch-modal.test.tsx
index 162de572b9..5aa25e380b 100644
--- a/__tests__/components/features/launch/plugin-launch-modal.test.tsx
+++ b/__tests__/components/features/launch/plugin-launch-modal.test.tsx
@@ -13,6 +13,7 @@ function renderModal(
props: Partial<{
message: string;
isLoading: boolean;
+ parametersSupported: boolean;
}> = {},
) {
const queryClient = new QueryClient({
@@ -23,6 +24,7 @@ function renderModal(
<QueryClientProvider client={queryClient}>
<PluginLaunchModal
plugins={plugins}
+ parametersSupported={props.parametersSupported ?? true}
message={props.message}
isLoading={props.isLoading ?? false}
onStartConversation={mockOnStartConversation}
@@ -39,7 +41,9 @@ describe("PluginLaunchModal", () => {
describe("Plugin Display Name Extraction", () => {
it("should extract plugin name from repo_path when provided", () => {
- renderModal([{ source: "github:owner/repo", repo_path: "plugins/my-plugin" }]);
+ renderModal([
+ { source: "github:owner/repo", repo_path: "plugins/my-plugin" },
+ ]);
// Plugin name should be "my-plugin" from the path
expect(screen.getByText("my-plugin")).toBeInTheDocument();
@@ -54,9 +58,7 @@ describe("PluginLaunchModal", () => {
});
it("should extract name from git URL", () => {
- renderModal([
- { source: "https://github.com/owner/repo-name.git" },
- ]);
+ renderModal([{ source: "https://github.com/owner/repo-name.git" }]);
const elements = screen.getAllByText("repo-name");
expect(elements.length).toBeGreaterThan(0);
@@ -296,13 +298,13 @@ describe("PluginLaunchModal", () => {
expect(screen.getByText("LAUNCH$ADDITIONAL_PLUGINS")).toBeInTheDocument();
// When no repo_path, the full repo path is shown
- expect(screen.getAllByText("owner/without-params").length).toBeGreaterThan(0);
+ expect(
+ screen.getAllByText("owner/without-params").length,
+ ).toBeGreaterThan(0);
});
it("should show ref in simple plugin list", () => {
- renderModal([
- { source: "github:owner/plugin", ref: "main" },
- ]);
+ renderModal([{ source: "github:owner/plugin", ref: "main" }]);
expect(screen.getByText("@ main")).toBeInTheDocument();
});
@@ -363,10 +365,9 @@ describe("PluginLaunchModal", () => {
it("should call onStartConversation with message when provided", async () => {
const user = userEvent.setup();
- renderModal(
- [{ source: "github:owner/repo" }],
- { message: "/city-weather:now Tokyo" },
- );
+ renderModal([{ source: "github:owner/repo" }], {
+ message: "/city-weather:now Tokyo",
+ });
// Check the trust checkbox first
await user.click(screen.getByTestId("trust-checkbox"));
@@ -425,3 +426,35 @@ describe("PluginLaunchModal", () => {
});
});
});
+
+describe("unsupported backend plugin parameters", () => {
+ it("explains the unsupported configuration and prevents starting even after trust", async () => {
+ const user = userEvent.setup();
+ renderModal([{ source: "local-plugin", parameters: { city: "Paris" } }], {
+ parametersSupported: false,
+ });
+ await user.type(screen.getByTestId("plugin-0-param-city"), " test");
+ await user.click(screen.getByTestId("trust-checkbox"));
+
+ expect(screen.getByRole("alert")).toHaveTextContent(
+ "LAUNCH$PARAMETERS_UNSUPPORTED_LOCAL",
+ );
+ expect(screen.getByTestId("start-conversation-button")).toBeDisabled();
+ await user.click(screen.getByTestId("start-conversation-button"));
+ expect(mockOnStartConversation).not.toHaveBeenCalled();
+ });
+
+ it("allows coordinate-only plugins when parameters are unsupported", async () => {
+ const user = userEvent.setup();
+ renderModal([{ source: "local-plugin", parameters: {} }], {
+ parametersSupported: false,
+ });
+ await user.click(screen.getByTestId("trust-checkbox"));
+ await user.click(screen.getByTestId("start-conversation-button"));
+
+ expect(mockOnStartConversation).toHaveBeenCalledWith(
+ [{ source: "local-plugin", parameters: {} }],
+ undefined,
+ );
+ });
+});
diff --git a/__tests__/routes/launch.test.tsx b/__tests__/routes/launch.test.tsx
index 683c5cd751..d04d54d1a4 100644
--- a/__tests__/routes/launch.test.tsx
+++ b/__tests__/routes/launch.test.tsx
@@ -97,7 +97,9 @@ describe("LaunchRoute", () => {
renderLaunchRoute("?plugins=not-valid-base64!!!");
expect(screen.getByTestId("launch-error")).toBeInTheDocument();
- expect(screen.getByText("LAUNCH$ERROR_INVALID_FORMAT")).toBeInTheDocument();
+ expect(
+ screen.getByText("LAUNCH$ERROR_INVALID_FORMAT"),
+ ).toBeInTheDocument();
});
it("should show error for invalid JSON in decoded base64", () => {
@@ -106,7 +108,9 @@ describe("LaunchRoute", () => {
renderLaunchRoute(`?plugins=${invalidJson}`);
expect(screen.getByTestId("launch-error")).toBeInTheDocument();
- expect(screen.getByText("LAUNCH$ERROR_INVALID_FORMAT")).toBeInTheDocument();
+ expect(
+ screen.getByText("LAUNCH$ERROR_INVALID_FORMAT"),
+ ).toBeInTheDocument();
});
it("should show error when decoded plugins is not an array", () => {
@@ -115,7 +119,9 @@ describe("LaunchRoute", () => {
renderLaunchRoute(`?plugins=${notArray}`);
expect(screen.getByTestId("launch-error")).toBeInTheDocument();
- expect(screen.getByText("LAUNCH$ERROR_INVALID_FORMAT")).toBeInTheDocument();
+ expect(
+ screen.getByText("LAUNCH$ERROR_INVALID_FORMAT"),
+ ).toBeInTheDocument();
});
it("should show error when plugin is missing source", () => {
@@ -124,7 +130,9 @@ describe("LaunchRoute", () => {
renderLaunchRoute(`?plugins=${missingSource}`);
expect(screen.getByTestId("launch-error")).toBeInTheDocument();
- expect(screen.getByText("LAUNCH$ERROR_INVALID_FORMAT")).toBeInTheDocument();
+ expect(
+ screen.getByText("LAUNCH$ERROR_INVALID_FORMAT"),
+ ).toBeInTheDocument();
});
it("should parse simple params format (plugin_source)", () => {
@@ -132,13 +140,13 @@ describe("LaunchRoute", () => {
expect(screen.getByTestId("plugin-launch-modal")).toBeInTheDocument();
// Plugin name appears multiple times, use getAllByText
- expect(screen.getAllByText("owner/simple-repo").length).toBeGreaterThan(0);
+ expect(screen.getAllByText("owner/simple-repo").length).toBeGreaterThan(
+ 0,
+ );
});
it("should parse simple params with ref", () => {
- renderLaunchRoute(
- "?plugin_source=github:owner/repo&plugin_ref=v1.0.0",
- );
+ renderLaunchRoute("?plugin_source=github:owner/repo&plugin_ref=v1.0.0");
expect(screen.getByTestId("plugin-launch-modal")).toBeInTheDocument();
// Plugin name appears multiple times, use getAllByText
@@ -159,9 +167,13 @@ describe("LaunchRoute", () => {
const encoded = btoa(JSON.stringify(plugins));
const message = "Hello, this is a safe message";
- renderLaunchRoute(`?plugins=${encoded}&message=${encodeURIComponent(message)}`);
+ renderLaunchRoute(
+ `?plugins=${encoded}&message=${encodeURIComponent(message)}`,
+ );
- expect(screen.getByText("Hello, this is a safe message")).toBeInTheDocument();
+ expect(
+ screen.getByText("Hello, this is a safe message"),
+ ).toBeInTheDocument();
});
it("should remove script tags from message (XSS prevention)", () => {
@@ -182,7 +194,7 @@ describe("LaunchRoute", () => {
it("should strip img tags with onerror handlers (XSS prevention)", () => {
const plugins = [{ source: "github:owner/repo" }];
const encoded = btoa(JSON.stringify(plugins));
- const maliciousMessage = '<img src=x onerror=alert(1)>Safe content';
+ const maliciousMessage = "<img src=x onerror=alert(1)>Safe content";
renderLaunchRoute(
`?plugins=${encoded}&message=${encodeURIComponent(maliciousMessage)}`,
@@ -197,7 +209,7 @@ describe("LaunchRoute", () => {
it("should strip svg tags with onload handlers (XSS prevention)", () => {
const plugins = [{ source: "github:owner/repo" }];
const encoded = btoa(JSON.stringify(plugins));
- const maliciousMessage = '<svg/onload=alert(1)>Safe content';
+ const maliciousMessage = "<svg/onload=alert(1)>Safe content";
renderLaunchRoute(
`?plugins=${encoded}&message=${encodeURIComponent(maliciousMessage)}`,
@@ -212,7 +224,7 @@ describe("LaunchRoute", () => {
it("should strip all HTML tags for plain text display", () => {
const plugins = [{ source: "github:owner/repo" }];
const encoded = btoa(JSON.stringify(plugins));
- const htmlMessage = '<div><p>Hello</p> <b>World</b></div>';
+ const htmlMessage = "<div><p>Hello</p> <b>World</b></div>";
renderLaunchRoute(
`?plugins=${encoded}&message=${encodeURIComponent(htmlMessage)}`,
@@ -227,7 +239,9 @@ describe("LaunchRoute", () => {
const encoded = btoa(JSON.stringify(plugins));
const longMessage = "A".repeat(600);
- renderLaunchRoute(`?plugins=${encoded}&message=${encodeURIComponent(longMessage)}`);
+ renderLaunchRoute(
+ `?plugins=${encoded}&message=${encodeURIComponent(longMessage)}`,
+ );
// Should be truncated to 500 chars
const displayedMessage = screen.getByText(/A{100,}/);
@@ -311,7 +325,9 @@ describe("LaunchRoute", () => {
renderLaunchRoute(`?plugins=${encoded}`);
- expect(screen.getByTestId("start-conversation-button")).toBeInTheDocument();
+ expect(
+ screen.getByTestId("start-conversation-button"),
+ ).toBeInTheDocument();
});
it("should display close button", () => {
@@ -346,8 +362,12 @@ describe("LaunchRoute", () => {
expect(screen.getByText("LAUNCH$PLUGINS")).toBeInTheDocument();
// Plugin names appear multiple times (title area and list), use getAllByText
- expect(screen.getAllByText("owner/repo-without-params").length).toBeGreaterThan(0);
- expect(screen.getAllByText("owner/another-repo").length).toBeGreaterThan(0);
+ expect(
+ screen.getAllByText("owner/repo-without-params").length,
+ ).toBeGreaterThan(0);
+ expect(screen.getAllByText("owner/another-repo").length).toBeGreaterThan(
+ 0,
+ );
});
it("should show additional plugins label when mixing params and no-params plugins", () => {
@@ -382,7 +402,6 @@ describe("LaunchRoute", () => {
renderLaunchRoute(`?plugins=${encoded}`);
// Check that the checkbox has a label associated with it
- const checkbox = screen.getByTestId("trust-checkbox");
const label = document.querySelector('label[for="trust-checkbox"]');
expect(label).toBeInTheDocument();
});
@@ -430,9 +449,7 @@ describe("LaunchRoute", () => {
describe("Conversation Creation", () => {
it("should call createConversation with plugins when start button clicked after checking trust", async () => {
const user = userEvent.setup();
- const plugins = [
- { source: "github:owner/repo", parameters: { apiKey: "test" } },
- ];
+ const plugins = [{ source: "github:owner/repo" }];
const encoded = btoa(JSON.stringify(plugins));
renderLaunchRoute(`?plugins=${encoded}`);
@@ -448,7 +465,7 @@ describe("LaunchRoute", () => {
source: "github:owner/repo",
ref: null,
repo_path: null,
- parameters: { apiKey: "test" },
+ parameters: null,
},
],
query: undefined,
@@ -463,7 +480,9 @@ describe("LaunchRoute", () => {
const encoded = btoa(JSON.stringify(plugins));
const message = "/city-weather:now Tokyo";
- renderLaunchRoute(`?plugins=${encoded}&message=${encodeURIComponent(message)}`);
+ renderLaunchRoute(
+ `?plugins=${encoded}&message=${encodeURIComponent(message)}`,
+ );
// First check the trust checkbox
await user.click(screen.getByTestId("trust-checkbox"));
@@ -499,7 +518,9 @@ describe("LaunchRoute", () => {
await user.click(screen.getByTestId("start-conversation-button"));
await waitFor(() => {
- expect(mockNavigate).toHaveBeenCalledWith("/conversations/new-conv-456");
+ expect(mockNavigate).toHaveBeenCalledWith(
+ "/conversations/new-conv-456",
+ );
});
});
@@ -553,7 +574,9 @@ describe("LaunchRoute", () => {
await waitFor(() => {
expect(screen.getByTestId("launch-error")).toBeInTheDocument();
- expect(screen.getByText("LAUNCH$ERROR_CREATION_FAILED")).toBeInTheDocument();
+ expect(
+ screen.getByText("LAUNCH$ERROR_CREATION_FAILED"),
+ ).toBeInTheDocument();
});
});
@@ -576,3 +599,23 @@ describe("LaunchRoute", () => {
});
});
});
+
+it.each(
+ [{ city: "Tokyo" }, 5, false, []].map((parameters) => ({ parameters })),
+)(
+ "identifies unsupported Local plugin parameters $parameters before creating a conversation",
+ async ({ parameters }) => {
+ vi.clearAllMocks();
+ const user = userEvent.setup();
+ renderLaunchRoute(
+ `?plugins=${btoa(JSON.stringify([{ source: "local-plugin", parameters }]))}`,
+ );
+ await user.click(screen.getByTestId("trust-checkbox"));
+ expect(screen.getByRole("alert")).toHaveTextContent(
+ "LAUNCH$PARAMETERS_UNSUPPORTED_LOCAL",
+ );
+ expect(screen.getByTestId("start-conversation-button")).toBeDisabled();
+ await user.click(screen.getByTestId("start-conversation-button"));
+ expect(mockMutateAsync).not.toHaveBeenCalled();
+ },
+);
diff --git a/src/api/agent-server-adapter.ts b/src/api/agent-server-adapter.ts
index 8f3fbbb936..ce10a738e4 100644
--- a/src/api/agent-server-adapter.ts
+++ b/src/api/agent-server-adapter.ts
@@ -1,3 +1,6 @@
+import i18n, { OPENHANDS_I18N_NAMESPACE } from "#/i18n";
+import { I18nKey } from "#/i18n/declaration";
+import { hasPluginParameters } from "#/utils/plugin-parameters";
import {
ACP_SETTINGS_KEYS,
HOOK_EVENT_FIELDS,
@@ -1136,6 +1139,13 @@ function buildConfiguredConversationSettings(options: {
workingDir,
executionRuntime,
} = options;
+ if (hasPluginParameters(plugins)) {
+ throw new Error(
+ i18n.t(I18nKey.LAUNCH$PARAMETERS_UNSUPPORTED_LOCAL, {
+ ns: OPENHANDS_I18N_NAMESPACE,
+ }),
+ );
+ }
const conversationSettings = toRecord(settings.conversation_settings);
const initialMessage = buildInitialMessage(query, conversationInstructions);
diff --git a/src/components/features/launch/plugin-launch-modal.tsx b/src/components/features/launch/plugin-launch-modal.tsx
index 25289808a0..ad32ebdc8e 100644
--- a/src/components/features/launch/plugin-launch-modal.tsx
+++ b/src/components/features/launch/plugin-launch-modal.tsx
@@ -11,10 +11,12 @@ import { I18nKey } from "#/i18n/declaration";
import { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
import { Typography } from "#/ui/typography";
import { cn } from "#/utils/utils";
+import { hasPluginParameters } from "#/utils/plugin-parameters";
import { PluginLaunchPluginSection } from "./plugin-launch-plugin-section";
interface PluginLaunchModalProps {
plugins: PluginSpec[];
+ parametersSupported: boolean;
message?: string;
isLoading?: boolean;
onStartConversation: (plugins: PluginSpec[], initialMessage?: string) => void;
@@ -27,6 +29,7 @@ interface ExpandedState {
export function PluginLaunchModal({
plugins,
+ parametersSupported,
message,
isLoading = false,
onStartConversation,
@@ -117,7 +120,11 @@ export function PluginLaunchModal({
return [...new Set(sources)];
};
+ const unsupportedParameters =
+ !parametersSupported && hasPluginParameters(pluginConfigs);
+
const handleStartConversation = () => {
+ if (unsupportedParameters) return;
onStartConversation(pluginConfigs, message);
};
@@ -192,6 +199,16 @@ export function PluginLaunchModal({
)}
</div>
+ {unsupportedParameters && (
+ <p
+ role="alert"
+ data-testid="plugin-parameters-unsupported"
+ className="text-sm text-feedback-error"
+ >
+ {t(I18nKey.LAUNCH$PARAMETERS_UNSUPPORTED_LOCAL)}
+ </p>
+ )}
+
<div className="pt-4 border-t border-border-subtle">
<div className="flex items-start gap-3 mb-4">
<input
@@ -215,7 +232,7 @@ export function PluginLaunchModal({
type="button"
variant="primary"
onClick={handleStartConversation}
- isDisabled={isLoading || !trustConfirmed}
+ isDisabled={isLoading || !trustConfirmed || unsupportedParameters}
className="px-4"
>
{isLoading
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index dc94129e0d..d9c05f45b1 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -52216,5 +52216,23 @@
"tr": "Yalnızca bağlantıyı kes",
"uk": "Лише від'єднати",
"id": "Hanya putuskan"
+ },
+ "LAUNCH$PARAMETERS_UNSUPPORTED_LOCAL": {
+ "en": "This local backend does not support plugin parameters. Remove the parameters from the launch link before starting a conversation.",
+ "ja": "このローカルバックエンドはプラグインのパラメーターに対応していません。会話を開始する前に、起動リンクからパラメーターを削除してください。",
+ "zh-CN": "此本地后端不支持插件参数。请先从启动链接中移除参数,再开始对话。",
+ "zh-TW": "此本機後端不支援外掛參數。請先從啟動連結中移除參數,再開始對話。",
+ "ko-KR": "이 로컬 백엔드는 플러그인 매개변수를 지원하지 않습니다. 대화를 시작하기 전에 실행 링크에서 매개변수를 제거하세요.",
+ "no": "Denne lokale backend-en støtter ikke programtilleggsparametere. Fjern parameterne fra oppstartslenken før du starter en samtale.",
+ "ar": "لا تدعم هذه الواجهة الخلفية المحلية معلمات الإضافات. أزل المعلمات من رابط التشغيل قبل بدء المحادثة.",
+ "de": "Dieses lokale Backend unterstützt keine Plugin-Parameter. Entferne die Parameter aus dem Startlink, bevor du eine Unterhaltung startest.",
+ "fr": "Ce serveur local ne prend pas en charge les paramètres des extensions. Retirez les paramètres du lien de lancement avant de démarrer une conversation.",
+ "it": "Questo backend locale non supporta i parametri dei plugin. Rimuovi i parametri dal link di avvio prima di iniziare una conversazione.",
+ "pt": "Este backend local não suporta parâmetros de plugins. Remova os parâmetros do link de inicialização antes de iniciar uma conversa.",
+ "es": "Este backend local no admite parámetros de plugins. Elimina los parámetros del enlace de inicio antes de comenzar una conversación.",
+ "ca": "Aquest backend local no admet paràmetres de connectors. Elimina els paràmetres de l’enllaç d’inici abans de començar una conversa.",
+ "tr": "Bu yerel arka uç eklenti parametrelerini desteklemiyor. Sohbet başlatmadan önce parametreleri başlatma bağlantısından kaldırın.",
+ "uk": "Цей локальний сервер не підтримує параметри плагінів. Видаліть параметри з посилання запуску перед початком розмови.",
+ "id": "Backend lokal ini tidak mendukung parameter plugin. Hapus parameter dari tautan peluncuran sebelum memulai percakapan."
}
}
diff --git a/src/routes/launch.tsx b/src/routes/launch.tsx
index c796e26255..f49d27b11f 100644
--- a/src/routes/launch.tsx
+++ b/src/routes/launch.tsx
@@ -5,6 +5,7 @@ import { PluginLaunchModal } from "#/components/features/launch/plugin-launch-mo
import { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
import { useCreateConversation } from "#/hooks/mutation/use-create-conversation";
import { I18nKey } from "#/i18n/declaration";
+import { useActiveBackend } from "#/contexts/active-backend-context";
type ErrorType = "no_plugins" | "invalid_format" | "creation_failed";
@@ -135,6 +136,7 @@ function ErrorDisplay({
}
export default function LaunchRoute() {
+ const { backend } = useActiveBackend();
const [searchParams] = useSearchParams();
const navigate = useNavigate();
const { t } = useTranslation("openhands");
@@ -195,6 +197,7 @@ export default function LaunchRoute() {
<div className="h-full" data-testid="launch-route">
<PluginLaunchModal
plugins={parseResult.plugins}
+ parametersSupported={backend.kind !== "local"}
message={parseResult.message}
isLoading={createConversation.isPending}
onStartConversation={handleStartConversation}
diff --git a/src/utils/plugin-parameters.ts b/src/utils/plugin-parameters.ts
new file mode 100644
index 0000000000..322dacb9c3
--- /dev/null
+++ b/src/utils/plugin-parameters.ts
@@ -0,0 +1,17 @@
+import type { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
+
+export function hasPluginParameters(
+ plugins: PluginSpec[] | undefined,
+): boolean {
+ return (
+ plugins?.some(({ parameters }) => {
+ if (parameters == null) return false;
+ // URL payloads can contain scalars or arrays despite PluginSpec's type.
+ return (
+ typeof parameters !== "object" ||
+ Array.isArray(parameters) ||
+ Object.keys(parameters).length > 0
+ );
+ }) ?? false
+ );
+}