Add --headed, --no-solve-captchas and --no-file-storage - #61
Merged
Conversation
Three session-start options default to true server-side, which left their flags shaped as opt-ins for something already on. Passing --headless or --solve-captchas changed nothing, and turning either off meant the double negative `--headless=false`. #60 made the defaults visible in help; this gives each a positive way to opt out. notte sessions start --headed # was --headless=false notte sessions start --no-solve-captchas # was --solve-captchas=false notte sessions start --no-file-storage # was --use-file-storage=false Naming follows one rule: use the word the ecosystem already has, otherwise prefix with --no-. Playwright exposes a visible browser as --headed and users arrive from Playwright and Puppeteer, so that is what they will guess. The other two have no comparable term and take the --no- prefix used by git, docker, npm and curl. --no- rather than --disable- specifically because Chromium's own flags are --disable-* and this command forwards them verbatim through --chrome-args. Distinct prefixes mean `--no-file-storage --chrome-args="--disable-gpu"` reads unambiguously as one Notte flag and one browser flag. The originals are deliberately NOT deprecated. Pinning a value explicitly is legitimate defensive scripting: a caller who needs a headless session should not have to trust that the server default stays true, which is exactly the failure mode #58 and #60 dealt with. Deprecating would also print a warning on the most common invocation in our own docs. Passing both spellings at once is an error rather than letting precedence silently pick a winner. Omitting the new flags sends nothing, so the server default still applies - covered by a test, since sending an explicit value would re-freeze the default into the client. Verified against the API: --headed -> headless=false, --no-file-storage -> use_file_storage=false, --no-solve-captchas -> solve_captchas=false, no flags -> all three true, and `--headed --headless` is rejected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
| Filename | Overview |
|---|---|
| internal/cmd/sessions.go | Wires session-start validation into PreRunE, ensuring conflicting flags are rejected before the current session can be stopped. |
| internal/cmd/sessionstart_optout.go | Registers the three opt-out flags, maps them to inverse request values, and validates conflicts with original flags. |
| internal/cmd/sessionstart_optout_test.go | Adds focused unit tests covering unset request fields, inversion semantics, conflicts, early validation, and continued support for original flags. |
Reviews (2): Last reviewed commit: "fix: validate session-start flag conflic..." | Re-trigger Greptile
…t session Review catch, and a real one. runSessionsStart prompts, stops the current session and clears the local pointers before it builds the request, so the conflict check I put next to the request build ran too late: notte sessions start --headed --headless with an active session stopped that session, wiped current_session, current_viewer_url and current_agent, and only then refused to start a new one. The user ends up with neither. Validation now hangs off PreRunE, which cobra runs before RunE and therefore before any of that. applySessionStartOptOuts revalidates so the invariant does not depend on the command wiring. The pre-existing proxy check had exactly the same shape - it also ran after the stop - so it is extracted into validateSessionStartProxyFlags and runs from the same place. `--proxy --proxy-country=us` no longer costs the caller their session either. Verified against the API with a session active: both conflicts now error while the original session stays `active`. Previously it would have been stopped. The regression test asserts the ordering rather than just the error - that sessionsStartCmd has a PreRunE at all, and that RunE does not run for an invalid combination. Testing only for a returned error would pass even with the bug. Also fixes the gofumpt failure from CI: the table literal in sessionstart_optout_test.go now uses named fields. `gofmt` accepted it, which is why it slipped through locally; golangci-lint runs gofumpt, which is stricter. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
@greptile new review |
giordano-lucas
added a commit
that referenced
this pull request
Aug 6, 2026
…lp (#62) The README still described the pre-v0.0.31 flag surface. It showed --solve-captchas and --use-file-storage as things you switch on, when all three of those options default to true server-side, and it did not mention --headed, --no-solve-captchas or --no-file-storage at all. --headed # was: --headless (a no-op against the default) --no-solve-captchas # was: --solve-captchas --no-file-storage # was: --use-file-storage Also: - document the session lifetime that #60 surfaced: 3 minutes idle, 15 minutes total. Neither default appeared in the README, and both are short enough that the next command fails with a bare "Session closed" without saying why - drop --headless and --solve-captchas from examples that only passed them to get the default behaviour - correct `notte page upload`. The README showed a positional `notte page upload <id> <file>`; it is a required --file flag, and the name refers to a file in the uploads store rather than a path on the caller's machine, so a local path fails with "Unable to get file: <path> for upload". The `notte files upload` step it needs first is now spelled out, as is the matching `notte files download --from session` for retrieving what `page download` produced Separately, fixes a cosmetic bug I shipped in #61. Cobra's UnquoteUsage takes the first backquoted span in a usage string as the flag's value placeholder, and the --no-file-storage description had `notte page download` in backticks, so v0.0.31 renders it as: --no-file-storage notte page download Do not attach FileStorage... as though the flag took an argument. Single quotes instead. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #60. That PR made the true defaults visible; this makes them actionable.
Three session-start options default to
trueserver-side, which left their flags shaped as opt-ins for something already on. Passing--headlessor--solve-captchaschanged nothing, and turning either off meant a double negative.Naming
One rule: use the word the ecosystem already has, otherwise prefix with
--no-.--headedis Playwright's (playwright test --headed), and Notte's users mostly arrive from Playwright or Puppeteer, so it's the one they'll guess. The other two have no comparable term.--no-rather than--disable-for a reason specific to this command: Chromium's own flags are--disable-*, andsessions startforwards them verbatim through--chrome-args. Distinct prefixes keep the layers legible —notte sessions start --no-file-storage --chrome-args="--disable-gpu"— one Notte flag, one browser flag, no ambiguity about which is which.
--no-is also what git, docker, npm and curl use.The originals are deliberately not deprecated
Pinning a value explicitly is legitimate defensive scripting. A caller who needs a headless session shouldn't have to trust that the server default stays
true— that's precisely the failure mode #58 and #60 dealt with. Deprecating would also print a warning on the single most common invocation in our own docs (sessions start --headlessappears eight times across the skills).Passing both spellings at once is an error rather than letting precedence quietly pick a winner:
Omitting them still sends nothing
The most important property, and the one with a dedicated test: when the new flags are absent, nothing is written to the request body, so the server default applies. Sending an explicit value would re-freeze today's default into the client — the bug #58 fixed.
Verification
Against the live API:
--headedheadless: false--no-file-storageuse_file_storage: false--no-solve-captchassolve_captchas: falsetrue— unchanged--headed --headlesssessionstart_optout_test.go: absent flags leave the body untouched, each flag inverts its counterpart (including--headed=false→headless=true), conflicting pairs are rejected, and the originals stay registered, visible and undeprecatedgo build,go vet,gofmt -lclean;go test ./internal/...— all 10 packages passsessionstart_optout.go, not the generated file, somake generatewon't clobber themFollow-up
notte-skillsdocuments--headless=falseand claims it's "not available on remote/CI environments" — but a cloud session accepts it and reportsheadless: false, so that claim looks wrong. I'll update the skills to use--headedand fix that claim once this lands.🤖 Generated with Claude Code