From 9829c4de0262e443493ebb29c7cae00d57bfbdfc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:45:31 +0000 Subject: [PATCH 1/3] Initial plan From accee9e9b9b1cd1829678e1dcb6f086f2e21dfc9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:49:19 +0000 Subject: [PATCH 2/3] plan: fix non-deterministic map iteration in EngineRegistry Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/changeset.lock.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/changeset.lock.yml b/.github/workflows/changeset.lock.yml index 76909e87f0c..94628e3294c 100644 --- a/.github/workflows/changeset.lock.yml +++ b/.github/workflows/changeset.lock.yml @@ -981,8 +981,6 @@ jobs: GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} GH_AW_CODE_PUSH_FAILURE_ERRORS: ${{ needs.safe_outputs.outputs.code_push_failure_errors }} GH_AW_CODE_PUSH_FAILURE_COUNT: ${{ needs.safe_outputs.outputs.code_push_failure_count }} - GH_AW_SAFE_OUTPUTS_APP_TOKEN_MINTING_FAILED: ${{ needs.safe_outputs.outputs.app_token_minting_failed }} - GH_AW_CONCLUSION_APP_TOKEN_MINTING_FAILED: ${{ steps.safe-outputs-app-token.outcome == 'failure' }} GH_AW_GROUP_REPORTS: "false" GH_AW_FAILURE_REPORT_AS_ISSUE: "true" GH_AW_TIMEOUT_MINUTES: "20" @@ -1064,7 +1062,6 @@ jobs: GH_AW_WORKFLOW_ID: "changeset" GH_AW_WORKFLOW_NAME: "Changeset Generator" outputs: - app_token_minting_failed: ${{ steps.safe-outputs-app-token.outcome == 'failure' }} code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }} code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }} create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }} From 04e823866057ae998e7b6de976be60329ca721e6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 23:54:54 +0000 Subject: [PATCH 3/3] fix: deterministic map iteration in EngineRegistry GetSupportedEngines and GetEngineByPrefix Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/agentic_engine.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/workflow/agentic_engine.go b/pkg/workflow/agentic_engine.go index 46638c2a3d6..97632134d12 100644 --- a/pkg/workflow/agentic_engine.go +++ b/pkg/workflow/agentic_engine.go @@ -2,6 +2,7 @@ package workflow import ( "fmt" + "sort" "strings" "sync" @@ -461,6 +462,7 @@ func (r *EngineRegistry) GetSupportedEngines() []string { for id := range r.engines { engines = append(engines, id) } + sort.Strings(engines) return engines } @@ -478,10 +480,19 @@ func (r *EngineRegistry) GetDefaultEngine() CodingAgentEngine { // GetEngineByPrefix returns an engine that matches the given prefix // This is useful for backward compatibility with strings like "codex-experimental" func (r *EngineRegistry) GetEngineByPrefix(prefix string) (CodingAgentEngine, error) { + type engineCandidate struct { + id string + engine CodingAgentEngine + } + var candidates []engineCandidate for id, engine := range r.engines { if strings.HasPrefix(prefix, id) { - return engine, nil + candidates = append(candidates, engineCandidate{id, engine}) } } - return nil, fmt.Errorf("no engine found matching prefix: %s", prefix) + if len(candidates) == 0 { + return nil, fmt.Errorf("no engine found matching prefix: %s", prefix) + } + sort.Slice(candidates, func(i, j int) bool { return candidates[i].id < candidates[j].id }) + return candidates[0].engine, nil }