0.8.0: scouts.update(is_public), APIConnectionError for transport failures, lazy chat namespace#131
Merged
Conversation
The developer API's PATCH /v1/scouting/tasks/{id} accepts is_public, but
neither client exposed it on update() — only create() — so visibility could
not be changed after creation through the SDK (yutori-mcp's edit_scout hit
TypeError trying). Adds the parameter to both sync and async namespaces,
threaded through the shared payload builder, with wire-payload tests
asserting False survives the None-filter and the status mutual-exclusion
still applies.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
handle_response already wraps auth failures, redirects, status errors, and non-JSON bodies, but httpx transport errors (timeouts, DNS/connect failures) escaped _request raw — and some (e.g. ReadTimeout) stringify to "", giving callers a blank error. Both _request chokepoints now raise APIConnectionError with a message that always names the underlying httpx exception type. Exported from the package root. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The chat namespace eagerly constructed an OpenAI client (its own HTTP client and SSL context) in every YutoriClient/AsyncYutoriClient __init__ — roughly half the client construction cost — even for callers that never use chat completions (e.g. yutori-mcp, which builds a client per tool call). It is now constructed on first access, and close() releases it inside try/finally so a failure closing the HTTP client no longer leaks it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
scripts/build_install.sh output tracks the package version; CI's install-sh check requires it to be committed alongside version bumps. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ba91ec6. Configure here.
| **self._request_kwargs(params, json), | ||
| ) | ||
| except httpx.HTTPError as exc: | ||
| raise _to_connection_error(exc) from exc |
There was a problem hiding this comment.
CLI misses APIConnectionError handler
Medium Severity
_request now raises APIConnectionError for transport failures instead of raw httpx errors. cli_api_errors still catches only httpx.HTTPError, so CLI commands using a real YutoriClient can show a Typer traceback on timeouts or connection failures instead of the intended friendly network message.
Reviewed by Cursor Bugbot for commit ba91ec6. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Changes
scouts.update(is_public=...)— the developer API's PATCH already acceptsis_public, but neither client exposed it onupdate()(onlycreate()), so visibility couldn't be changed after creation through the SDK; yutori-mcp'sedit_scouthit aTypeError. Added to both sync and async namespaces through the shared payload builder. Verified live against production: anis_publicedit round-trips correctly.APIConnectionErrorfor transport failures —handle_responsealready wraps auth failures, redirects, status errors, and non-JSON bodies, but httpx transport errors (timeouts, DNS/connect failures) escaped_requestraw — and some (e.g.ReadTimeout) stringify to"", giving callers a blank error. Both_requestchokepoints now raiseAPIConnectionErrorwith a message that always names the underlying httpx exception type. Exported from the package root.Lazy
chatnamespace — the chat namespace eagerly built an OpenAI client (its own HTTP client + SSL context) in every client__init__— measured at roughly half the construction cost — even for callers that never use chat completions (yutori-mcp builds a client per tool call). Now constructed on first attribute access;close()releases it insidetry/finallyso an HTTP-client close failure can't leak it.Version → 0.8.0.
Tests
442 passed, 3 skipped. New coverage:
is_publicwire payload (sync + async, includingFalsesurviving the None-filter), status mutual-exclusion withis_public, transport-error wrapping (sync + async, including blank-stringifying timeout), lazy-chat construction and close-without-use.Release ordering
yutori-mcp pins
yutori>=0.8.0and consumes all three changes (is_publicedit,APIConnectionErrormapping, per-call client cost). Sequence: deploy yutori-ai/yutori#10031 → publish this as 0.8.0 → release yutori-mcp.🤖 Generated with Claude Code
Note
Low Risk
Additive SDK API and error-type changes with tests; no auth or server logic changes, though callers may need to catch APIConnectionError for network failures.
Overview
Release 0.8.0 bumps package and installer version strings; API docs now list
is_publiconscouts.update.Scout visibility: Sync and async
scouts.update()acceptis_public, wired through the shared payload builder so PATCH can change public/private after create (includingFalse, which is not dropped asNone). Combiningstatuswithis_publicstill raises the existing mutual-exclusionValueError.Transport errors: Shared sync/async
_requestpaths catchhttpx.HTTPErrorand raise exportedAPIConnectionErrorwith a message that always includes the httpx exception type (avoids blank messages from errors likeReadTimeout("")).Client lifecycle:
YutoriClient/AsyncYutoriClientdefer building thechatnamespace (OpenAI client) until first access;close()usestry/finallyso a built chat client is released even if the main HTTP client close fails.Reviewed by Cursor Bugbot for commit ba91ec6. Bugbot is set up for automated code reviews on this repo. Configure here.