feat(sdk): unify SDK import paths for consistency#2372
Conversation
7964bd7 to
6a8df28
Compare
Summary of ChangesHello, 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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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>
6a8df28 to
16d9d4e
Compare
Summary
from agentstack_sdk.a2a.extensions import Xinstead of deep submodule paths (.auth.secrets,.services.llm,.ui.canvas,.common.form, etc.)extensions/__init__.pyto also re-exportcommon.formsymbols (TextField,FormRender,OptionItem, etc.) at the top levelThis prevents AI agents from hallucinating import paths by extrapolating patterns from inconsistent deep imports (e.g., seeing
agentstack_sdk.a2a.extensions.auth.secretsand incorrectly guessingagentstack_sdk.a2a.extensions.services.llmas a deep path).Internal SDK code retains deep imports (implementation detail). Server and platform imports are unchanged.
Test plan
mise run checkpasses with 0 errors🤖 Generated with Claude Code