Skip to content

[codex] Harden auth handling and replace source tests#5

Merged
itsreverence merged 2 commits into
mainfrom
auth-fixes
Jun 16, 2026
Merged

[codex] Harden auth handling and replace source tests#5
itsreverence merged 2 commits into
mainfrom
auth-fixes

Conversation

@itsreverence

Copy link
Copy Markdown
Owner

Summary

  • Replace source-string coverage for Home Assistant-facing flows with behavior-level tests using focused local HA fakes.
  • Harden Codex auth handling by distinguishing reauth-required failures from temporary refresh failures.
  • Align conversation and AI Task retry behavior, including retry-after-refresh handling for data and image paths.
  • Prevent orphaned tool outputs when trimming Codex conversation input history.
  • Avoid logging raw AI Task structured-output text on JSON parse failures.
  • Require a refresh token on initial authorization-code exchange while preserving refresh-token fallback during refresh rotation.
  • Align package metadata with the v0.2.0 release line.

Validation

  • uv run pytest -q passed: 73 tests.
  • uv run ruff check . passed.
  • Two full-diff review passes reported no blocking production or test/release issues.

Notes

The branch intentionally excludes local .agents/ and skills-lock.json files from the PR scope.

- Bump version in pyproject.toml and uv.lock to 0.2.0.
- Refactor authentication error handling in ai_task.py and conversation.py to use new CodexReauthRequiredError and CodexAuthTemporaryError exceptions.
- Improve logging for authentication failures and reauthentication prompts.
- Add a new method to trim input items in conversation history to maintain performance.
- Introduce error handling for token refresh failures in codex_auth.py and codex_runtime.py.
@itsreverence
itsreverence marked this pull request as ready for review June 16, 2026 06:12
@itsreverence
itsreverence merged commit ab723b3 into main Jun 16, 2026
3 checks passed
@itsreverence
itsreverence deleted the auth-fixes branch June 16, 2026 06:12
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