Skip to content

Fix docker ai shellout to cagent#1860

Merged
gtardif merged 1 commit intodocker:mainfrom
gtardif:fix_docker_ai_shellout
Feb 26, 2026
Merged

Fix docker ai shellout to cagent#1860
gtardif merged 1 commit intodocker:mainfrom
gtardif:fix_docker_ai_shellout

Conversation

@gtardif
Copy link
Contributor

@gtardif gtardif commented Feb 26, 2026

detect when cagent (standalone invocation) is invoked by a cli plugin, and run cagent standalone, not as a cli plugin

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
@gtardif gtardif requested a review from a team as a code owner February 26, 2026 15:56
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

APPROVED - No issues found.

This PR adds a straightforward fix to detect when cagent is invoked standalone by the Docker AI CLI plugin. The change adds an additional condition rootCmd.Name() == "cagent" to the existing plugin.RunningStandalone() check, which correctly handles the edge case described in the PR description.

The logic is sound:

  • When docker ai shells out to cagent, the environment variables indicate it's running as a plugin, but cagent should still run in standalone mode
  • The OR condition ensures both scenarios are covered
  • No nil pointer risks, logic errors, or other issues identified

The code change is minimal, focused, and achieves the stated goal without introducing new vulnerabilities.

@gtardif gtardif merged commit 449e081 into docker:main Feb 26, 2026
8 checks passed
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