Skip to content

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

fix: stop defaulting browser.version to the fallback literal so the persona probes the launched binary (PIN-074)

Luigi Agostifeeff284e58a
diff --git a/internal/config/config_file.go b/internal/config/config_file.go
index be3370ee..217a7ef4 100644
--- a/internal/config/config_file.go
+++ b/internal/config/config_file.go
@@ -3,8 +3,6 @@ package config
import (
"strconv"
"strings"
-
- "github.com/pinchtab/pinchtab/internal/browserprobe"
)
// CurrentConfigVersion is bumped when config schema changes require migration or wizard re-run.
@@ -167,7 +165,9 @@ func DefaultFileConfig() FileConfig {
StateDir: userConfigDir(),
},
Browser: BrowserConfig{
- BrowserVersion: browserprobe.FallbackChromeVersion,
+ // BrowserVersion is left unset so the persona probes the launched binary
+ // for its real version; a default here would pin it and the probe would
+ // never fire. TestTheConfigDefaultsLeaveBrowserVersionUnset guards this.
ExtensionPaths: []string{defaultExtensionsDir(userConfigDir())},
},
Browsers: BrowsersConfig{
diff --git a/internal/config/config_load.go b/internal/config/config_load.go
index 3b4d4f4a..88011ce0 100644
--- a/internal/config/config_load.go
+++ b/internal/config/config_load.go
@@ -11,7 +11,6 @@ import (
"time"
"github.com/pinchtab/pinchtab/internal/autosolver"
- "github.com/pinchtab/pinchtab/internal/browserprobe"
"github.com/pinchtab/pinchtab/internal/browsers"
)
@@ -225,7 +224,6 @@ func LoadConfig() (*RuntimeConfig, []LoadDiagnostic, error) {
ProfilesBaseDir: "",
DefaultProfile: "default",
ProfileQuarantineKeep: DefaultProfileQuarantineKeep,
- BrowserVersion: browserprobe.FallbackChromeVersion,
Timezone: "",
BlockImages: false,
BlockMedia: false,
diff --git a/internal/config/editor_get_effective_test.go b/internal/config/editor_get_effective_test.go
index 3b55504d..c5fd3676 100644
--- a/internal/config/editor_get_effective_test.go
+++ b/internal/config/editor_get_effective_test.go
@@ -127,6 +127,8 @@ var defaultLivesAtItsConsumer = map[string]string{
"server.cookieSecure": "there is no single value: the cookie layer decides per request from that request's scheme, so any printed answer would be wrong for half the requests",
"server.networkBufferSize": "the per-tab buffer default is DefaultNetworkBufferSize in the network buffer itself, applied when the configured size is zero; the config layer never settles it, so reporting a number here would be this package's own guess",
+
+ "browser.version": "left unset by default so the persona probes the launched binary for its real version (stealth.ResolveBrowserVersion); until the operator pins browser.version explicitly there is no single settled value at the config layer, and printing the fallback literal here would advertise a version the running browser may not be",
}
// TestEveryAddressableConfigKeyAnswersOrIsAccountedFor is the standing census behind
diff --git a/internal/stealth/version_owner_test.go b/internal/stealth/version_owner_test.go
index 445a5b45..052ee0f2 100644
--- a/internal/stealth/version_owner_test.go
+++ b/internal/stealth/version_owner_test.go
@@ -93,14 +93,13 @@ func TestNoPackageKeepsItsOwnCopyOfTheFallbackBrowserVersion(t *testing.T) {
}
}
-// The other direction: the packages that lost their literal must actually READ the owner,
-// or the census above passes because the default went missing rather than because it is
-// shared. Each site is named with the default it supplies.
-func TestTheVersionDefaultsReadTheOneOwner(t *testing.T) {
- // The two config defaults are asserted at the VALUE POSITION of the BrowserVersion
- // field, not merely somewhere in the file: a file that reads the constant for some
- // other purpose while its default comes from elsewhere is exactly the drift this
- // census exists to catch, and a file-level check passes on it.
+// The probe only fires when browser.version is unset, so the config defaults must NOT
+// pin it — not to a literal (the census above bans those) and not to the fallback
+// constant either. A default here would make every fresh config advertise the frozen
+// version and the launched-binary probe would never run, which is the defect. So this
+// asserts neither config default supplies a BrowserVersion field at all, and that the
+// fallback survives only where it belongs: the persona layer, reading the one owner.
+func TestTheConfigDefaultsLeaveBrowserVersionUnset(t *testing.T) {
for _, tc := range []struct{ dir, file, what string }{
{"../config", "config_file.go", "the file-config default written into a new config"},
{"../config", "config_load.go", "the RuntimeConfig default used when no file config applies"},
@@ -118,18 +117,13 @@ func TestTheVersionDefaultsReadTheOneOwner(t *testing.T) {
t.Fatalf("%s is not in %s; this census is reading the wrong package", tc.file, tc.dir)
}
- assigned, ok := browserVersionFieldValue(t, tc.dir+"/"+tc.file)
- if !ok {
- t.Errorf("%s no longer sets a BrowserVersion field, so %s is gone rather than shared", tc.file, tc.what)
- continue
- }
- if !assigned {
- t.Errorf("%s sets BrowserVersion from something other than browserprobe.FallbackChromeVersion, so %s can drift from the owner again", tc.file, tc.what)
+ if _, found := browserVersionFieldValue(t, tc.dir+"/"+tc.file); found {
+ t.Errorf("%s sets a BrowserVersion default, so %s pins the version and the launched-binary probe never fires", tc.file, tc.what)
}
}
- // The UA builder's fallback is an assignment inside ReducedBrowserVersion rather than
- // a struct field, so it is pinned to that function's body.
+ // The fallback lives at the persona layer instead: ReducedBrowserVersion reads the
+ // one owner, so the literal is applied only when the probe cannot answer.
if !funcReferencesFallbackConstant(t, "ua.go", "ReducedBrowserVersion") {
t.Error("ReducedBrowserVersion no longer reads browserprobe.FallbackChromeVersion, so the UA fallback comes from somewhere else and the value can drift again")
}