Skip to content

feat(sdk): unify SDK import paths for consistency#2372

Merged
jezekra1 merged 1 commit intomainfrom
unify-sdk-import-paths
Mar 12, 2026
Merged

feat(sdk): unify SDK import paths for consistency#2372
jezekra1 merged 1 commit intomainfrom
unify-sdk-import-paths

Conversation

@jezekra1
Copy link
Collaborator

@jezekra1 jezekra1 commented Mar 11, 2026

Summary

  • Standardized all user-facing extension imports to use the top-level path from agentstack_sdk.a2a.extensions import X instead of deep submodule paths (.auth.secrets, .services.llm, .ui.canvas, .common.form, etc.)
  • Enhanced extensions/__init__.py to also re-export common.form symbols (TextField, FormRender, OptionItem, etc.) at the top level
  • Updated 109 files across docs, examples, agents, skills, and e2e tests

This prevents AI agents from hallucinating import paths by extrapolating patterns from inconsistent deep imports (e.g., seeing agentstack_sdk.a2a.extensions.auth.secrets and incorrectly guessing agentstack_sdk.a2a.extensions.services.llm as a deep path).

Internal SDK code retains deep imports (implementation detail). Server and platform imports are unchanged.

  • No Docs Needed

Test plan

  • mise run check passes with 0 errors
  • SDK imports verified (no circular import issues)
  • Verify e2e tests pass

🤖 Generated with Claude Code

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 11, 2026
@JanPokorny JanPokorny added the e2e-examples Trigger e2e example tests on PR label Mar 11, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 11, 2026
@jezekra1 jezekra1 force-pushed the unify-sdk-import-paths branch from 7964bd7 to 6a8df28 Compare March 11, 2026 12:22
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the import structure within the SDK to enhance consistency and predictability for user-facing extensions. By centralizing imports under a single top-level path, the change aims to streamline development and mitigate issues where AI agents might infer incorrect module locations due to varied import patterns. The update impacts a wide range of files, ensuring a uniform approach to accessing SDK functionalities.

