mirror of
https://github.com/coder/coder.git
synced 2026-09-21 12:44:32 +08:00
chore: remove ai tasks from experiment (#18511)
Closes https://github.com/coder/internal/issues/661
This commit is contained in:
Generated
+2
-5
@@ -12742,11 +12742,9 @@ const docTemplate = `{
|
||||
"workspace-usage",
|
||||
"web-push",
|
||||
"workspace-prebuilds",
|
||||
"agentic-chat",
|
||||
"ai-tasks"
|
||||
"agentic-chat"
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"ExperimentAITasks": "Enables the new AI tasks feature.",
|
||||
"ExperimentAgenticChat": "Enables the new agentic AI chat feature.",
|
||||
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
|
||||
"ExperimentExample": "This isn't used for anything.",
|
||||
@@ -12762,8 +12760,7 @@ const docTemplate = `{
|
||||
"ExperimentWorkspaceUsage",
|
||||
"ExperimentWebPush",
|
||||
"ExperimentWorkspacePrebuilds",
|
||||
"ExperimentAgenticChat",
|
||||
"ExperimentAITasks"
|
||||
"ExperimentAgenticChat"
|
||||
]
|
||||
},
|
||||
"codersdk.ExternalAuth": {
|
||||
|
||||
Generated
+2
-5
@@ -11435,11 +11435,9 @@
|
||||
"workspace-usage",
|
||||
"web-push",
|
||||
"workspace-prebuilds",
|
||||
"agentic-chat",
|
||||
"ai-tasks"
|
||||
"agentic-chat"
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"ExperimentAITasks": "Enables the new AI tasks feature.",
|
||||
"ExperimentAgenticChat": "Enables the new agentic AI chat feature.",
|
||||
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
|
||||
"ExperimentExample": "This isn't used for anything.",
|
||||
@@ -11455,8 +11453,7 @@
|
||||
"ExperimentWorkspaceUsage",
|
||||
"ExperimentWebPush",
|
||||
"ExperimentWorkspacePrebuilds",
|
||||
"ExperimentAgenticChat",
|
||||
"ExperimentAITasks"
|
||||
"ExperimentAgenticChat"
|
||||
]
|
||||
},
|
||||
"codersdk.ExternalAuth": {
|
||||
|
||||
@@ -1544,7 +1544,6 @@ func New(options *Options) *API {
|
||||
// Add CSP headers to all static assets and pages. CSP headers only affect
|
||||
// browsers, so these don't make sense on api routes.
|
||||
cspMW := httpmw.CSPHeaders(
|
||||
api.Experiments,
|
||||
options.Telemetry.Enabled(), func() []*proxyhealth.ProxyHost {
|
||||
if api.DeploymentValues.Dangerous.AllowAllCors {
|
||||
// In this mode, allow all external requests.
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/proxyhealth"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
)
|
||||
|
||||
// cspDirectives is a map of all csp fetch directives to their values.
|
||||
@@ -59,7 +58,7 @@ const (
|
||||
// Example: https://github.com/coder/coder/issues/15118
|
||||
//
|
||||
//nolint:revive
|
||||
func CSPHeaders(experiments codersdk.Experiments, telemetry bool, proxyHosts func() []*proxyhealth.ProxyHost, staticAdditions map[CSPFetchDirective][]string) func(next http.Handler) http.Handler {
|
||||
func CSPHeaders(telemetry bool, proxyHosts func() []*proxyhealth.ProxyHost, staticAdditions map[CSPFetchDirective][]string) func(next http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Content-Security-Policy disables loading certain content types and can prevent XSS injections.
|
||||
@@ -124,9 +123,7 @@ func CSPHeaders(experiments codersdk.Experiments, telemetry bool, proxyHosts fun
|
||||
if len(extraConnect) > 0 {
|
||||
for _, extraHost := range extraConnect {
|
||||
// Allow embedding the app host.
|
||||
if experiments.Enabled(codersdk.ExperimentAITasks) {
|
||||
cspSrcs.Append(CSPDirectiveFrameSrc, extraHost.AppHost)
|
||||
}
|
||||
cspSrcs.Append(CSPDirectiveFrameSrc, extraHost.AppHost)
|
||||
if extraHost.Host == "*" {
|
||||
// '*' means all
|
||||
cspSrcs.Append(CSPDirectiveConnectSrc, "*")
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
"github.com/coder/coder/v2/coderd/httpmw"
|
||||
"github.com/coder/coder/v2/coderd/proxyhealth"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
)
|
||||
|
||||
func TestCSP(t *testing.T) {
|
||||
@@ -50,9 +49,7 @@ func TestCSP(t *testing.T) {
|
||||
r := httptest.NewRequest(http.MethodGet, "/", nil)
|
||||
rw := httptest.NewRecorder()
|
||||
|
||||
httpmw.CSPHeaders(codersdk.Experiments{
|
||||
codersdk.ExperimentAITasks,
|
||||
}, false, func() []*proxyhealth.ProxyHost {
|
||||
httpmw.CSPHeaders(false, func() []*proxyhealth.ProxyHost {
|
||||
return proxyHosts
|
||||
}, map[httpmw.CSPFetchDirective][]string{
|
||||
httpmw.CSPDirectiveMediaSrc: expectedMedia,
|
||||
|
||||
@@ -3369,7 +3369,6 @@ const (
|
||||
ExperimentWebPush Experiment = "web-push" // Enables web push notifications through the browser.
|
||||
ExperimentWorkspacePrebuilds Experiment = "workspace-prebuilds" // Enables the new workspace prebuilds feature.
|
||||
ExperimentAgenticChat Experiment = "agentic-chat" // Enables the new agentic AI chat feature.
|
||||
ExperimentAITasks Experiment = "ai-tasks" // Enables the new AI tasks feature.
|
||||
)
|
||||
|
||||
// ExperimentsKnown should include all experiments defined above.
|
||||
|
||||
Generated
-1
@@ -3513,7 +3513,6 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
| `web-push` |
|
||||
| `workspace-prebuilds` |
|
||||
| `agentic-chat` |
|
||||
| `ai-tasks` |
|
||||
|
||||
## codersdk.ExternalAuth
|
||||
|
||||
|
||||
Generated
-1
@@ -834,7 +834,6 @@ export const EntitlementsWarningHeader = "X-Coder-Entitlements-Warning";
|
||||
|
||||
// From codersdk/deployment.go
|
||||
export type Experiment =
|
||||
| "ai-tasks"
|
||||
| "agentic-chat"
|
||||
| "auto-fill-parameters"
|
||||
| "example"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { API } from "api/api";
|
||||
import { experiments } from "api/queries/experiments";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import { Button } from "components/Button/Button";
|
||||
import { ExternalImage } from "components/ExternalImage/ExternalImage";
|
||||
@@ -10,7 +9,6 @@ import { useWebpushNotifications } from "contexts/useWebpushNotifications";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
|
||||
import type { FC } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { NavLink, useLocation } from "react-router-dom";
|
||||
import { cn } from "utils/cn";
|
||||
import { DeploymentDropdown } from "./DeploymentDropdown";
|
||||
@@ -145,7 +143,6 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
|
||||
const location = useLocation();
|
||||
const agenticChat = useAgenticChat();
|
||||
const { metadata } = useEmbeddedMetadata();
|
||||
const experimentsQuery = useQuery(experiments(metadata.experiments));
|
||||
|
||||
return (
|
||||
<nav className={cn("flex items-center gap-4 h-full", className)}>
|
||||
@@ -178,7 +175,7 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
|
||||
Chat
|
||||
</NavLink>
|
||||
)}
|
||||
{experimentsQuery.data?.includes("ai-tasks") && (
|
||||
{metadata.tasksTabVisible.value && (
|
||||
<NavLink
|
||||
className={({ isActive }) => {
|
||||
return cn(linkStyles.default, isActive ? linkStyles.active : "");
|
||||
|
||||
Reference in New Issue
Block a user