High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
nav: expose per-request timeout as a CLI option; raise internal 60s limits so the documented 120s max is reachable
dertbf15c7ed0ff25
diff --git a/cmd/pinchtab/cmd_cli_register.go b/cmd/pinchtab/cmd_cli_register.goindex 662f6f35..b87fd8fa 100644--- a/cmd/pinchtab/cmd_cli_register.go+++ b/cmd/pinchtab/cmd_cli_register.go@@ -196,6 +196,7 @@ func configureBrowserFlags() {checkedCmd.Flags().Bool("json", false, "Output full JSON response instead of just checked state")navCmd.Flags().Bool("new-tab", false, "Open in new tab")+ navCmd.Flags().Float64("timeout", 0, "Navigation timeout in seconds (max 120); overrides the 30s new-tab ceiling")navCmd.Flags().Bool("block-images", false, "Block image loading")navCmd.Flags().Bool("block-ads", false, "Block ads")addPostActionFlags(navCmd, "navigation", true)diff --git a/internal/cli/actions/actions_navigate.go b/internal/cli/actions/actions_navigate.goindex 14899c21..07826219 100644--- a/internal/cli/actions/actions_navigate.go+++ b/internal/cli/actions/actions_navigate.go@@ -1,6 +1,7 @@package actionsimport (+ "time""fmt""net/http""os"@@ -80,6 +81,12 @@ func landedURL(result map[string]any) string {func Navigate(client *http.Client, base, token string, url string, cmd *cobra.Command) string {req := buildNavigateRequest(url, cmd)+ // A per-request timeout can exceed the shared client budget; mirror the+ // longClient pattern used by scrape/audit so the HTTP client outlives it.+ if v, err := cmd.Flags().GetFloat64("timeout"); err == nil && v > 0 {+ client = &http.Client{Transport: client.Transport, Timeout: time.Duration((v + 15) * float64(time.Second))}+ }+jsonOutput, _ := cmd.Flags().GetBool("json")if jsonOutput {result, usedFallback := postNavigate(client, base, token, req, true)@@ -148,6 +155,9 @@ func buildNavigateRequest(url string, cmd *cobra.Command) navigateRequest {if newTab {body["newTab"] = true}+ if v, err := cmd.Flags().GetFloat64("timeout"); err == nil && v > 0 {+ body["timeout"] = v+ }if v, _ := cmd.Flags().GetBool("block-images"); v {body["blockImages"] = true}diff --git a/internal/instance/bridge_client.go b/internal/instance/bridge_client.goindex e37af60c..45ff4f53 100644--- a/internal/instance/bridge_client.go+++ b/internal/instance/bridge_client.go@@ -22,7 +22,7 @@ type BridgeClient struct {// NewBridgeClient creates a BridgeClient.func NewBridgeClient() *BridgeClient {return &BridgeClient{- client: &http.Client{Timeout: 60 * time.Second},+ client: &http.Client{Timeout: 135 * time.Second},}}diff --git a/internal/orchestrator/orchestrator.go b/internal/orchestrator/orchestrator.goindex d5fa2ea0..0cb146d4 100644--- a/internal/orchestrator/orchestrator.go+++ b/internal/orchestrator/orchestrator.go@@ -158,7 +158,7 @@ func NewOrchestratorWithRunner(baseDir string, runner HostRunner) *Orchestrator// 2. Tab operations to complete (navigate, snapshot, actions, etc.)// - Short timeout (<5s) would break first-request scenarios// See: internal/orchestrator/health.go (monitor), internal/bridge/init.go (InitBrowser)- client: &http.Client{Timeout: 60 * time.Second},+ client: &http.Client{Timeout: 135 * time.Second},childAuthToken: "",allowEvaluate: false,internalToken: generateInternalToken(),diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.goindex e3d53ccb..b7e2f458 100644--- a/internal/proxy/proxy.go+++ b/internal/proxy/proxy.go@@ -19,7 +19,7 @@ import (// DefaultClient is the shared HTTP client for proxy requests.// A 60-second timeout accommodates lazy Chrome initialization (8-20s)// and tab navigation (up to 60s for NavigateTimeout in bridge config).-var DefaultClient = &http.Client{Timeout: 60 * time.Second}+var DefaultClient = &http.Client{Timeout: 135 * time.Second}type Options struct {Client *http.Clientdiff --git a/internal/server/bridge.go b/internal/server/bridge.goindex 80064177..3e1b1e3c 100644--- a/internal/server/bridge.go+++ b/internal/server/bridge.go@@ -99,7 +99,7 @@ func RunBridgeServer(cfg *config.RuntimeConfig, version string) {MaxHeaderBytes: maxHeaderBytes,ReadHeaderTimeout: 10 * time.Second,ReadTimeout: 30 * time.Second,- WriteTimeout: 60 * time.Second,+ WriteTimeout: 135 * time.Second,IdleTimeout: 120 * time.Second,}diff --git a/internal/server/server.go b/internal/server/server.goindex 560ed470..c2c217ab 100644--- a/internal/server/server.go+++ b/internal/server/server.go@@ -309,7 +309,7 @@ func RunDashboard(cfg *config.RuntimeConfig, version string) {MaxHeaderBytes: maxHeaderBytes,ReadHeaderTimeout: 10 * time.Second,ReadTimeout: 30 * time.Second,- WriteTimeout: 60 * time.Second,+ WriteTimeout: 135 * time.Second,IdleTimeout: 120 * time.Second,}