Highlights

  • Unified SDK Import Paths: Standardized all user-facing extension imports to use the top-level path 'from agentstack_sdk.a2a.extensions import X', eliminating deep submodule paths like '.auth.secrets' or '.services.llm'.
  • Enhanced Extension Re-exports: The 'extensions/init.py' file was updated to re-export 'common.form' symbols (e.g., 'TextField', 'FormRender') at the top level, making them directly accessible from 'agentstack_sdk.a2a.extensions'.
  • Broad Impact: A total of 109 files were updated across documentation, examples, agents, skills, and end-to-end tests to reflect these new import conventions.
  • AI Agent Hallucination Prevention: This change aims to prevent AI agents from 'hallucinating' incorrect import paths by providing a consistent and simplified import structure.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • agents/chat/src/chat/agent.py
    • Consolidated platform service extension imports into the top-level extensions module.
    • Simplified a2a.types import statement.
  • agents/deepagents_content_builder/src/content_builder/utils.py
    • Simplified a2a.types import statement.
  • agents/form/src/form/agent.py
    • Consolidated common form and form service extension imports into the top-level extensions module.
  • agents/rag/src/rag/agent.py
    • Consolidated platform API extension imports into the top-level extensions module.
    • Reformatted vector store helper imports for improved readability.
  • agents/rag/src/rag/helpers/trajectory.py
    • Consolidated UI trajectory extension imports into the top-level extensions module.
  • agents/rag/src/rag/helpers/vectore_store.py
    • Consolidated platform vector store imports into the top-level platform module.
    • Reformatted tenacity imports for improved readability.
  • agents/rag/src/rag/tools/files/file_reader.py
    • Simplified beeai_framework.tools imports.
  • agents/rag/src/rag/tools/general/act.py
    • Simplified beeai_framework.agents.requirement imports.
  • agents/rag/src/rag/tools/general/clarification.py
    • Simplified beeai_framework.agents.requirement and beeai_framework.tools imports.
  • apps/agentstack-sdk-py/examples/agent.py
    • Consolidated LLM service extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/artifacts.py
    • Consolidated UI canvas extension imports into the top-level extensions module.
    • Simplified conditional requirement imports.
  • apps/agentstack-sdk-py/examples/canvas_ui_code_agent.py
    • Consolidated UI canvas extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/canvas_ui_test_agent.py
    • Consolidated UI canvas extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/citation_agent.py
    • Consolidated citation extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/citation_agent_artifact.py
    • Consolidated citation extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/connector_management.py
    • Consolidated platform connector imports into the top-level platform module.
  • apps/agentstack-sdk-py/examples/connectors_agent.py
    • Consolidated MCP service and platform API extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/connectors_client.py
    • Consolidated platform API extension imports into the top-level extensions module.
    • Consolidated platform client imports into the top-level platform module.
  • apps/agentstack-sdk-py/examples/dependencies.py
    • Consolidated platform API and UI trajectory extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/error_agent.py
    • Consolidated UI error extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/form_agent.py
    • Consolidated common form and form service extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/form_request_agent.py
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/github_mcp_agent.py
    • Consolidated MCP service extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/history_framework.py
    • Consolidated LLM service extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/mcp_agent.py
    • Consolidated OAuth, MCP service, and tool call extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/mcp_client.py
    • Consolidated tool call extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/oauth.py
    • Consolidated OAuth extension imports into the top-level extensions module.
    • Reformatted streamable HTTP client import for improved readability.
    • Simplified conditional requirement imports.
  • apps/agentstack-sdk-py/examples/secrets_agent.py
    • Consolidated authentication secrets extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/settings_agent_legacy.py
    • Consolidated UI settings extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/tool_call_approval_agent.py
    • Consolidated interactions approval extension imports into the top-level extensions module.
    • Reformatted streamable HTTP client import for improved readability.
  • apps/agentstack-sdk-py/examples/tool_call_approval_client.py
    • Consolidated interactions approval extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/examples/trajectory_agent.py
    • Consolidated trajectory extension imports into the top-level extensions module.
  • apps/agentstack-sdk-py/src/agentstack_sdk/a2a/extensions/init.py
    • Added re-export of common form symbols.
  • apps/agentstack-server/tests/e2e/agents/test_agent_builds.py
    • Simplified a2a.types import statement.
  • apps/agentstack-server/tests/e2e/agents/test_agent_starts.py
    • Consolidated LLM fulfillment and service extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/agents/test_context_store.py
    • Consolidated platform API extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/agents/test_platform_extensions.py
    • Consolidated platform API extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/agent-settings/test_basic_settings.py
    • Consolidated common form imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/canvas/test_canvas_with_llm.py
    • Consolidated UI canvas extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/error/test_adding_error_context.py
    • Consolidated UI error extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/error/test_advanced_error_reporting.py
    • Consolidated UI error extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/error/test_multiple_errors_handling.py
    • Consolidated UI error extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/files/test_file_processing.py
    • Consolidated platform API extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/forms/test_dynamic_form_requests.py
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/forms/test_initial_form_rendering.py
    • Consolidated common form imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/llm-proxy-service/test_llm_access.py
    • Consolidated LLM fulfillment and service extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/mcp/test_custom_mcp_client_with_oauth.py
    • Consolidated OAuth extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/mcp/test_github_mcp_agent.py
    • Consolidated MCP fulfillment and service extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/multi-turn/test_advanced_history.py
    • Consolidated LLM fulfillment and service extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/overview/test_advanced_server_wrapper.py
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/overview/test_dependency_injection.py
    • Consolidated LLM fulfillment and service extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/rag/test_conversation_rag_agent.py
    • Consolidated platform API extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/rag/test_simple_rag_agent.py
    • Consolidated platform API extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/secrets/test_basic_secrets.py
    • Consolidated authentication secrets extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/examples/agent-integration/tool-calls/test_basic_approve.py
    • Consolidated approval extension imports into the top-level extensions module.
  • apps/agentstack-server/tests/e2e/routes/test_a2a_proxy.py
    • Simplified a2a.server.apps imports.
    • Simplified starlette.authentication imports.
  • apps/agentstack-server/tests/e2e/routes/test_files.py
    • Consolidated platform client and file imports into the top-level platform module.
  • apps/agentstack-server/tests/e2e/routes/test_user.py
    • Consolidated platform user imports into the top-level platform module.
  • apps/agentstack-server/tests/e2e/routes/test_vector_stores.py
    • Consolidated platform vector store imports into the top-level platform module.
  • apps/agentstack-server/tests/e2e/sdk/test_connectors_sdk.py
    • Consolidated platform client and connector imports into the top-level platform module.
  • docs/development/agent-integration/agent-settings.mdx
    • Consolidated common form and form service extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for form fields and extensions.
  • docs/development/agent-integration/canvas.mdx
    • Consolidated UI canvas extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for canvas extensions.
  • docs/development/agent-integration/citations.mdx
    • Consolidated citation extension imports into the top-level extensions module.
  • docs/development/agent-integration/env-variables.mdx
    • Consolidated UI agent detail imports into the top-level extensions module.
  • docs/development/agent-integration/error.mdx
    • Consolidated UI error extension imports into the top-level extensions module.
  • docs/development/agent-integration/files.mdx
    • Consolidated platform API extension imports into the top-level extensions module.
  • docs/development/agent-integration/forms.mdx
    • Consolidated common form, form service, and UI form request extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for form components and extensions.
  • docs/development/agent-integration/mcp.mdx
    • Consolidated platform connector, MCP service, and OAuth extension imports into their respective top-level modules.
    • Updated documentation to reflect new import paths for MCP service and OAuth extensions.
  • docs/development/agent-integration/multi-turn.mdx
    • Consolidated LLM service extension imports into the top-level extensions module.
    • Simplified conditional requirement imports.
  • docs/development/agent-integration/overview.mdx
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
  • docs/development/agent-integration/secrets.mdx
    • Consolidated authentication secrets extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for secrets extensions.
  • docs/development/agent-integration/tool-calls.mdx
    • Consolidated a2a.types and interactions approval extension imports into their respective top-level modules.
    • Updated documentation to reflect new import paths for approval extensions.
  • docs/development/community/acp-a2a-migration-guide.mdx
    • Consolidated platform API extension imports into the top-level extensions module.
  • docs/development/custom-ui/permissions-and-tokens.mdx
    • Consolidated platform API extension imports into the top-level extensions module.
  • docs/development/experimental/connectors.mdx
    • Consolidated platform connector imports into the top-level platform module.
  • docs/development/introduction/welcome.mdx
    • Simplified a2a.types import statement.
  • docs/stable/agent-integration/agent-settings.mdx
    • Consolidated UI settings extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for settings extensions and fields.
  • docs/stable/agent-integration/canvas.mdx
    • Consolidated UI canvas extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for canvas extensions.
  • docs/stable/agent-integration/citations.mdx
    • Consolidated citation extension imports into the top-level extensions module.
  • docs/stable/agent-integration/env-variables.mdx
    • Consolidated UI agent detail imports into the top-level extensions module.
  • docs/stable/agent-integration/error.mdx
    • Consolidated UI error extension imports into the top-level extensions module.
  • docs/stable/agent-integration/files.mdx
    • Consolidated platform API extension imports into the top-level extensions module.
  • docs/stable/agent-integration/forms.mdx
    • Consolidated common form, form service, and UI form request extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for form components and extensions.
  • docs/stable/agent-integration/mcp.mdx
    • Consolidated MCP service and OAuth extension imports into the top-level extensions module.
  • docs/stable/agent-integration/multi-turn.mdx
    • Consolidated LLM service extension imports into the top-level extensions module.
  • docs/stable/agent-integration/overview.mdx
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
    • Consolidated LLM service extension imports into the top-level extensions module.
  • docs/stable/agent-integration/secrets.mdx
    • Consolidated authentication secrets extension imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for secrets extensions.
  • docs/stable/agent-integration/tool-calls.mdx
    • Consolidated interactions approval and tool exceptions imports into the top-level extensions module.
    • Updated documentation to reflect new import paths for approval extensions.
  • docs/stable/community/acp-a2a-migration-guide.mdx
    • Consolidated platform API extension imports into the top-level extensions module.
  • docs/stable/custom-ui/permissions-and-tokens.mdx
    • Consolidated platform API extension imports into the top-level extensions module.
  • docs/stable/experimental/connectors.mdx
    • Consolidated platform connector imports into the top-level platform module.
  • docs/stable/introduction/welcome.mdx
    • Simplified a2a.types import statement.
  • examples/agent-integration/agent-settings/basic-settings/src/basic_settings/agent.py
    • Consolidated common form and form service extension imports into the top-level extensions module.
  • examples/agent-integration/canvas/canvas-with-llm/src/canvas_with_llm/agent.py
    • Consolidated UI canvas extension imports into the top-level extensions module.
  • examples/agent-integration/citations/citation-basic-usage/src/citation_basic_usage/agent.py
    • Consolidated citation extension imports into the top-level extensions module.
  • examples/agent-integration/env-variables/basic-environment-variables/src/basic_environment_variables/agent.py
    • Consolidated UI agent detail imports into the top-level extensions module.
  • examples/agent-integration/error/adding-error-context/src/adding_error_context/agent.py
    • Consolidated UI error extension imports into the top-level extensions module.
  • examples/agent-integration/error/advanced-error-reporting/src/advanced_error_reporting/agent.py
    • Consolidated UI error extension imports into the top-level extensions module.
  • examples/agent-integration/files/file-processing/src/file_processing/agent.py
    • Consolidated platform API extension imports into the top-level extensions module.
  • examples/agent-integration/forms/dynamic-form-requests/src/dynamic_form_requests/agent.py
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
  • examples/agent-integration/forms/initial-form-rendering/src/initial_form_rendering/agent.py
    • Consolidated common form and form service extension imports into the top-level extensions module.
  • examples/agent-integration/mcp/custom-mcp-client-with-oauth/src/custom_mcp_client_with_oauth/agent.py
    • Consolidated OAuth extension imports into the top-level extensions module.
  • examples/agent-integration/mcp/github-mcp-agent/src/github_mcp_agent/agent.py
    • Consolidated MCP service extension imports into the top-level extensions module.
  • examples/agent-integration/multi-turn/advanced-history/src/advanced_history/agent.py
    • Consolidated LLM service extension imports into the top-level extensions module.
    • Simplified conditional requirement imports.
  • examples/agent-integration/overview/advanced-server-wrapper/src/advanced_server_wrapper/agent.py
    • Consolidated common form and UI form request extension imports into the top-level extensions module.
  • examples/agent-integration/secrets/basic-secrets/src/basic_secrets/agent.py
    • Consolidated authentication secrets extension imports into the top-level extensions module.
  • examples/agent-integration/tool-calls/basic-approve/src/basic_approve/agent.py
    • Consolidated a2a.types and interactions approval extension imports into their respective top-level modules.
  • skills/agentstack-wrapper/references/files.md
    • Updated documentation to reflect new import paths for FileField.
    • Consolidated common form, form service, platform service, and platform file imports into their respective top-level modules.
  • skills/agentstack-wrapper/references/trajectory.md
    • Updated documentation to reflect new import paths for trajectory extensions.
