Skip to content

feat(chatgpt): let the caller name the app the browser sign-in pages return to - #3119

Open
siderakis wants to merge 1 commit into
0xPlaygrounds:mainfrom
siderakis:feat/chatgpt-sign-in-app-name
Open

siderakis wants to merge 1 commit into
0xPlaygrounds:mainfrom
siderakis:feat/chatgpt-sign-in-app-name

Conversation

@siderakis

Copy link
Copy Markdown

Description

The ChatGPT browser sign-in serves a page from its local callback listener, and every page tells the user to return to "rig": "You can close this tab and return to rig.", "Return to rig.", "Start it again from rig." An app built on rig-core or rig-harness (and its /login chatgpt command) has no way to change that, because the pages live in the private browser module.

This reads the app's name from CHATGPT_SIGN_IN_APP_NAME, beside CHATGPT_ORIGINATOR and CHATGPT_USER_AGENT, which already let the caller name itself to the backend. When it is unset or empty the pages say "rig", exactly as today. The name is resolved once in sign_in_with_browser and handed to the listener, so the pages and their tests take it as an argument and never read the environment. It is HTML-escaped like the rest of the page.

An environment variable rather than a builder on Authenticator, because LoginPlugin builds its own authenticator and is loaded by Default, so a harness app has no other way to reach it without new settings plumbing in rig-basics. Happy to add Authenticator::with_sign_in_app_name as well, or instead, if you prefer that shape.

Changelog

  • (chatgpt) The browser sign-in pages name the app in CHATGPT_SIGN_IN_APP_NAME instead of always saying "rig".

Migration

None. Unset, the pages are unchanged.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • cargo test --locked -p rig-core --lib providers::chatgpt::auth: 20 passed, including the new every_page_names_the_app_it_was_given (stale-link and failed pages, with an & in the name to check escaping) and an added assertion that the default success page still says "return to rig."
  • cargo clippy --locked -p rig-core --lib --tests: no warnings.
  • cargo fmt -p rig-core -- --check: clean.
  • The same commit applied to an app built on rig-harness, running a real /login chatgpt with the browser opener stubbed: with the variable set, the stale-link and access_denied callbacks returned pages naming the app; unset, they said "rig".
  • Not run: the full sign-in with OpenAI, so the success page was only checked through the listener test. Cassettes: not applicable.

Checklist:

  • I have updated READMEs and Rust docs affected by this change (sign_in_with_browser's docs name the variable)
  • I have added tests that prove my fix is effective or that my feature works
  • I did not edit CHANGELOG.md or MIGRATING.md

🤖 Generated with Claude Code

…return to

The ChatGPT browser sign-in pages told the user to return to "rig",
which is wrong for any app built on rig-core or rig-harness. They now
name the app in CHATGPT_SIGN_IN_APP_NAME, as CHATGPT_ORIGINATOR names
the caller to the backend, and still say rig when it is unset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant