@@ -353,6 +353,18 @@ var CreateWorkspace = Tool[CreateWorkspaceArgs, codersdk.Workspace]{
353353If a user is asking to "test a template", they are typically referring
354354to creating a workspace from a template to ensure the infrastructure
355355is provisioned correctly and the agent can connect to the control plane.
356+
357+ Before creating a workspace, always confirm the template choice with the user by:
358+
359+ 1. Listing the available templates that match their request.
360+ 2. Recommending the most relevant option.
361+ 2. Asking the user to confirm which template to use.
362+
363+ It is important to not create a workspace without confirming the template
364+ choice with the user.
365+
366+ After creating a workspace, watch the build logs and wait for the workspace to
367+ be ready before trying to use or connect to the workspace.
356368` ,
357369Schema : aisdk.Schema {
358370Properties :map [string ]any {
@@ -530,8 +542,13 @@ type CreateWorkspaceBuildArgs struct {
530542
531543var CreateWorkspaceBuild = Tool [CreateWorkspaceBuildArgs , codersdk.WorkspaceBuild ]{
532544Tool : aisdk.Tool {
533- Name :ToolNameCreateWorkspaceBuild ,
534- Description :"Create a new workspace build for an existing workspace. Use this to start, stop, or delete." ,
545+ Name :ToolNameCreateWorkspaceBuild ,
546+ Description :`Create a new workspace build for an existing workspace. Use this to start, stop, or delete.
547+
548+ After creating a workspace build, watch the build logs and wait for the
549+ workspace build to complete before trying to start another build or use or
550+ connect to the workspace.
551+ ` ,
535552Schema : aisdk.Schema {
536553Properties :map [string ]any {
537554"workspace_id" :map [string ]any {
@@ -1531,8 +1548,20 @@ type WorkspaceWriteFileArgs struct {
15311548
15321549var WorkspaceWriteFile = Tool [WorkspaceWriteFileArgs , codersdk.Response ]{
15331550Tool : aisdk.Tool {
1534- Name :ToolNameWorkspaceWriteFile ,
1535- Description :`Write a file in a workspace.` ,
1551+ Name :ToolNameWorkspaceWriteFile ,
1552+ Description :`Write a file in a workspace.
1553+
1554+ If a file write fails due to syntax errors or encoding issues, do NOT switch
1555+ to using bash commands as a workaround. Instead:
1556+
1557+ 1. Read the error message carefully to identify the issue
1558+ 2. Fix the content encoding/syntax
1559+ 3. Retry with this tool
1560+
1561+ The content parameter expects base64-encoded bytes. Ensure your source content
1562+ is correct before encoding it. If you encounter errors, decode and verify the
1563+ content you are trying to write, then re-encode it properly.
1564+ ` ,
15361565Schema : aisdk.Schema {
15371566Properties :map [string ]any {
15381567"workspace" :map [string ]any {