Skip to content

Commit 48e738a

Browse files
committed
docs(thread): fully qualify Sphinx Chat refs (gemini review)
Rewrites `:py:meth:`Chat.on_subscribed_message`` and `:py:meth:`Chat.on_direct_message`` in `Thread.subscribe`'s docstring as `:py:meth:`~chat_sdk.chat.Chat.on_subscribed_message`` and `:py:meth:`~chat_sdk.chat.Chat.on_direct_message``. `Chat` is intentionally not imported in `thread.py` (TYPE_CHECKING-only) to avoid a circular import. The unqualified refs wouldn't resolve under Sphinx; the absolute paths do, and the `~` keeps the rendered link text short. The `test_thread_subscribe_docstring_documents_dm_carveout` pin still passes: its `"on_direct_message" in doc` assertion matches the substring inside the new qualified ref. https://claude.ai/code/session_01FyMxQn2BEAzmwKS1GZczKj
1 parent 183ca4f commit 48e738a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/chat_sdk/thread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ async def subscribe(self) -> None:
507507
"""Subscribe to future messages in this thread.
508508
509509
Once subscribed, messages in non-DM threads trigger
510-
:py:meth:`Chat.on_subscribed_message` handlers. DM threads route to
511-
:py:meth:`Chat.on_direct_message` first when a direct message handler
510+
:py:meth:`~chat_sdk.chat.Chat.on_subscribed_message` handlers. DM threads route to
511+
:py:meth:`~chat_sdk.chat.Chat.on_direct_message` first when a direct message handler
512512
is registered. The initial message that triggered subscription will
513513
NOT fire the handler.
514514
"""

0 commit comments

Comments
 (0)