Skip to content

fix(agents): preserve protocol precedence when invocations_ws is declared#9191

Draft
v1212 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-review-comment-again
Draft

fix(agents): preserve protocol precedence when invocations_ws is declared#9191
v1212 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-code-review-comment-again

Conversation

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Addresses review comment r3601387151 on PR #9009: invocations_ws used an early return in loadServiceProtocol, which silently bypassed the invocations precedence check.

Changes

  • nextstep/resolver.go: Add ProtocolInvocationsWS = "invocations_ws" constant
  • nextstep/state.go: Replace early return with sawInvocationsWS flag, mirroring the existing sawInvocations pattern — enforces responses > invocations > invocations_ws priority regardless of declaration order
  • nextstep/state_test.go: Add test cases for invocations_ws alone and for precedence over invocations_ws when combined with responses or invocations
// Before — early return skips invocations check
case ProtocolInvocationsWS:
    return ProtocolInvocationsWS

// After — flag approach preserves precedence
sawInvocationsWS := false
...
case ProtocolInvocationsWS:
    sawInvocationsWS = true
...
if sawInvocations {
    return ProtocolInvocations
}
if sawInvocationsWS {
    return ProtocolInvocationsWS
}

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
20 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: v1212 <49907914+v1212@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code based on review comment fix(agents): preserve protocol precedence when invocations_ws is declared Jul 17, 2026
Copilot finished work on behalf of v1212 July 17, 2026 09:05
Copilot AI requested a review from v1212 July 17, 2026 09:05
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.

2 participants