skip standalone runner init when --openaiurl is provided#842
Open
ericcurtin wants to merge 1 commit intomainfrom
Open
skip standalone runner init when --openaiurl is provided#842ericcurtin wants to merge 1 commit intomainfrom
ericcurtin wants to merge 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="cmd/cli/commands/install-runner.go" line_range="192" />
<code_context>
+ // Skip standalone runner initialization when --openaiurl is provided,
+ // since those commands talk directly to an external endpoint and don't
+ // need (or have) a local Docker daemon.
+ if f := cmd.Flags().Lookup("openaiurl"); f == nil || f.Value.String() == "" {
+ if _, err := ensureStandaloneRunnerAvailable(cmd.Context(), asPrinter(cmd), false); err != nil {
+ return fmt.Errorf("unable to initialize standalone model runner: %w", err)
</code_context>
<issue_to_address>
**issue (bug_risk):** Use cmd.Flag("openaiurl") to correctly handle inherited/persistent flags.
`cmd.Flags().Lookup("openaiurl")` only inspects this command’s local flags. If `--openaiurl` is defined as a persistent/inherited flag on a parent command, it won’t be found and `f` will be `nil`, so the standalone runner is incorrectly initialized even when the flag is set. Using `cmd.Flag("openaiurl")` ensures local, persistent, and inherited flags are all respected for this option.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies the standalone runner initialization logic in cmd/cli/commands/install-runner.go to skip the initialization process when the --openaiurl flag is provided, as these commands interact directly with external endpoints and do not require a local Docker daemon. I have no feedback to provide as there are no review comments to address.
Commands wrapped with withStandaloneRunner were unconditionally calling ensureStandaloneRunnerAvailable before RunE executed, causing a Docker socket connection attempt even when --openaiurl was supplied and no local daemon is needed. Check for the openaiurl flag in the wrapper and bypass runner initialization when it is set. Signed-off-by: Eric Curtin <eric.curtin@docker.com>
doringeman
approved these changes
Apr 6, 2026
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.
Commands wrapped with withStandaloneRunner were unconditionally calling ensureStandaloneRunnerAvailable before RunE executed, causing a Docker socket connection attempt even when --openaiurl was supplied and no local daemon is needed.
Check for the openaiurl flag in the wrapper and bypass runner initialization when it is set.