Add process-scoped PSP routing for ChatGPT requests (#36986)

## What changed

- Add a hidden global `--psp` runtime flag and propagate it through TUI, exec,
  app-server, remote-control, and in-process startup paths.
- Attach the `oai-chat-psp=true` cookie to first-party ChatGPT requests when
  enabled, using a cached cookie-aware client with sensitive request logging
  disabled.
- Keep the routing selection out of persistent configuration layers while
  preserving it across config refreshes and agent role changes.

## Testing

- Cover global flag parsing, app-server propagation, config-layer isolation,
  and preservation across config rebuilds and role changes.

GitOrigin-RevId: 05cdc61ffd7162d8e48fc1e166f4732113e5a816
This commit is contained in:
stevenlee-oai authored and copyberry committed 2026-08-04 22:23:40 +00:00
1 parent 411f3f0680
commit 1d952f027e
25 files changed
+199 -16

No files matched your search

@@ -222,6 +222,15 @@ pub fn create_client() -> HttpClient {
build_default_client(default_http_client_builder())
}
/// Creates the default client with configured ChatGPT cookies and no sensitive-response logging.
pub fn create_client_with_chatgpt_cookies(http_client_factory: &HttpClientFactory) -> HttpClient {
build_default_client(
default_http_client_builder()
.with_chatgpt_cookies(http_client_factory)
.without_request_logging(),
)
}
/// Create the default HTTP client without request URL or response-header diagnostics.
///
/// This preserves the default client's legacy custom-CA fallback and transport proxy behavior while