feat: add exit code and status to workspace agent scripts (#24505)

For scripts that have not finished or in dry run cases these will be
omitted.
This commit is contained in:
Asher authored and GitHub committed 2026-04-29 12:24:26 -08:00
1 parent 1c30d52b2b
commit be57af5ff0
25 files changed
+286 -80

No files matched your search

+10 -1
View File
@@ -17,4 +17,13 @@ SELECT
RETURNING workspace_agent_scripts.*;
-- name: GetWorkspaceAgentScriptsByAgentIDs :many
SELECT * FROM workspace_agent_scripts WHERE workspace_agent_id = ANY(@ids :: uuid [ ]);
SELECT
DISTINCT ON (workspace_agent_scripts.id) workspace_agent_scripts.*,
workspace_agent_script_timings.exit_code,
workspace_agent_script_timings.status
FROM workspace_agent_scripts
LEFT JOIN workspace_agent_script_timings
ON workspace_agent_script_timings.script_id = workspace_agent_scripts.id
WHERE workspace_agent_scripts.workspace_agent_id = ANY(@ids :: uuid [ ])
ORDER BY workspace_agent_scripts.id, workspace_agent_script_timings.started_at
DESC NULLS LAST;