Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions stackone_ai/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
ToolArgumentsError,
ToolParameters,
ToolsetConfigError,
ToolsetError,
ToolsetLoadError,
)

Expand Down Expand Up @@ -755,7 +754,7 @@ def _describe_mcp_failure(exc: BaseException, endpoint: str, timeout: float) ->
seen.add(id(current))
# Our own errors are already descriptive. They reach here wrapped in an
# ExceptionGroup because they are raised inside the session's TaskGroup.
if isinstance(current, StackOneError | ToolsetError):
if isinstance(current, StackOneError):
return current
if isinstance(current, httpx.HTTPStatusError):
body = _response_body(current.response)
Expand Down
4 changes: 1 addition & 3 deletions stackone_ai/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
ToolMode,
ToolParameters,
ToolsetConfigError,
ToolsetError,
ToolsetLoadError,
)

Expand Down Expand Up @@ -231,7 +230,6 @@ def __init__(
self._account_ids: list[str] = self._validate_account_ids(
execute.get("account_ids") if execute else None
)
self._execute_config: ExecuteToolsConfig | None = execute
execute_timeout = execute.get("timeout") if execute else None
self._timeout: float = (
timeout if timeout is not None else (execute_timeout if execute_timeout is not None else 60.0)
Expand Down Expand Up @@ -398,7 +396,7 @@ def fetch_tools(

return Tools(all_tools)

except (ToolsetError, StackOneError):
except StackOneError:
# StackOneAPIError carries the HTTP status. Re-wrapping it below would throw
# that away, so a caller could not tell a 401 from a 429.
raise
Expand Down
4 changes: 1 addition & 3 deletions tests/test_integrations_pydantic_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def test_tools_to_pydantic_ai_with_agent(sample_tool: StackOneTool, monkeypatch:
def test_toolset_pydantic_ai_default_uses_fetch_tools(sample_tool: StackOneTool):
toolset = StackOneToolSet.__new__(StackOneToolSet)
toolset.fetch_tools = MagicMock(return_value=Tools([sample_tool])) # type: ignore[method-assign]
toolset._execute_config = None # type: ignore[attr-defined]

tools = toolset.pydantic_ai()

Expand All @@ -131,10 +130,9 @@ def test_toolset_pydantic_ai_default_uses_fetch_tools(sample_tool: StackOneTool)
assert tools[0].name == "bamboohr_list_employees"


def test_toolset_pydantic_ai_account_ids_override(sample_tool: StackOneTool):
def test_toolset_pydantic_ai_passes_account_ids_through(sample_tool: StackOneTool):
toolset = StackOneToolSet.__new__(StackOneToolSet)
toolset.fetch_tools = MagicMock(return_value=Tools([sample_tool])) # type: ignore[method-assign]
toolset._execute_config = {"account_ids": ["from-config"]} # type: ignore[attr-defined]

toolset.pydantic_ai(account_ids=["override"])

Expand Down
Loading