refactor: drop an unused attribute and redundant exception checks

Merged
GL
9d ago
+3-8

What

  • StackOneToolSet._execute_config was assigned in __init__ and never read anywhere (grep -rn _execute_config stackone_ai finds only that line in toolset.py; the other hits are the unrelated StackOneTool._execute_config). Two tests in tests/test_integrations_pydantic_ai.py still assigned it with a type: ignore; those lines set nothing the code reads and are removed too (second commit). account_ids and timeout are still read from the execute argument.
  • ToolsetError subclasses StackOneError (types.py:89), so except (ToolsetError, StackOneError) in toolset.py and isinstance(current, StackOneError | ToolsetError) in tools.py are the same as StackOneError alone. The two ToolsetError imports then go unused (ruff F401).

No behaviour change.

How verified

  • uv run ruff check ., uv run ruff format --check .: clean
  • uv run ty check stackone_ai examples: All checks passed
  • uv run pytest (Python 3.13, MCP mock via pnpm): 871 passed
  • uv run pytest tests/test_integrations_pydantic_ai.py after the test cleanup: 13 passed

Gates (head 5f84c60)

GateResult
Repo skillsnone in repo
/forge:forgeran on ef8dd6d: no change; re-run on 5f84c60: +3 -8, 0 comment lines, 0 copies
Security scansecurity-reviewer agent: no finding at confidence 70 or above. Aikido: 31 open issues on main (lockfile CVEs, workflow SAST, one old test-fixture secret), none on lines this PR changes
Codex securityclean on ef8dd6d (job 284aa7c6) and 5f84c60 (job b2f55e81)
/security-reviewran: secrets, input validation, transport and DoS items clean; the server-side items do not apply to an SDK
/code-reviewmedium on ef8dd6d: no correctness bugs. Fixed 1: the account_ids test is renamed for what it checks (precedence of configured accounts is covered by test_execute_config_account_ids_scope_the_catalog_fetch)
CIgreen on 5f84c60: 10 pass, 3 skipped
Unresolved review threads0

Requested by guillaume@stackone.com in Slack (repo audit thread).

šŸ¤– Generated with Claude Code


Summary by cubic

Removes dead code from the tool classes: StackOneToolSet._execute_config was assigned in __init__ but never read, and exception handling that caught ToolsetError alongside StackOneError was redundant because ToolsetError subclasses StackOneError. The now-unused ToolsetError imports are dropped, and tests no longer assign the removed attribute. No behavior change; ruff, ty, and the full test suite (871 passed) remain clean.