High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix(cli): 'pinchtab instance navigate' sends the url in the single tabs/open call and prints that response instead of opening about:blank then navigating through the front door (PIN-428)
Luigi Agosti47321223b2e0
diff --git a/docs/commands.md b/docs/commands.mdindex c0347f3e..2bf6f758 100644--- a/docs/commands.md+++ b/docs/commands.md@@ -362,7 +362,7 @@ pinchtab instance start --port <n>pinchtab instance start --extension /path/to/extpinchtab instance stop <id> # Stop an instancepinchtab instance logs <id> # Show instance logs-pinchtab instance navigate <id> <url> # Open a tab in an instance and navigate it+pinchtab instance navigate <id> <url> # Open a tab in an instance already on <url> (one step)pinchtab profiles # List profilespinchtab profiles prune # List reclaimable quarantined profiles (removes nothing)pinchtab profiles prune --confirm # Remove them and report the disk freeddiff --git a/docs/reference/instances.md b/docs/reference/instances.mdindex eefd1458..d15165e3 100644--- a/docs/reference/instances.md+++ b/docs/reference/instances.md@@ -166,7 +166,7 @@ There is no dedicated instance-scoped `tab open` CLI command. The CLI shortcut ipinchtab instance navigate inst_ea2e747f https://pinchtab.com```-That command opens a blank tab for the instance and then navigates it.+That command opens a tab for the instance already on the URL, in one `tabs/open` call.## List Tabs For One Instancediff --git a/docs/reference/tabs.md b/docs/reference/tabs.mdindex 0b46a7d0..a5a3a3f0 100644--- a/docs/reference/tabs.md+++ b/docs/reference/tabs.md@@ -54,7 +54,7 @@ There is still no dedicated instance-scoped tab-open CLI command. The CLI shortcpinchtab instance navigate inst_ea2e747f https://pinchtab.com```-That command opens a tab for the instance and then navigates it.+That command opens a tab for the instance already on the URL, in one `tabs/open` call.## List Tabsdiff --git a/internal/cli/actions/actions_instance.go b/internal/cli/actions/actions_instance.goindex eee72c8a..6175140f 100644--- a/internal/cli/actions/actions_instance.go+++ b/internal/cli/actions/actions_instance.go@@ -44,15 +44,7 @@ func InstanceNavigate(client *http.Client, base, token string, args []string) {instID := args[0]targetURL := args[1]- openResp := apiclient.DoPost(client, base, token, fmt.Sprintf("/instances/%s/tabs/open", instID), map[string]any{- "url": "about:blank",- })- tabID, _ := openResp["tabId"].(string)- if tabID == "" {- cli.Fatal("failed to open tab for instance %s", instID)- }-- apiclient.DoPost(client, base, token, fmt.Sprintf("/tabs/%s/navigate", tabID), map[string]any{+ apiclient.DoPost(client, base, token, fmt.Sprintf("/instances/%s/tabs/open", instID), map[string]any{"url": targetURL,})}diff --git a/internal/cli/actions/actions_instance_test.go b/internal/cli/actions/actions_instance_test.gonew file mode 100644index 00000000..c7ea3c6e--- /dev/null+++ b/internal/cli/actions/actions_instance_test.go@@ -0,0 +1,42 @@+package actions++import (+ "encoding/json"+ "net/http"+ "strings"+ "testing"+)++func TestInstanceNavigateOpensTheTargetURLInOneRequestAndPrintsItsResponse(t *testing.T) {+ m := newMockServer()+ defer m.close()+ m.setResponse(http.MethodPost, "/instances/inst_1e0877aa/tabs/open", http.StatusOK,+ `{"tabId":"7DB8EC9AFB64D61281CE4628ADDEF4CE","title":"Fixture Index","url":"http://127.0.0.1:18777/index.html"}`)++ out := captureStdout(t, func() {+ InstanceNavigate(http.DefaultClient, m.base(), "", []string{"inst_1e0877aa", "http://127.0.0.1:18777/index.html"})+ })++ if len(m.requests) != 1 {+ t.Fatalf("requests = %+v, want exactly one", m.requests)+ }+ req := m.requests[0]+ if req.Method != http.MethodPost || req.Path != "/instances/inst_1e0877aa/tabs/open" {+ t.Fatalf("request = %s %s, want POST /instances/inst_1e0877aa/tabs/open", req.Method, req.Path)+ }+ var sent map[string]any+ if err := json.Unmarshal([]byte(req.Body), &sent); err != nil {+ t.Fatalf("decode request body %q: %v", req.Body, err)+ }+ if sent["url"] != "http://127.0.0.1:18777/index.html" {+ t.Fatalf("request body = %v, want url of the target page", sent)+ }+ for _, want := range []string{"7DB8EC9AFB64D61281CE4628ADDEF4CE", "Fixture Index", "http://127.0.0.1:18777/index.html"} {+ if !strings.Contains(out, want) {+ t.Fatalf("output %q does not contain %q", out, want)+ }+ }+ if strings.Contains(out, "about:blank") {+ t.Fatalf("output %q still reports a blank tab", out)+ }+}diff --git a/plugins/grok/skills/pinchtab/references/profiles.md b/plugins/grok/skills/pinchtab/references/profiles.mdindex 07d3ced7..e88f2437 100644--- a/plugins/grok/skills/pinchtab/references/profiles.md+++ b/plugins/grok/skills/pinchtab/references/profiles.md@@ -60,7 +60,7 @@ CLI subcommands are available — use these instead of `curl` when possible:pinchtab profiles # list profilespinchtab profiles create <name> # human setup: create before authenticationpinchtab instance start --profile <name> # start (auto-allocates port)-pinchtab instance navigate <id> <url>+pinchtab instance navigate <id> <url> # open a tab already on <url> (one step)pinchtab instance stop <id>pinchtab instance restart <id>pinchtab instance logs <id>diff --git a/skills/pinchtab/references/profiles.md b/skills/pinchtab/references/profiles.mdindex 07d3ced7..e88f2437 100644--- a/skills/pinchtab/references/profiles.md+++ b/skills/pinchtab/references/profiles.md@@ -60,7 +60,7 @@ CLI subcommands are available — use these instead of `curl` when possible:pinchtab profiles # list profilespinchtab profiles create <name> # human setup: create before authenticationpinchtab instance start --profile <name> # start (auto-allocates port)-pinchtab instance navigate <id> <url>+pinchtab instance navigate <id> <url> # open a tab already on <url> (one step)pinchtab instance stop <id>pinchtab instance restart <id>pinchtab instance logs <id>