Skip to content

Python a2ui_agent: Refactor a2ui_agent to depend on a2ui_core#1582

Merged
gspencergoog merged 5 commits into
a2ui-project:mainfrom
nan-yu:re-arch-9-agent
Jun 13, 2026
Merged

Python a2ui_agent: Refactor a2ui_agent to depend on a2ui_core#1582
gspencergoog merged 5 commits into
a2ui-project:mainfrom
nan-yu:re-arch-9-agent

Conversation

@nan-yu

@nan-yu nan-yu commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Description

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. For larger changes, raising an issue first helps reduce redundant work.

Pre-launch Checklist

If you need help, consider asking for advice on the discussion board.

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

Copy link
Copy Markdown
Contributor

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 introduces the a2ui_core Python library, which implements core state management, rendering, message processing, and schema validation for the A2UI v0.9+ specification. Key feedback highlights several critical issues and improvement opportunities: a NameError in model_catalog.py due to an undefined variable, incomplete TR35 date token formatting in function_impls.py, redundant subscriptions for TemplateChildList in generic_binder.py, an inefficient list expansion loop in data_model.py that could trigger OOM errors, silent acceptance of unclosed string literals in expression_parser.py, and a potential AttributeError in data_context.py when handling malformed action events.

Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/catalog/model_catalog.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/basic_catalog/function_impls.py Outdated
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/state/data_model.py
Comment thread agent_sdks/python/a2ui_core/src/a2ui/core/rendering/data_context.py
@nan-yu nan-yu force-pushed the re-arch-9-agent branch 2 times, most recently from dee8acb to 2139170 Compare June 12, 2026 00:49
@nan-yu nan-yu requested a review from jacobsimionato June 12, 2026 00:53

@jacobsimionato jacobsimionato left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like this PR goes a long way to removing logic from the existing agent SDK and having it depend on core instead which is great.

Do you plan to keep tweaking it after this? I think it might be possible to do some more cleanups and deduplication! But this seems like a big step towards the architecture we want, and it's nice that it seems like all the existing APIs are preserved.

custom_cuttable_keys: Optional[frozenset[str]] = None

@classmethod
def from_path(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if this class should be replaced with the new Catalog object from Core, or a function that returns a Catalog object (to defer async file system loads if necessary). That way, Catalog is the once source of truth, and developers can create them from a JSON file, or programmatically.

I think a workflow that is critical is to define a Catalog programmatically from a set of components and functions, and then use the Schema manager etc to create a prompt from it and parse the results. Right now, it seems like we're using the new Catalog abstraction for validation, but it's not yet possible to start with a Catalog object and then generate prompts from it. Ideally, the core Catalog representation should be the source of truth for the whole app.

This can be done in a future PR!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, the catalog class can be further refactored to depend more on the Core catalog. I'll follow up.



@dataclass(frozen=True)
class A2uiCatalog:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe we can rename this to InferenceCatalog or something at some point? And I think it should be instantiated from a Catalog!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The renaming will be a breaking change. I'll wait until I'm back to start the migration ball.

@nan-yu nan-yu force-pushed the re-arch-9-agent branch 2 times, most recently from 687e251 to bd3d661 Compare June 12, 2026 22:03
@nan-yu nan-yu force-pushed the re-arch-9-agent branch from bd3d661 to 1446399 Compare June 13, 2026 01:26
@gspencergoog gspencergoog merged commit d8af0c5 into a2ui-project:main Jun 13, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Jun 13, 2026
@nan-yu nan-yu deleted the re-arch-9-agent branch June 13, 2026 03:45
@gspencergoog

Copy link
Copy Markdown
Collaborator

Looks like this broke the e2e tests. #1648. The evals failure is unrelated, and already fixed. I'll take a look at why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants