Commit 49779e6
chore: apply ruff format (#4)
* 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.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* 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`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 45a92dc commit 49779e6
4 files changed
Lines changed: 42 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 35 | + | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
| 85 | + | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
91 | | - | |
| 89 | + | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
| |||
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
| |||
276 | 281 | | |
277 | 282 | | |
278 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
279 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
280 | 293 | | |
281 | | - | |
282 | | - | |
| 294 | + | |
| 295 | + | |
283 | 296 | | |
284 | 297 | | |
285 | 298 | | |
| |||
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
1523 | 1528 | | |
1524 | 1529 | | |
1525 | 1530 | | |
1526 | 1531 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
| 1532 | + | |
1530 | 1533 | | |
1531 | 1534 | | |
1532 | 1535 | | |
| |||
1538 | 1541 | | |
1539 | 1542 | | |
1540 | 1543 | | |
1541 | | - | |
1542 | | - | |
1543 | | - | |
| 1544 | + | |
1544 | 1545 | | |
1545 | 1546 | | |
1546 | 1547 | | |
| |||
1561 | 1562 | | |
1562 | 1563 | | |
1563 | 1564 | | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
1564 | 1570 | | |
1565 | 1571 | | |
1566 | 1572 | | |
| |||
1600 | 1606 | | |
1601 | 1607 | | |
1602 | 1608 | | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
| 1609 | + | |
1606 | 1610 | | |
1607 | 1611 | | |
1608 | 1612 | | |
| |||
1629 | 1633 | | |
1630 | 1634 | | |
1631 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
1632 | 1641 | | |
1633 | 1642 | | |
1634 | 1643 | | |
| |||
1665 | 1674 | | |
1666 | 1675 | | |
1667 | 1676 | | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
1668 | 1682 | | |
1669 | 1683 | | |
1670 | 1684 | | |
1671 | 1685 | | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
| 1686 | + | |
1675 | 1687 | | |
1676 | 1688 | | |
1677 | 1689 | | |
| |||
0 commit comments