@@ -269,10 +269,10 @@ func taskFromWorkspace(ws codersdk.Workspace, initialPrompt string) codersdk.Tas
269269}
270270
271271var appID uuid.NullUUID
272- if ws .LatestBuild .AITaskSidebarAppID != nil {
272+ if ws .LatestBuild .TaskAppID != nil {
273273appID = uuid.NullUUID {
274274Valid :true ,
275- UUID :* ws .LatestBuild .AITaskSidebarAppID ,
275+ UUID :* ws .LatestBuild .TaskAppID ,
276276}
277277}
278278
@@ -667,9 +667,9 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
667667// @Router /api/experimental/tasks/{user}/{id}/send [post]
668668//
669669// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
670- // taskSend submits task input to thetasks sidebar app by dialing the agent
670+ // taskSend submits task input to thetask app by dialing the agent
671671// directly over the tailnet. We enforce ApplicationConnect RBAC on the
672- // workspace and validate thesidebar app health.
672+ // workspace and validate thetask app health.
673673func (api * API )taskSend (rw http.ResponseWriter ,r * http.Request ) {
674674ctx := r .Context ()
675675
@@ -693,7 +693,7 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
693693return
694694}
695695
696- if err = api .authAndDoWithTaskSidebarAppClient (r ,taskID ,func (ctx context.Context ,client * http.Client ,appURL * url.URL )error {
696+ if err = api .authAndDoWithTaskAppClient (r ,taskID ,func (ctx context.Context ,client * http.Client ,appURL * url.URL )error {
697697agentAPIClient ,err := aiagentapi .NewClient (appURL .String (),aiagentapi .WithHTTPClient (client ))
698698if err != nil {
699699return httperror .NewResponseError (http .StatusBadGateway , codersdk.Response {
@@ -749,7 +749,7 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
749749//
750750// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
751751// taskLogs reads task output by dialing the agent directly over the tailnet.
752- // We enforce ApplicationConnect RBAC on the workspace and validate thesidebar app health.
752+ // We enforce ApplicationConnect RBAC on the workspace and validate thetask app health.
753753func (api * API )taskLogs (rw http.ResponseWriter ,r * http.Request ) {
754754ctx := r .Context ()
755755
@@ -763,7 +763,7 @@ func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) {
763763}
764764
765765var out codersdk.TaskLogsResponse
766- if err := api .authAndDoWithTaskSidebarAppClient (r ,taskID ,func (ctx context.Context ,client * http.Client ,appURL * url.URL )error {
766+ if err := api .authAndDoWithTaskAppClient (r ,taskID ,func (ctx context.Context ,client * http.Client ,appURL * url.URL )error {
767767agentAPIClient ,err := aiagentapi .NewClient (appURL .String (),aiagentapi .WithHTTPClient (client ))
768768if err != nil {
769769return httperror .NewResponseError (http .StatusBadGateway , codersdk.Response {
@@ -811,16 +811,16 @@ func (api *API) taskLogs(rw http.ResponseWriter, r *http.Request) {
811811httpapi .Write (ctx ,rw ,http .StatusOK ,out )
812812}
813813
814- //authAndDoWithTaskSidebarAppClient centralizes the shared logic to:
814+ //authAndDoWithTaskAppClient centralizes the shared logic to:
815815//
816816// - Fetch the task workspace
817817// - Authorize ApplicationConnect on the workspace
818- // - Validate the AI task andsidebar app health
818+ // - Validate the AI task andtask app health
819819// - Dial the agent and construct an HTTP client to the apps loopback URL
820820//
821821// The provided callback receives the context, an HTTP client that dials via the
822822// agent, and the base app URL (as a value URL) to perform any request.
823- func (api * API )authAndDoWithTaskSidebarAppClient (
823+ func (api * API )authAndDoWithTaskAppClient (
824824r * http.Request ,
825825taskID uuid.UUID ,
826826do func (ctx context.Context ,client * http.Client ,appURL * url.URL )error ,
@@ -855,19 +855,19 @@ func (api *API) authAndDoWithTaskSidebarAppClient(
855855return httperror .ErrResourceNotFound
856856}
857857build := data .builds [0 ]
858- if build .HasAITask == nil || ! * build .HasAITask || build .AITaskSidebarAppID == nil || * build .AITaskSidebarAppID == uuid .Nil {
858+ if build .HasAITask == nil || ! * build .HasAITask || build .TaskAppID == nil || * build .TaskAppID == uuid .Nil {
859859return httperror .NewResponseError (http .StatusBadRequest , codersdk.Response {
860- Message :"Task is not configured with asidebar app." ,
860+ Message :"Task is not configured with atask app." ,
861861})
862862}
863863
864- // Find thesidebar app details to get the URL and validate app health.
865- sidebarAppID := * build .AITaskSidebarAppID
866- agentID ,sidebarApp ,ok := func () (uuid.UUID , codersdk.WorkspaceApp ,bool ) {
864+ // Find thetask app details to get the URL and validate app health.
865+ taskAppID := * build .TaskAppID
866+ agentID ,taskApp ,ok := func () (uuid.UUID , codersdk.WorkspaceApp ,bool ) {
867867for _ ,res := range build .Resources {
868868for _ ,agent := range res .Agents {
869869for _ ,app := range agent .Apps {
870- if app .ID == sidebarAppID {
870+ if app .ID == taskAppID {
871871return agent .ID ,app ,true
872872}
873873}
@@ -877,32 +877,32 @@ func (api *API) authAndDoWithTaskSidebarAppClient(
877877}()
878878if ! ok {
879879return httperror .NewResponseError (http .StatusBadRequest , codersdk.Response {
880- Message :"Tasksidebar app not found in latest build." ,
880+ Message :"Task app not found in latest build." ,
881881})
882882}
883883
884884// Return an informative error if the app isn't healthy rather than trying
885885// and failing.
886- switch sidebarApp .Health {
886+ switch taskApp .Health {
887887case codersdk .WorkspaceAppHealthDisabled :
888888// No health check, pass through.
889889case codersdk .WorkspaceAppHealthInitializing :
890890return httperror .NewResponseError (http .StatusServiceUnavailable , codersdk.Response {
891- Message :"Tasksidebar app is initializing. Try again shortly." ,
891+ Message :"Task app is initializing. Try again shortly." ,
892892})
893893case codersdk .WorkspaceAppHealthUnhealthy :
894894return httperror .NewResponseError (http .StatusServiceUnavailable , codersdk.Response {
895- Message :"Tasksidebar app is unhealthy." ,
895+ Message :"Task app is unhealthy." ,
896896})
897897}
898898
899899// Build the direct app URL and dial the agent.
900- if sidebarApp .URL == "" {
900+ if taskApp .URL == "" {
901901return httperror .NewResponseError (http .StatusInternalServerError , codersdk.Response {
902- Message :"Tasksidebar app URL is not configured." ,
902+ Message :"Task app URL is not configured." ,
903903})
904904}
905- parsedURL ,err := url .Parse (sidebarApp .URL )
905+ parsedURL ,err := url .Parse (taskApp .URL )
906906if err != nil {
907907return httperror .NewResponseError (http .StatusInternalServerError , codersdk.Response {
908908Message :"Internal error parsing task app URL." ,