Skip to content

Commit 89e0a33

Browse files
Zawwarsami16claude
andcommitted
fix tests: restore chat_response + invoke_result + chat_request imports
CI failure was 'name chat_response is not defined' in server.ws_connect proxy path, plus invoke_result used in invoke flow. client.chat() needs chat_request at module level too — inline import was a smell. tests pass locally now (pytest 10/10 in venv). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ce7598d commit 89e0a33

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

zhub/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from .manifest import Capability, Manifest, chat_only_manifest
2525
from .protocol import (
26-
Envelope, register_publisher, register_connection,
26+
Envelope, register_publisher, register_connection, chat_request,
2727
invoke_request, invoke_result,
2828
)
2929
from .errors import AuthError, ConnectionError as ZhubConnectionError
@@ -225,7 +225,6 @@ async def chat(self, messages: list[dict[str, Any]],
225225
model: str = "default", temperature: float = 0.4,
226226
max_tokens: int = 4096, timeout: float = 60.0) -> dict[str, Any]:
227227
"""Send a chat request through the hub to the AI."""
228-
from .protocol import chat_request
229228
env = chat_request(messages, model, temperature, max_tokens)
230229
future = asyncio.get_running_loop().create_future()
231230
self._pending[env.request_id] = future

zhub/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
) from e
3939

4040
from .protocol import (
41-
Envelope, registered, chat_request,
42-
invoke_request, connection_event, error_envelope, new_request_id,
41+
Envelope, registered, chat_request, chat_response,
42+
invoke_request, invoke_result, connection_event, error_envelope, new_request_id,
4343
)
4444

4545

0 commit comments

Comments
 (0)