fix(reddit): detect auth status in doctor check#261
Open
thomaslau0229 wants to merge 1 commit intoPanniantong:mainfrom
Open
fix(reddit): detect auth status in doctor check#261thomaslau0229 wants to merge 1 commit intoPanniantong:mainfrom
thomaslau0229 wants to merge 1 commit intoPanniantong:mainfrom
Conversation
Reddit has required authentication for all API requests since 2024.
Previously, the doctor check only verified that rdt was installed,
reporting ok even when all requests would fail with HTTP 403.
This fix makes the doctor check call rdt status --json to verify
the session is actually authenticated before reporting success.
Changes:
- check() now runs rdt status --json and inspects authenticated field
- Reports warn (not ok) when rdt-cli is installed but not logged in
- Warn message includes two recovery paths:
- Automatic: rdt login (extracts cookies from browser)
- Manual: Cookie-Editor extension for Chrome/Edge 127+ where
automatic extraction fails due to App-Bound Encryption
(Chrome Web Store link included for discoverability)
- Adds test coverage for all four states: off / ok / warn / error
- Fixes pre-existing lint issues in test_channels.py (I001, F841)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
agent-reach doctorreported ✅ ok for Reddit as long asrdtwas installed — even when every API request would fail with HTTP 403 Forbidden.Root cause: Reddit has required authentication for all requests since 2024 (including public subreddit reads). The old check only verified the binary existed, never whether the session was authenticated.
Additionally, the currently pinned
rdt-cli(v0.4.1 on PyPI) predates the authentication improvements in v0.4.2. The newer version is available at public-clis/rdt-cli and recommended for users hitting auth issues.Solution
Make
check()callrdt status --jsonand inspect theauthenticatedfield.New behavior:
ok— installed and authenticated (shows username)warn— installed but not logged in → shows two recovery pathsoff— not installed → points to v0.4.2+ andpublic-clis/rdt-cliRecovery paths shown in the warn message
rdt login(extracts cookies from browser session)Tests
All four states covered. All existing tests pass.
Real-world context
Discovered while debugging a production pipeline:
agent-reach doctorshowed Reddit as healthy, but everyrdt sub <subreddit>call silently returned 403. The manual Cookie-Editor workaround was confirmed working on Windows with Chrome 127+.