From 15c81d08df6ea722c3d114fb1cf19d46bc0bcf52 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Mon, 18 Aug 2025 16:01:10 +0100 Subject: [PATCH] feat: remove automatic STACKONE_ACCOUNT_ID environment variable loading Remove automatic loading of STACKONE_ACCOUNT_ID from environment variables in StackOneToolSet initialization to provide more explicit control over account ID configuration. The account_id parameter now requires explicit provision if needed, improving clarity and preventing unexpected behavior from environment variables. --- CLAUDE.md | 2 +- stackone_ai/toolset.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 96f4806..1bf16e7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -79,7 +79,7 @@ tools = StackOneToolSet(include_tools=["hris_*", "!hris_create_*"]) # Uses environment variables or direct configuration toolset = StackOneToolSet( api_key="your-api-key", # or STACKONE_API_KEY env var - account_id="optional-id" # or STACKONE_ACCOUNT_ID env var + account_id="optional-id" # explicit account ID required ) ``` diff --git a/stackone_ai/toolset.py b/stackone_ai/toolset.py index 4e2c372..1a1cff0 100644 --- a/stackone_ai/toolset.py +++ b/stackone_ai/toolset.py @@ -42,7 +42,7 @@ def __init__( Args: api_key: Optional API key. If not provided, will try to get from STACKONE_API_KEY env var - account_id: Optional account ID. If not provided, will try to get from STACKONE_ACCOUNT_ID env var + account_id: Optional account ID base_url: Optional base URL override for API requests. If not provided, uses the URL from the OAS Raises: @@ -55,7 +55,7 @@ def __init__( "STACKONE_API_KEY environment variable" ) self.api_key: str = api_key_value - self.account_id = account_id or os.getenv("STACKONE_ACCOUNT_ID") + self.account_id = account_id self.base_url = base_url def _parse_parameters(self, parameters: list[dict[str, Any]]) -> dict[str, dict[str, str]]: