Skip to content

Conversation

@jezekra1
Copy link
Collaborator

@jezekra1 jezekra1 commented Jan 6, 2026

Summary

Linked Issues

Documentation

  • No Docs Needed:

If this PR adds new feature or changes existing. Make sure documentation is adjusted accordingly. If the docs is not needed, please explain why.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 6, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jezekra1, 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 introduces several small but impactful fixes and enhancements across the Agent Stack CLI and an example agent. The primary focus is on improving the agentstack build command's integration with an internal image registry for better image management and deployment, alongside minor adjustments to an example agent's form data handling and general CLI input processing. These changes aim to make the CLI more robust and user-friendly, particularly for developers working with custom agents and the platform's internal infrastructure.

Highlights

  • CLI Build Process Enhancement: The agentstack build command now integrates with an internal registry, allowing for more robust image management within the Agent Stack platform. This includes re-tagging images and using Kubernetes Jobs with crane for pushing.
  • Improved Agent Form Handling: The FormData model in the agent-form agent has been refined, making the location field mandatory and explicitly defining other optional fields. The agent also now gracefully handles cases where no form data is received.
  • Workspace Configuration Update: The agent-form project has been added to the agentstack.code-workspace file, improving development environment setup.
  • Platform Driver Refinements: The base platform driver now tracks loaded images, and the Lima driver provides a concrete implementation for importing images to the internal registry. The WSL driver explicitly marks this feature as unsupported.
  • CLI Input Simplification: A conditional block for reading sys.stdin in the run_agent command has been removed, streamlining input handling.

🧠 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.

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 introduces several small fixes and improvements to the CLI, particularly around the agent build and run processes. The changes correctly handle form data in the form agent, remove problematic stdin reading, and update the build process to support an internal image registry.

My review includes a few suggestions to improve robustness and maintainability:

  • Reinstating a check for the platform's running state in the build command to provide clearer error messages.
  • Removing duplicated code in the Lima driver.
  • Making exception handling more specific in the Lima driver.

Overall, these are good improvements to the CLI's functionality.

sys.exit(1)
await driver.import_image(tag)

await driver.import_image_to_internal_registry(tag)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The check to ensure the Agent Stack platform is running has been removed. This could lead to cryptic error messages if the platform is not running when driver.import_image_to_internal_registry(tag) is called. It's better to explicitly check the platform status and provide a clear error message to the user, as was done previously. Please add a check like the following before this line:

if (await driver.status()) != "running":
    console.error("Agent Stack platform is not running. Please start it with 'agentstack platform start'.")
    raise typer.Exit(1)

Comment on lines 208 to 209
except Exception:
console.warning("Internal registry service not found. Push might fail.")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Catching a broad Exception is generally not recommended as it can hide unexpected errors. It's better to catch a more specific exception related to command execution failure. If a broad exception is necessary, logging the exception details would be helpful for debugging.

Suggested change
except Exception:
console.warning("Internal registry service not found. Push might fail.")
except Exception as e:
console.warning(f"Internal registry service not found. Push might fail: {e}")

Comment on lines 266 to 281
async def push_to_local_registry(self, tag: str):
image_dir = anyio.Path("/tmp/agentstack")
await image_dir.mkdir(exist_ok=True, parents=True)
image_file = str(uuid.uuid4())
image_path = image_dir / image_file

try:
await run_command(
["docker", "image", "save", "-o", str(image_path), tag], f"Exporting image {tag} from Docker"
)
await self.run_in_vm(
["/bin/sh", "-c", f"k3s ctr images import /tmp/agentstack/{image_file}"],
f"Importing image {tag} into Agent Stack platform",
)
finally:
await image_path.unlink(missing_ok=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The method push_to_local_registry appears to be an exact duplicate of the import_image method defined earlier in this file (lines 183-198). Since it's also unused, it should be removed to avoid code duplication and improve maintainability.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 6, 2026
@jezekra1 jezekra1 merged commit 37e2eb7 into main Jan 6, 2026
10 checks passed
@jezekra1 jezekra1 deleted the small-fixes branch January 6, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants