Skip to content

chore: apply ruff format - #4

Merged
ivolnistov merged 2 commits into
mainfrom
chore/ruff-format
May 12, 2026
Merged

chore: apply ruff format#4
ivolnistov merged 2 commits into
mainfrom
chore/ruff-format

Conversation

@ivolnistov

Copy link
Copy Markdown
Collaborator

Mechanical fix for the CI ruff format --check failure on the limited-mode merge (#2): three files (client.py, config.py, tools/posts.py) had import order tweaks via ruff check --fix locally but never went through ruff format. Re-running it produces the diff in this PR.

No behavior changes — purely formatting.

ivolnistov and others added 2 commits May 12, 2026 21:43
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
ivolnistov merged commit 49779e6 into main May 12, 2026
3 checks passed
@ivolnistov
ivolnistov deleted the chore/ruff-format branch May 12, 2026 19:48
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`.

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant