Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add the /aitasks/prompts endpoint #18464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 24, 2025
Merged

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented Jun 19, 2025

Add an endpoint to fetch AI task prompts for multiple workspace builds at the same time. A prompt is the value of the "AI Prompt" workspace build parameter. On main, the only way our API allows fetching workspace build parameters is by using the /workspacebuilds/$build_id/parameters endpoint, requiring a separate API call for every build.

The Tasks dashboard fetches Task workspaces in order to show them in a list, and then needs to fetch the value of the AI Prompt parameter for every task workspace (using its latest build id), requiring an additional API call for each list item. This endpoint will allow the dashboard to make just 2 calls to render the list: one to fetch task workspaces, the other to fetch prompts.

Screenshot 2025-06-20 at 11 33 11

Related to coder/internal#660.

@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch 6 times, most recently from aa79b8d to e9e6341 Compare June 20, 2025 10:01
@hugodutka hugodutka marked this pull request as ready for review June 20, 2025 10:11
@hugodutka hugodutka requested a review from dannykopping June 20, 2025 10:12
@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch 2 times, most recently from e4abd39 to d80c61a Compare June 20, 2025 14:07
@hugodutka hugodutka changed the title feat: add the /workspacebuilds/parameters endpoint feat: add the /aitasks/prompts endpoint Jun 20, 2025
@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch 5 times, most recently from f114f43 to bf23151 Compare June 23, 2025 14:52
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

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

nit. can it be /tasks instead? down the road, we could imagine this being used to monitor status of other jobs (non ai related) or perhaps across multiple systems (AI, non AI, etc)

I know it's an unstable endpoint so not the end of the world

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Looking good 👍

@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch from bf23151 to 1273e3c Compare June 24, 2025 10:15
@hugodutka
Copy link
Contributor Author

can it be /tasks instead? down the road, we could imagine this being used to monitor status of other jobs

@bpmct I'd rather we left it specific to AI tasks for now. Once we define a stable API and decide it should handle other types of tasks we can change the prefix. Since it's an experimental endpoint, we'll be able to do it at any time.

Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM

@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch from 1273e3c to 5a42c7e Compare June 24, 2025 10:52
@hugodutka hugodutka merged commit 670fa4a into main Jun 24, 2025
36 of 37 checks passed
@hugodutka hugodutka deleted the hugodutka/bulk-wb-parameters branch June 24, 2025 11:06
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 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