chore: apply ruff format - #4
Merged
Merged
Conversation
CI's `ruff format --check packages/` was failing on three files in the limited-mode PR (#2) because I ran `ruff check --fix` locally but not `ruff format`. Mechanically re-running `uv run ruff format packages/` fixes them: client.py, config.py, tools/posts.py. No behavior changes — purely formatting. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI's mypy job flagged 19 union-attr errors on the limited-mode tools that fetch a Post/Chat by ID and then dereference attributes without checking for None: get_chat, get_reply_thread, get_replies_to_post, edit_post, delete_post, create_thread_chat. Add explicit `if X is None: return error_response(...)` guards before each first dereference, returning a clean ToolResponse error to the caller instead of an AttributeError at runtime. Also fixes create_thread_chat: Chat.create_branch returns a Branch wrapper, not a Chat. The new chat id is `branch.chat.id`, not `branch.id`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ivolnistov
added a commit
that referenced
this pull request
May 12, 2026
* chore: apply ruff format CI's `ruff format --check packages/` was failing on three files in the limited-mode PR (#2) because I ran `ruff check --fix` locally but not `ruff format`. Mechanically re-running `uv run ruff format packages/` fixes them: client.py, config.py, tools/posts.py. No behavior changes — purely formatting. * fix(types): None-check Post/Chat lookups in new limited-mode tools CI's mypy job flagged 19 union-attr errors on the limited-mode tools that fetch a Post/Chat by ID and then dereference attributes without checking for None: get_chat, get_reply_thread, get_replies_to_post, edit_post, delete_post, create_thread_chat. Add explicit `if X is None: return error_response(...)` guards before each first dereference, returning a clean ToolResponse error to the caller instead of an AttributeError at runtime. Also fixes create_thread_chat: Chat.create_branch returns a Branch wrapper, not a Chat. The new chat id is `branch.chat.id`, not `branch.id`. ---------
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.
Mechanical fix for the CI
ruff format --checkfailure on the limited-mode merge (#2): three files (client.py,config.py,tools/posts.py) had import order tweaks viaruff check --fixlocally but never went throughruff format. Re-running it produces the diff in this PR.No behavior changes — purely formatting.