Skip to content

fix: flag cached auth failures needing manual renewal - #501

Merged
Pigbibi merged 2 commits into
mainfrom
fix/cached-auth-recovery-action
Nov 1, 2026
Merged

Pigbibi merged 2 commits into
mainfrom
fix/cached-auth-recovery-action

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

AI assistance

Grok Bot (AI agent) prepared this change; reviewed against the original diff in #484.

What changed

Re-cuts only the cached-auth classification from #484 onto current main. When the account-facts sync fails because the cached session is missing/expired (cache_missing, cache_stale, cache_missing_or_stale) or upstream returned 401 (read_http_error at userinfo/account_list/account_read), the existing structured failure log now also carries recovery_action=manual_session_renewal_required. Storage read failures, upstream 403 and 5xx do not get the field. HTTP status and the redacted 503 response body are unchanged; no automatic login, retry, cache mutation or publication is added.

Files: main.py (+4), tests/test_account_facts_endpoint.py (+31), docs/account-archive-history.md (+7).

Not included: the candidate-publisher stage/reason diagnostics and notification wiring from #484. #489 already covers those, so they are not duplicated here.

How verified

  • tests/test_account_facts_endpoint.py: 37 passed; the 4 new parametrized cases fail without the main.py change.
  • Account/cached-related test files (338 tests): passed.
  • Full suite and ruff are left to remote CI.
  • No production invocation or deployment.

Why

Operators reading the failure log can tell when the existing manual /session-renew flow is the right recovery and when it would not help. Supersedes the cached-auth part of #484 (closed, branch kept).

Risk

Low. Adds one log field in an existing failure path; touches main.py, which the risk gate may flag for an owner approval label. No label added, draft, not merged. No changes to IAM, credentials, schedules, runtime or trading controls.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16e70755-7ece-4c0b-a9f4-fd9b518257d2
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Pigbibi Pigbibi added the owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. label Nov 1, 2026 — with Cursor
@Pigbibi
Pigbibi marked this pull request as ready for review November 1, 2026 14:16
@Pigbibi
Pigbibi merged commit f9596fa into main Nov 1, 2026
9 of 10 checks passed
@Pigbibi
Pigbibi deleted the fix/cached-auth-recovery-action branch November 1, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant