Skip to content

fix(agents): make invocations_ws protocol priority order-independent in loadServiceProtocol#9189

Closed
v1212 with Copilot wants to merge 28 commits into
mainfrom
copilot/fix-review-comment-9009
Closed

fix(agents): make invocations_ws protocol priority order-independent in loadServiceProtocol#9189
v1212 with Copilot wants to merge 28 commits into
mainfrom
copilot/fix-review-comment-9009

Conversation

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

loadServiceProtocol returned invocations_ws immediately on match, making protocol selection order-dependent: --protocol invocations_ws --protocol responses classified the agent as WebSocket-only (suppressing invoke hints), while the reversed order correctly returned responses.

Changes

  • nextstep/state.go: Replace the early return ProtocolInvocationsWS with a sawInvocationsWS tracking variable (mirroring the existing sawInvocations pattern). Priority is now order-independent: responses > invocations > invocations_ws. Updated doc comment to reflect the full priority chain.

  • nextstep/state_test.go: Two regression cases covering the reversed-order scenarios:

    • invocations_ws declared before responses → still returns responses
    • invocations_ws declared before invocations → still returns invocations
// Before — order-dependent
case ProtocolInvocationsWS:
    return ProtocolInvocationsWS  // wins if listed first

// After — order-independent
case ProtocolInvocationsWS:
    sawInvocationsWS = true       // only wins if no azd-invocable protocol present

@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.

Copilot AI and others added 2 commits July 17, 2026 08:51
Co-authored-by: v1212 <49907914+v1212@users.noreply.github.com>
Co-authored-by: v1212 <49907914+v1212@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code based on review comment 9009 fix(agents): make invocations_ws protocol priority order-independent in loadServiceProtocol Jul 17, 2026
Copilot finished work on behalf of v1212 July 17, 2026 08:56
Copilot AI requested a review from v1212 July 17, 2026 08:56
@v1212 v1212 closed this Jul 21, 2026
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