From 28c10bfed1c06ed82b19e19f5c46a539bffacd77 Mon Sep 17 00:00:00 2001 From: ajspig Date: Tue, 14 Apr 2026 18:25:49 -0400 Subject: [PATCH] chore: cr --- honcho-cli/src/honcho_cli/commands/message.py | 8 ++------ honcho-cli/src/honcho_cli/commands/workspace.py | 5 ++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/honcho-cli/src/honcho_cli/commands/message.py b/honcho-cli/src/honcho_cli/commands/message.py index f1e94b18..04b0b711 100644 --- a/honcho-cli/src/honcho_cli/commands/message.py +++ b/honcho-cli/src/honcho_cli/commands/message.py @@ -8,9 +8,7 @@ from typing import Optional import typer -from honcho.api_types import MessageCreateParams, MessageResponse -from honcho.http import routes -from honcho.message import Message +from honcho.api_types import MessageCreateParams from honcho_cli.commands.session import _get_session_id from honcho_cli.commands.workspace import _handle_error @@ -145,10 +143,8 @@ def get_message( client, config = get_client() try: - # Hit the direct message endpoint instead of paging the session. sess = client.session(sid) - data = client._http.get(routes.message(sess.workspace_id, sess.id, message_id)) - msg = Message.from_api_response(MessageResponse.model_validate(data)) + msg = sess.get_message(message_id) print_result({ "id": msg.id, diff --git a/honcho-cli/src/honcho_cli/commands/workspace.py b/honcho-cli/src/honcho_cli/commands/workspace.py index d4ae9921..bc543c42 100644 --- a/honcho-cli/src/honcho_cli/commands/workspace.py +++ b/honcho-cli/src/honcho_cli/commands/workspace.py @@ -297,9 +297,12 @@ def _handle_error(e: Exception, resource: str, resource_id: str) -> None: {resource: resource_id}, ) raise typer.Exit(1) - if isinstance(e, (AuthenticationError, PermissionDeniedError)): + if isinstance(e, AuthenticationError): print_error("AUTH_ERROR", f"Authentication failed: {e}", {}) raise typer.Exit(3) + if isinstance(e, PermissionDeniedError): + print_error("PERMISSION_ERROR", f"Permission denied: {e}", {}) + raise typer.Exit(3) if isinstance(e, ServerError): print_error("SERVER_ERROR", f"Server error: {e}", {resource: resource_id}) raise typer.Exit(2)