Skip to content

ci: create tasks instead of workspaces in ai triage workflow - #19940

Merged
johnstcn merged 11 commits into
mainfrom
cj/traiage/integrate-tasks
Sep 25, 2025
Merged

johnstcn merged 11 commits into
mainfrom
cj/traiage/integrate-tasks

Conversation

@johnstcn

Copy link
Copy Markdown
Member

Depends on #19939

@johnstcn johnstcn self-assigned this Sep 24, 2025
@johnstcn johnstcn changed the title ci: traiage: create tasks instead of workspaces ci: create tasks instead of workspaces in ai triage workflow Sep 24, 2025

@DanielleMaywood DanielleMaywood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me although will defer to @mafredri for approval

Comment thread .github/workflows/traiage.yaml Resolved
Comment thread scripts/traiage.sh
Comment on lines +167 to +181
# AgentAPI must be stable
agentapi_status=$(curl \
--header "Content-Type: application/json" \
--header "Coder-Session-Token: ${CODER_SESSION_TOKEN}" \
--location \
--request GET \
--show-error \
--silent \
"${CODER_URL}/@${username}/${WORKSPACE_NAME}/apps/agentapi/status" | jq -r '.status')
if [[ "${response}" == "stable" ]]; then
"${CODER_URL}/@${username}/${TASK_NAME}/apps/${APP_SLUG}/status" | jq -r '.status')
if [[ "${agentapi_status}" == "stable" ]]; then
echo "AgentAPI stable"
break
else
echo "Waiting for AgentAPI to report stable status (attempt ${attempt}/120)"
sleep 5
continue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it looks like we may need another wait here, as agentapi will become stable before it starts processing the task. We probably need to wait until the prompt shows up in the messages endpoint or something.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ended up looking very similar to what we'd want coder exp task status --watch to be. Will update in a separate PR.

Comment thread .github/workflows/traiage.yaml Resolved
id: generate-summary
env:
ARCHIVE_URL: ${{ steps.create-archive.outputs.archive_url }}
APP_SLUG: ccw

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we have the required envs check, but I'm wondering if it'd be better to define these traiage.sh envs in one place so they're applied to all action steps?

Mayhaps doing something like this early on:

echo "APP_SLUG=$APP_SLUG" >> "$GITHUB_ENV"

(There's probably a better way to do it.)

Or write a traiage.config.sh which can be sourced in traiage.sh.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long-term I want to remove the need for this (e.g by using coder task send). Leaving it here, exposed and ugly, makes it easier to delete later IMO.

Comment thread scripts/traiage.sh Resolved
Comment thread scripts/traiage.sh Resolved
Comment thread scripts/traiage.sh Resolved
Comment thread scripts/traiage.sh
fi

# AgentAPI application should not be 404'ing
agentapi_app_status_code=$(curl \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could be fancy, look up the app URL and do a ssh bash 'while :; curl; if ...; fi; done'.

The only motivation here is to reduce coderd load, though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with app_slug above, I'm disinclined to do fanciness if it can later be incorporated into the CLI.

@johnstcn
johnstcn merged commit 063e863 into main Sep 25, 2025
@johnstcn
johnstcn deleted the cj/traiage/integrate-tasks branch September 25, 2025 15:00
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants