Skip to content

[Agents Extension] Adding a new "init from code" flow - #6828

Merged
trangevi merged 38 commits into
mainfrom
trangevi/init-from-code
Feb 24, 2026
Merged

[Agents Extension] Adding a new "init from code" flow#6828
trangevi merged 38 commits into
mainfrom
trangevi/init-from-code

Conversation

@trangevi

Copy link
Copy Markdown
Member

This will allow for a more basic starting experience. A user won't need to already have an AZD environment/project, won't need to reference a template, and won't need to provide a manifest. Running the base command from where a users code is will walk them through the initial setup of everything they need.

Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Copilot AI review requested due to automatic review settings February 20, 2026 21:33

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

@trangevi I've opened a new pull request, #6829, to work on those changes. Once the pull request is ready, I'll request review from you.

Signed-off-by: trangevi <trangevi@microsoft.com>

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

@trangevi I've opened a new pull request, #6830, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

@trangevi I've opened a new pull request, #6831, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits February 20, 2026 14:35
…6829)

* Initial plan

* Replace containsString/searchString with strings.Contains in test file

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unrelated go.mod/go.sum changes

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
…load (#6830)

* Initial plan

* Use filepath.Clean() for path validation to prevent path traversal attacks

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* Revert unrelated go.mod/go.sum changes

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

Copilot AI commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

@trangevi I've opened a new pull request, #6839, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* fix: capture error from loadAiCatalog in selectNewModel

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* fix: revert go.mod/go.sum changes and add user-facing error message for loadAiCatalog failure

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

* fix: remove fmt.Printf from loadAiCatalog error path

Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>

@spboyer spboyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Three issues found:

  1. Hardcoded personal branch in runtime code (High)
    init_from_code.go:520 scaffolds from branch trangevi/existing-acr instead of main or a stable tag. If that branch is deleted/renamed/force-pushed, azd init will fail for all users. Use a stable reference.

  2. Nil pointer panic when ACR selection prompt fails (High)
    In the multi-ACR path, if Prompt().Select() returns an error, code logs but continues. selectedConnection remains nil, then selectedConnection.Name/Target are dereferenced unconditionally, causing a panic. Return the prompt error or guard against nil.

  3. Response bodies deferred inside loop (Medium)
    defer fileResp.Body.Close() inside a loop downloading many files. Bodies are not closed until function return, causing excess memory/socket usage. Close each body immediately after reading instead of deferring.

Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Comment thread cli/azd/extensions/azure.ai.agents/internal/cmd/init_from_code.go
Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi
trangevi enabled auto-merge (squash) February 24, 2026 17:41
@trangevi
trangevi merged commit aefd9c8 into main Feb 24, 2026
19 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.

7 participants