Activity
  • The pull request was created by jezekra1.
  • The mise run check command passed with no errors.
  • SDK imports were verified, confirming no circular import issues.
  • End-to-end tests require verification.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a large-scale refactoring that unifies SDK import paths for consistency across the entire codebase. The changes standardize user-facing extension imports to use top-level paths, which improves code clarity and maintainability. The updates have been applied consistently across numerous files, including agents, examples, tests, and documentation. The core changes in the __init__.py files correctly re-export symbols from submodules to make this unification possible. I have reviewed the changes and they appear correct and well-executed. I did not find any issues with medium or higher severity.

Note: Security Review did not run due to the size of the PR.

Standardize all user-facing extension imports to use the top-level path:
- `from agentstack_sdk.a2a.extensions import X` (instead of deep submodule paths
  like .auth.secrets, .services.llm, .ui.canvas, .common.form, etc.)

Enhanced extensions/__init__.py to also re-export common.form symbols
(TextField, FormRender, OptionItem, etc.) at the top level.

This prevents AI agents from hallucinating import paths by extrapolating
patterns from inconsistent deep imports (e.g. seeing auth.secrets and
guessing services.llm as a deep path).

Updated docs/development, examples, agents, skills, and e2e tests.
docs/stable left unchanged (already deployed).
Internal SDK code retains deep imports (implementation detail).

Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
@jezekra1 jezekra1 force-pushed the unify-sdk-import-paths branch from 6a8df28 to 16d9d4e Compare March 11, 2026 12:52
@jezekra1 jezekra1 merged commit 9e21364 into main Mar 12, 2026
24 of 25 checks passed
@jezekra1 jezekra1 deleted the unify-sdk-import-paths branch March 12, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-examples Trigger e2e example tests on PR lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants