Skip to content

fix: replace raw string type literals with protocol.Type* constants in mixed-mode chat#3844

Merged
clubanderson merged 1 commit intomainfrom
fix/issue-3832-mixed-mode-protocol-constants
Mar 29, 2026
Merged

fix: replace raw string type literals with protocol.Type* constants in mixed-mode chat#3844
clubanderson merged 1 commit intomainfrom
fix/issue-3832-mixed-mode-protocol-constants

Conversation

@clubanderson
Copy link
Copy Markdown
Collaborator

Closes #3832

Summary

  • Added four new protocol.MessageType constants to pkg/agent/protocol/messages.go: TypeStreamChunk, TypeStreamEnd, TypeMixedModeThinking, and TypeMixedModeExecuting
  • Replaced all 9 bare string literals ("stream_chunk", "stream_end", "mixed_mode_thinking", "mixed_mode_executing") in handleMixedModeChat with the corresponding protocol.Type* constants

Test plan

  • go build ./... passes
  • Verify mixed-mode chat still works end-to-end (message types are unchanged at the wire level since the constants resolve to the same string values)

Generated with Claude Code

…n handleMixedModeChat (#3832)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 29, 2026 05:47
@kubestellar-prow kubestellar-prow bot added the dco-signoff: no Indicates the PR's author has not signed the DCO. label Mar 29, 2026
@kubestellar-prow
Copy link
Copy Markdown
Contributor

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@kubestellar-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@clubanderson clubanderson merged commit 088f743 into main Mar 29, 2026
14 of 15 checks passed
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 29, 2026

Deploy Preview for kubestellarconsole canceled.

Name Link
🔨 Latest commit 511e1a0
🔍 Latest deploy log https://app.netlify.com/projects/kubestellarconsole/deploys/69c8bcfa21735500082158bf

@kubestellar-prow kubestellar-prow bot deleted the fix/issue-3832-mixed-mode-protocol-constants branch March 29, 2026 05:47
@github-actions
Copy link
Copy Markdown
Contributor

👋 Hey @clubanderson — thanks for opening this PR!

🤖 This project is developed exclusively using AI coding assistants.

Please do not attempt to code anything for this project manually.
All contributions should be authored using an AI coding tool such as:

This ensures consistency in code style, architecture patterns, test coverage,
and commit quality across the entire codebase.


This is an automated message.

@kubestellar-prow kubestellar-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes mixed-mode chat WebSocket message typing by replacing raw string type literals with shared protocol.MessageType constants, reducing the risk of silent protocol drift between layers.

Changes:

  • Added protocol.TypeStreamChunk, protocol.TypeStreamEnd, protocol.TypeMixedModeThinking, and protocol.TypeMixedModeExecuting.
  • Updated handleMixedModeChat to use the new protocol.Type* constants instead of bare string literals.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/agent/server.go Replaces mixed-mode WebSocket message Type fields from raw strings to protocol.Type* constants.
pkg/agent/protocol/messages.go Introduces new MessageType constants for mixed-mode phases and stream chunk/end events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: no Indicates the PR's author has not signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mixed-mode chat uses raw string type literals

2 participants