fix(Twitter): guard None post, fix cache miss, fix char limit#236
fix(Twitter): guard None post, fix cache miss, fix char limit#236tatenda-source wants to merge 2 commits intoFujiwaraChoki:mainfrom
Conversation
…imit Closes FujiwaraChoki#226 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 442f89cb3e
ℹ️ 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".
| with open(get_twitter_cache_path(), "r") as file: | ||
| previous_json = json.loads(file.read()) |
There was a problem hiding this comment.
Create cache file before reading in add_post
add_post now opens twitter.json directly, but this method no longer calls get_posts() (which used to create the file when missing). If Twitter.post() is invoked in a context where the cache file has not been initialized yet (e.g., direct class usage or after cache cleanup), this raises FileNotFoundError and aborts posting before the cache can be updated.
Useful? React with 👍 / 👎.
Ensures add_post() creates the twitter.json cache file when it doesn't exist, preventing FileNotFoundError on first use. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Closes #226
Test plan
🤖 Generated with Claude Code