refactor(cli, auth): Add Codex/OpenAI OAuth Support - finalized
- Replace `hermes login` with `hermes model` for selecting providers and managing authentication. - Update documentation and CLI commands to reflect the new provider selection process. - Introduce a new redaction system for logging sensitive information. - Enhance Codex model discovery by integrating API fetching and local cache. - Adjust max turns configuration logic for better clarity and precedence. - Improve error handling and user feedback during authentication processes.
This commit is contained in:
parent
500f0eab4a
commit
95b0610f36
3 changed files with 124 additions and 2 deletions
|
|
@ -247,13 +247,19 @@ class AIAgent:
|
|||
self._use_prompt_caching = is_openrouter and is_claude
|
||||
self._cache_ttl = "5m" # Default 5-minute TTL (1.25x write cost)
|
||||
|
||||
# Configure logging
|
||||
# Configure logging with secret redaction
|
||||
from agent.redact import RedactingFormatter
|
||||
if self.verbose_logging:
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
datefmt='%H:%M:%S'
|
||||
)
|
||||
for handler in logging.getLogger().handlers:
|
||||
handler.setFormatter(RedactingFormatter(
|
||||
'%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
datefmt='%H:%M:%S',
|
||||
))
|
||||
# Keep third-party libraries at WARNING level to reduce noise
|
||||
# We have our own retry and error logging that's more informative
|
||||
logging.getLogger('openai').setLevel(logging.WARNING)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue