From 7118ff84353b6cf8f65ec372d0d089ec64c33e81 Mon Sep 17 00:00:00 2001 From: Lucas Giordano Date: Wed, 5 Aug 2026 18:54:52 +0200 Subject: [PATCH] fix: remove Firefox from the supported browser types Notte runs Chromium-family browsers only. Starting a session with --browser-type firefox is rejected by the API: Value error, Firefox sessions are not supported. Please use 'chromium' or 'chrome' as `browser_type`. The CLI still advertised it in several places. Removed from the README (both the feature list and the --browser-type line) and from the gen-flags field description override, which still read "Can be chromium, chrome or firefox" even though the generated flag help has since been corrected to "Supported values are chromium and chrome". validate.Browser was wrong in both directions: it accepted firefox and webkit, which the API rejects, and rejected chrome, which is valid. That list looks like Playwright's browser set rather than Notte's. It now accepts chromium and chrome plus the chrome-nightly / chrome-turbo legacy aliases, and its error message names the real options. Note validate.Browser is currently dead code - ValidateBrowser is referenced only by its own unit test, never wired to --browser-type, which is why an invalid value reaches the API today. Wiring it up would give a cleaner client-side error but changes behaviour and would stop the integration error-parsing tests exercising the API path, so it is left for a separate decision. internal/api/client.gen.go still carries SessionResponseBrowserTypeFirefox. It is generated from the OpenAPI spec and deliberately untouched; removing it means dropping firefox from the spec's browser_type Literal, which is an API-side change. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 4 ++-- internal/cmd/sessions_test.go | 2 +- internal/cmd/validation_test.go | 7 +++++-- internal/errors/errors_test.go | 4 ++-- internal/validate/validate.go | 17 ++++++++++++----- internal/validate/validate_test.go | 10 ++++++---- scripts/gen-flags/types.go | 2 +- tests/integration/errors_test.go | 2 +- 8 files changed, 30 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b879740..e5f8c1a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The Notte CLI brings the full power of [notte.cc](https://notte.cc?ref=github) t ## Features - **AI agents** - run and monitor AI-powered browser functions -- **Browser sessions** - headless or headed Chrome/Firefox with full control +- **Browser sessions** - headless or headed Chromium/Chrome with full control - **Files** - upload and download files to notte.cc - **Output formats** - human-readable text or JSON for scripting - **Personas** - create and manage digital identities with email, phone, and SMS @@ -118,7 +118,7 @@ notte sessions code # Get Python script for session steps ```bash notte sessions start \ - --browser-type chromium|chrome|firefox # Browser type (default: chromium) + --browser-type chromium|chrome # Browser type (default: chromium) --headless # Run in headless mode (default: true) --idle-timeout-minutes # Idle timeout (closes after inactivity) --max-duration-minutes # Maximum session lifetime diff --git a/internal/cmd/sessions_test.go b/internal/cmd/sessions_test.go index b39a389..6d49b94 100644 --- a/internal/cmd/sessions_test.go +++ b/internal/cmd/sessions_test.go @@ -130,7 +130,7 @@ func TestRunSessionsStart(t *testing.T) { }) SessionStartHeadless = false - SessionStartBrowserType = "firefox" + SessionStartBrowserType = "chrome" SessionStartIdleTimeoutMinutes = 5 sessionsStartProxy = true SessionStartSolveCaptchas = true diff --git a/internal/cmd/validation_test.go b/internal/cmd/validation_test.go index 1b54a4f..aa4436a 100644 --- a/internal/cmd/validation_test.go +++ b/internal/cmd/validation_test.go @@ -65,8 +65,11 @@ func TestValidateBrowser(t *testing.T) { wantErr bool }{ {"chromium", "chromium", false}, - {"firefox", "firefox", false}, - {"webkit", "webkit", false}, + {"chrome", "chrome", false}, + {"chrome-nightly", "chrome-nightly", false}, + {"chrome-turbo", "chrome-turbo", false}, + {"firefox", "firefox", true}, + {"webkit", "webkit", true}, {"invalid", "safari", true}, {"empty", "", true}, } diff --git a/internal/errors/errors_test.go b/internal/errors/errors_test.go index ec9a0ee..c218402 100644 --- a/internal/errors/errors_test.go +++ b/internal/errors/errors_test.go @@ -37,11 +37,11 @@ func TestAPIError_Unwrap(t *testing.T) { func TestValidationError_Error(t *testing.T) { err := &ValidationError{ Field: "browser", - Message: "expected chromium|firefox|webkit, got 'chrome'", + Message: "expected chromium|chrome, got 'firefox'", } got := err.Error() - want := "validation error: browser: expected chromium|firefox|webkit, got 'chrome'" + want := "validation error: browser: expected chromium|chrome, got 'firefox'" if got != want { t.Errorf("got %q, want %q", got, want) diff --git a/internal/validate/validate.go b/internal/validate/validate.go index 12b7669..0ded044 100644 --- a/internal/validate/validate.go +++ b/internal/validate/validate.go @@ -45,16 +45,23 @@ func JSON(s string) error { return nil } -// Browser validates browser type +// Browser validates browser type. +// +// Notte runs Chromium-family browsers only. Firefox and WebKit are not +// supported - the API rejects a Firefox session with "Firefox sessions are not +// supported. Please use 'chromium' or 'chrome' as `browser_type`" - and +// `chrome` is valid despite an earlier version of this list omitting it. +// chrome-nightly and chrome-turbo are accepted as legacy aliases for chrome. func Browser(s string) error { valid := map[string]bool{ - "chromium": true, - "firefox": true, - "webkit": true, + "chromium": true, + "chrome": true, + "chrome-nightly": true, + "chrome-turbo": true, } if !valid[s] { - return fmt.Errorf("invalid browser: expected chromium|firefox|webkit, got %q", s) + return fmt.Errorf("invalid browser: expected chromium|chrome, got %q", s) } return nil diff --git a/internal/validate/validate_test.go b/internal/validate/validate_test.go index fc07537..c954dc2 100644 --- a/internal/validate/validate_test.go +++ b/internal/validate/validate_test.go @@ -59,10 +59,12 @@ func TestBrowser(t *testing.T) { wantErr bool }{ {"chromium", false}, - {"firefox", false}, - {"webkit", false}, - {"chrome", true}, // Not valid - should be chromium - {"safari", true}, // Not valid - should be webkit + {"chrome", false}, + {"chrome-nightly", false}, // legacy alias for chrome + {"chrome-turbo", false}, // legacy alias for chrome + {"firefox", true}, // the API rejects Firefox sessions outright + {"webkit", true}, // never supported + {"safari", true}, {"", true}, } diff --git a/scripts/gen-flags/types.go b/scripts/gen-flags/types.go index 47e961d..d1f8602 100644 --- a/scripts/gen-flags/types.go +++ b/scripts/gen-flags/types.go @@ -62,7 +62,7 @@ var FlattenWithoutPrefix = map[string]map[string]bool{ // whose OpenAPI metadata is currently flattened away before flag generation. var FieldDescriptionOverrides = map[string]map[string]string{ "SessionStart": { - "browser_type": "The browser type to use. Can be chromium, chrome or firefox.", + "browser_type": "The browser type to use. Supported values are chromium and chrome.", }, } diff --git a/tests/integration/errors_test.go b/tests/integration/errors_test.go index dbf2714..63bc2e0 100644 --- a/tests/integration/errors_test.go +++ b/tests/integration/errors_test.go @@ -142,7 +142,7 @@ func TestErrorParsing_ValidationErrorContainsDetails(t *testing.T) { stderr := result.Stderr // Check that error mentions at least one valid browser type - validBrowsers := []string{"chromium", "chrome", "firefox"} + validBrowsers := []string{"chromium", "chrome"} foundValidBrowser := false for _, browser := range validBrowsers { if containsString(stderr, browser) {