Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix(plugins): correct profile routing and smoke coverage

Luigi Agostida15d2d82d89
diff --git a/.github/workflows/ci-e2e.yml b/.github/workflows/ci-e2e.yml
index 504a2611..af93cc34 100644
--- a/.github/workflows/ci-e2e.yml
+++ b/.github/workflows/ci-e2e.yml
@@ -12,8 +12,6 @@ on:
- 'LICENSE'
- '.gitignore'
- 'skills/**'
- - 'plugins/**'
- - '.grok-plugin/**'
push:
branches: [main]
paths-ignore:
@@ -22,8 +20,6 @@ on:
- 'LICENSE'
- '.gitignore'
- 'skills/**'
- - 'plugins/**'
- - '.grok-plugin/**'
workflow_dispatch:
inputs:
suite:
@@ -41,7 +37,7 @@ on:
jobs:
detect-changes:
- if: github.event_name == 'pull_request'
+ if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
run_api_extended: ${{ steps.changes.outputs.run_api_extended }}
@@ -55,9 +51,16 @@ jobs:
- name: Decide which suites this diff needs
id: changes
shell: bash
+ env:
+ EVENT_NAME: ${{ github.event_name }}
+ BEFORE_SHA: ${{ github.event.before }}
+ CURRENT_SHA: ${{ github.sha }}
run: |
- git diff --name-only origin/main...HEAD |
- ./scripts/ci/detect-e2e-suites.sh >> "$GITHUB_OUTPUT"
+ if [ "$EVENT_NAME" = "pull_request" ]; then
+ git diff --name-only origin/main...HEAD
+ else
+ git diff --name-only "$BEFORE_SHA" "$CURRENT_SHA"
+ fi | ./scripts/ci/detect-e2e-suites.sh >> "$GITHUB_OUTPUT"
api:
if: >-
@@ -142,7 +145,7 @@ jobs:
if: >-
always() &&
(needs.detect-changes.result == 'success' || needs.detect-changes.result == 'skipped') &&
- ((github.event_name == 'pull_request' && needs.detect-changes.outputs.run_smoke == 'true') ||
+ (((github.event_name == 'pull_request' || github.event_name == 'push') && needs.detect-changes.outputs.run_smoke == 'true') ||
(github.event_name == 'workflow_dispatch' && (inputs.suite == 'all' || inputs.suite == 'smoke')))
uses: ./.github/workflows/reusable-smoke.yml
with:
diff --git a/internal/devtools/e2e_escalation_test.go b/internal/devtools/e2e_escalation_test.go
index a505b21d..96c1b719 100644
--- a/internal/devtools/e2e_escalation_test.go
+++ b/internal/devtools/e2e_escalation_test.go
@@ -73,6 +73,11 @@ func TestEscalationFollowsProductPathsAndTestPaths(t *testing.T) {
changed: []string{"tests/e2e/scenarios/cli/tabs-smoke.sh", "Dockerfile"},
want: []string{"run_smoke"},
},
+ {
+ name: "plugin implementation and packaging",
+ changed: []string{"plugins/openclaw/tools/browser.ts", "plugins/grok/.mcp.json", ".grok-plugin/marketplace.json"},
+ want: []string{"run_smoke"},
+ },
{
name: "basic scenario churn only",
changed: []string{"tests/e2e/scenarios/api/tabs-basic.sh", "tests/e2e/scenarios/infra/network-basic.sh"},
@@ -100,6 +105,31 @@ func TestEscalationFollowsProductPathsAndTestPaths(t *testing.T) {
}
}
+func TestPluginPathsReachTheE2EWorkflow(t *testing.T) {
+ root := repoRoot(t)
+ var workflow struct {
+ On map[string]struct {
+ PathsIgnore []string `yaml:"paths-ignore"`
+ } `yaml:"on"`
+ }
+ if err := yaml.Unmarshal([]byte(readRepoFile(t, root, escalationWorkflow)), &workflow); err != nil {
+ t.Fatalf("cannot parse %s: %v", escalationWorkflow, err)
+ }
+
+ for _, event := range []string{"pull_request", "push"} {
+ trigger, ok := workflow.On[event]
+ if !ok {
+ t.Errorf("%s has no %s trigger", escalationWorkflow, event)
+ continue
+ }
+ for _, ignored := range trigger.PathsIgnore {
+ if ignored == "plugins/**" || ignored == ".grok-plugin/**" {
+ t.Errorf("%s ignores %s on %s, so plugin changes cannot reach smoke coverage", escalationWorkflow, ignored, event)
+ }
+ }
+ }
+}
+
func TestEveryEscalationRuleMatchesATrackedPath(t *testing.T) {
root := repoRoot(t)
tracked := trackedPaths(t, root)
diff --git a/plugins/openclaw/navigation.test.ts b/plugins/openclaw/navigation.test.ts
index 210e6105..48a64882 100644
--- a/plugins/openclaw/navigation.test.ts
+++ b/plugins/openclaw/navigation.test.ts
@@ -32,6 +32,7 @@ describe("navigation routing", () => {
if (path === "/instances") return jsonResponse([{ id: "inst_a", status: "running" }]);
if (path === "/navigate") return jsonResponse({ tabId: "tab_nav" });
if (path === "/tab") return jsonResponse({ tabId: "tab_new" });
+ if (path === "/instances/inst_a/tabs/open") return jsonResponse({ tabId: "tab_profile" });
if (path === "/tabs/tab_existing/navigate") return jsonResponse({ tabId: "tab_existing" });
throw new Error(`unexpected fetch: ${path}`);
}) as typeof fetch;
@@ -54,6 +55,18 @@ describe("navigation routing", () => {
assert.ok(calls.some((call) => new URL(call.url).pathname === "/tab"));
});
+ it("browser navigate opens the first profiled tab through the instance-scoped route", async () => {
+ const result = await executeBrowserAction(
+ { baseUrl: "http://localhost:9867", persistSessionTabs: false, profiles: { staging: { instanceId: "inst_a" } } },
+ { action: "navigate", url: "https://example.com", profile: "staging" },
+ );
+
+ assert.match(result.content[0].text, /tab_profile/);
+ const navigation = calls.find((call) => new URL(call.url).pathname === "/instances/inst_a/tabs/open");
+ assert.deepStrictEqual(navigation?.body, { url: "https://example.com" });
+ assert.ok(!calls.some((call) => new URL(call.url).pathname === "/navigate"));
+ });
+
it("pinchtab navigate reuses top-level /navigate when tabId is absent", async () => {
const result = await executePinchtabAction({ baseUrl: "http://localhost:9867" }, { action: "navigate", url: "https://example.com" });
assert.match(result.content[0].text, /tab_nav/);
diff --git a/plugins/openclaw/tools/browser.ts b/plugins/openclaw/tools/browser.ts
index 487c80e9..54eb5844 100644
--- a/plugins/openclaw/tools/browser.ts
+++ b/plugins/openclaw/tools/browser.ts
@@ -76,17 +76,17 @@ export async function executeBrowserAction(rawCfg: PluginConfig, rawParams: any,
let result;
if (params.newTab) {
- const body: any = { action: "new", url: params.url };
- if (profileConfig.instanceId) body.instanceId = profileConfig.instanceId;
- result = await pinchtabFetch(cfg, "/tab", { body }, context);
+ if (profileConfig.instanceId) {
+ result = await pinchtabFetch(cfg, `/instances/${encodeURIComponent(profileConfig.instanceId)}/tabs/open`, { body: { url: params.url } }, context);
+ } else {
+ result = await pinchtabFetch(cfg, "/tab", { body: { action: "new", url: params.url } }, context);
+ }
} else if (params.tabId) {
- const body: any = { url: params.url };
- if (profileConfig.instanceId) body.instanceId = profileConfig.instanceId;
- result = await pinchtabFetch(cfg, `/tabs/${encodeURIComponent(params.tabId)}/navigate`, { body }, context);
+ result = await pinchtabFetch(cfg, `/tabs/${encodeURIComponent(params.tabId)}/navigate`, { body: { url: params.url } }, context);
+ } else if (profileConfig.instanceId) {
+ result = await pinchtabFetch(cfg, `/instances/${encodeURIComponent(profileConfig.instanceId)}/tabs/open`, { body: { url: params.url } }, context);
} else {
- const body: any = { url: params.url };
- if (profileConfig.instanceId) body.instanceId = profileConfig.instanceId;
- result = await pinchtabFetch(cfg, "/navigate", { body }, context);
+ result = await pinchtabFetch(cfg, "/navigate", { body: { url: params.url } }, context);
}
if (result?.tabId) setLastTabId(result.tabId, context);
return textResult(result);
diff --git a/scripts/ci/e2e-escalation.map b/scripts/ci/e2e-escalation.map
index 502bb1dc..e7e15630 100644
--- a/scripts/ci/e2e-escalation.map
+++ b/scripts/ci/e2e-escalation.map
@@ -14,6 +14,7 @@
^scripts/docker-.*smoke\.sh$ smoke
^tests/tools/docker/chrome-cft-smoke\.Dockerfile$ smoke
^\.github/workflows/(ci-smoke|reusable-smoke)\.yml$ smoke
+^(plugins/|\.grok-plugin/) smoke
^internal/audit/ api-extended cli-extended
^pkg/pinchtabaudit/ api-extended cli-extended