Send account id when available (#1767)

For users with multiple accounts we need to specify the account to use.
This commit is contained in:
pakrym-oai authored and GitHub committed 2025-07-31 15:40:19 -07:00
1 parent 6ce0a5875b
commit 0935e6a875
3 files changed
+21 -2

No files matched your search

+11
View File
@@ -123,6 +123,17 @@ impl CodexAuth {
}
}
}
pub async fn get_account_id(&self) -> Option<String> {
match self.mode {
AuthMode::ApiKey => None,
AuthMode::ChatGPT => {
let token_data = self.get_token_data().await.ok()?;
token_data.account_id.clone()
}
}
}
}
// Loads the available auth information from the auth.json or OPENAI_API_KEY environment variable.