feat: support Grok Web account setup scripts (Tos, NSFW)#692
Merged
Conversation
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.
Summary
Add Grok Web account setup workflows for accepting the service agreement, setting an adult birth date, and enabling NSFW preferences.
The operations support both individual accounts and batch execution from the account management page.
Changes
Account scripts
Batch execution
batch.syncConcurrencyworker pool and hot-reload setting.Upstream protocol
SetTosAcceptedVersion/rest/auth/set-birth-dateUpdateUserFeatureControls429 + account:birth-date-change-limit-reachedresponse as an idempotent “birth date already set” result.Egress and browser identity
All XAI account-setting requests use the existing Grok Web egress manager:
{account}sticky-proxy supportThe TOS request intentionally omits
grok.comCloudflare cookies because it targetsaccounts.x.ai. Birth-date and NSFW requests include the normal Grok Web cookies and Statsig identity.NSFW status
web_account_profiles.nsfw_enabled_at.nsfwEnabledAtonly for Grok Web accounts.NSFWmarker and confirmation time in the Web account table.This is a historical confirmation marker, not a live query of the upstream preference.
Admin UI
Compatibility
Test plan
go test ./... -count=1go test -race ./internal/infra/provider/web ./internal/application/account -count=1go vet ./...go build ./cmd/grok2apipnpm buildpnpm lintgit diff --checkRegression coverage includes: