mirror of
https://github.com/coder/coder.git
synced 2026-06-04 13:38:21 +00:00
155c7bbc65
This is a workaround for https://github.com/coder/coder/issues/18776 We avoid the foreign key issue by checking the previously inserted workspace applications before calling UpdateWorkspaceAITask. Now, affected workspaces will show as "not running an AI task" on the single task view, which is technically correct. We also insert a provisioner job log at WARN level to ensure that the user sees some information that they have run into this issue, as well as logging on the server side. Longer term, we plan to modify how the workspace tasks view is presented. This is a stopgap measure until we solidify that plan. NOTE: this does **not** address the fact that stopping a workspace with `has_ai_task: true` will result in the completed stop build no longer having `has_ai_task: true`, resulting in tasks "disappearing" on stop.