-
Notifications
You must be signed in to change notification settings - Fork 838
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
feat: add app status tracking to the backend #17163
Conversation
defer q.mutex.Unlock() | ||
|
||
status := database.WorkspaceAppStatus{ | ||
ID: arg.ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we generate the UUID in the database, we should avoid inserting UUIDs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
INSERT INTO workspace_app_statuses (id, created_at, workspace_id, agent_id, app_id, state, message, needs_user_attention, uri, icon) | ||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) | ||
RETURNING *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: drop the ID here in the inputs and just return the auto-generated value from the DB.
client, db := coderdtest.NewWithDatabase(t, nil) | ||
user := coderdtest.CreateFirstUser(t, client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing with the owner can mask authz issues.
Instead, create another member user/client and then test with that client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the dbauthz stuff (which, after discussion, is outside of the scope of this issue to fix), nothing blocking.
/cherry-pick release/2.21 |
This does ~95% of the backend work required to integrate the AI work.
Most left to integrate from the tasks branch is just frontend, which will be a lot smaller I believe.
The real difference between this branch and that one is the abstraction -- this now attaches statuses to apps, and returns the latest status reported as part of a workspace.
This change enables us to have a similar UX to in the tasks branch, but for agents other than Claude Code as well. Any app can report status now.