refactor: introduce AgentCliGenerator base to unify CLI generator handling#415
Open
omkargaikwad23 wants to merge 4 commits into
Open
refactor: introduce AgentCliGenerator base to unify CLI generator handling#415omkargaikwad23 wants to merge 4 commits into
omkargaikwad23 wants to merge 4 commits into
Conversation
…face for CLI-driven models and simplify AgentEvaluator logic
Collaborator
|
/gcbrun |
Collaborator
|
Please manually test against docker and attach results here. |
prernakakkar-google
requested changes
Jun 5, 2026
IsmailMehdi
reviewed
Jun 5, 2026
IsmailMehdi
previously approved these changes
Jun 5, 2026
IsmailMehdi
approved these changes
Jun 5, 2026
Collaborator
Author
|
/gcbrun |
Collaborator
Author
|
/gcbrun |
Collaborator
Author
Added. Please check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AgentCliGeneratorbase class (ABC) that the four CLI generators(gemini_cli, claude_code, codex_cli, agy_cli) now inherit from, declaring
the shared interface:
version,create_command,safe_generate,parse_response,extract_tools,extract_skills.create_commandto one signature across all four generators so theevaluator no longer branches on concrete type.
AgentEvaluator: collapse the fourisinstance(...4-tuple...)checks to a single
isinstance(self.generator, AgentCliGenerator), replacethe per-type version chain with
self.generator.version, and drop allconcrete CLI imports.
Why
Each new CLI generator previously required edits at ~6 sites in the evaluator.
Keying off the base class makes adding a generator zero-touch in the evaluator,
and the ABC enforces the interface at instantiation.
Test plan
pytest test/agy_cli_test.py test/gemini_cli_test.py— 52 passedagentevaluator.pyimports cleanly, no concrete CLI references