feat: retry Schwab refresh with proxy after auth rejection#14
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db60422b17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ]; | ||
| } | ||
|
|
||
| async function runRefreshOnce({ modeLabel, proxyUrl }) { |
There was a problem hiding this comment.
Pass attempt label into
runRefreshOnce
buildAttemptPlan() creates attempts with a label field, but runRefreshOnce destructures { modeLabel, proxyUrl }, so modeLabel is always undefined. That means both direct and proxy attempts reuse the same persistent profile directory (schwab-local-session-undefined) instead of isolated per-mode sessions, which can carry over cookies/state from the failed direct attempt and make the proxy retry unreliable; it also obscures logs for diagnosing which mode ran.
Useful? React with 👍 / 👎.
Default the refresh workflow to try direct Schwab login first, then retry with the configured proxy when Schwab rejects the login page as an auth/risk failure or when the direct path hits a retryable network error.\n\nAlso adds a small retry classification helper and tests, and keeps manual workflow dispatch able to force proxy-first when needed.