mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: gate chat advisor and virtual desktop behind experiments, delete experiments page (#26809)
This commit is contained in:
+3
-39
@@ -876,23 +876,14 @@ type UpdateUserChatCompactionThresholdRequest struct {
|
||||
ThresholdPercent int32 `json:"threshold_percent" validate:"min=0,max=100"`
|
||||
}
|
||||
|
||||
// ChatDesktopEnabledResponse is the response for getting the desktop setting.
|
||||
type ChatDesktopEnabledResponse struct {
|
||||
EnableDesktop bool `json:"enable_desktop"`
|
||||
}
|
||||
|
||||
// UpdateChatDesktopEnabledRequest is the request to update the desktop setting.
|
||||
type UpdateChatDesktopEnabledRequest struct {
|
||||
EnableDesktop bool `json:"enable_desktop"`
|
||||
}
|
||||
|
||||
// AdvisorConfig is the deployment-wide runtime configuration for the
|
||||
// experimental chat advisor.
|
||||
//
|
||||
// EXPERIMENTAL: this type is experimental and is subject to change.
|
||||
type AdvisorConfig struct {
|
||||
// Enabled toggles the advisor runtime. When false, advisor is not
|
||||
// attached to new chats.
|
||||
// Enabled reflects whether the chat-advisor experiment is active.
|
||||
// The experiment flag is the sole gate; this field is read-only and
|
||||
// always matches the experiment state regardless of the stored DB value.
|
||||
Enabled bool `json:"enabled"`
|
||||
// MaxUsesPerRun caps how many times the advisor can be invoked per
|
||||
// chat run. 0 means unlimited.
|
||||
@@ -2649,33 +2640,6 @@ func (c *ExperimentalClient) GetUserChatCustomPrompt(ctx context.Context) (UserC
|
||||
return resp, json.NewDecoder(res.Body).Decode(&resp)
|
||||
}
|
||||
|
||||
// GetChatDesktopEnabled returns the deployment-wide desktop setting.
|
||||
func (c *ExperimentalClient) GetChatDesktopEnabled(ctx context.Context) (ChatDesktopEnabledResponse, error) {
|
||||
res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/desktop-enabled", nil)
|
||||
if err != nil {
|
||||
return ChatDesktopEnabledResponse{}, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return ChatDesktopEnabledResponse{}, ReadBodyAsError(res)
|
||||
}
|
||||
var resp ChatDesktopEnabledResponse
|
||||
return resp, json.NewDecoder(res.Body).Decode(&resp)
|
||||
}
|
||||
|
||||
// UpdateChatDesktopEnabled updates the deployment-wide desktop setting.
|
||||
func (c *ExperimentalClient) UpdateChatDesktopEnabled(ctx context.Context, req UpdateChatDesktopEnabledRequest) error {
|
||||
res, err := c.Request(ctx, http.MethodPut, "/api/experimental/chats/config/desktop-enabled", req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
if res.StatusCode != http.StatusNoContent {
|
||||
return ReadBodyAsError(res)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetChatAdvisorConfig returns the deployment-wide advisor configuration.
|
||||
func (c *ExperimentalClient) GetChatAdvisorConfig(ctx context.Context) (AdvisorConfig, error) {
|
||||
res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/advisor", nil)
|
||||
|
||||
@@ -5198,6 +5198,8 @@ const (
|
||||
ExperimentMinimumImplicitMember Experiment = "minimum-implicit-member" // Allows organizations to deviate from the default organization-member roles, in support of Gateway Accounts.
|
||||
ExperimentAIGatewayCostControl Experiment = "ai-gateway-cost-control" // Enables AI Gateway cost control functionality.
|
||||
ExperimentAgentAppTabs Experiment = "agent-app-tabs" // Enables workspace-app and port preview tabs in the Coder Agents right panel.
|
||||
ExperimentChatAdvisor Experiment = "chat-advisor" // Enables the advisor tool for root agent chats.
|
||||
ExperimentChatVirtualDesktop Experiment = "chat-virtual-desktop" // Enables virtual desktop and computer use provider for agents.
|
||||
)
|
||||
|
||||
func (e Experiment) DisplayName() string {
|
||||
@@ -5224,6 +5226,10 @@ func (e Experiment) DisplayName() string {
|
||||
return "AI Gateway Cost Control"
|
||||
case ExperimentAgentAppTabs:
|
||||
return "Coder Agents App and Port Tabs"
|
||||
case ExperimentChatAdvisor:
|
||||
return "Chat Advisor"
|
||||
case ExperimentChatVirtualDesktop:
|
||||
return "Chat Virtual Desktop"
|
||||
default:
|
||||
// Split on hyphen and convert to title case
|
||||
// e.g. "mcp-server-http" -> "Mcp Server Http"
|
||||
@@ -5245,6 +5251,8 @@ var ExperimentsKnown = Experiments{
|
||||
ExperimentMinimumImplicitMember,
|
||||
ExperimentAIGatewayCostControl,
|
||||
ExperimentAgentAppTabs,
|
||||
ExperimentChatAdvisor,
|
||||
ExperimentChatVirtualDesktop,
|
||||
}
|
||||
|
||||
// ExperimentsSafe should include all experiments that are safe for
|
||||
|
||||
Reference in New Issue
Block a user