Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: address comments
  • Loading branch information
ssncferreira committed Nov 17, 2025
commit 677339d94352f0357db53a58719519e28507d601
2 changes: 2 additions & 0 deletions coderd/aitasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ func deriveTaskCurrentState(
message = "Initializing workspace applications"
}
default:
// In case the workspace agent is not initializing,
// the overall task status should be updated accordingly
message = "Initializing workspace agent"
Copy link
Member

Choose a reason for hiding this comment

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

I think this should never happen, but the fallback is fine, should we log something if this happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this should never happen, similarly to the "Initializing workspace applications" path. I think adding a comment here is enough for now. Addressed in 677339d

}
Copy link
Member

Choose a reason for hiding this comment

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

Should we take into account the coder app status as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean LatestAppStatus? I thought about adding different messages based on the app status state, for example, if LatestAppStatus.State == idle, the message could be "Agent is idle", or for completed/failed states, we could provide more detailed information to users. Or were you thinking of something else?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about WorkspaceAppHealth, specifically WorkspaceAppHealthInitializing. If disabled we can ignore it.

I'm not sure if we need to enrich LatestAppStatus if there already exists an entry 🤔. I imagine users could want to tweak that via having the agent give some context via the mcp report tool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about WorkspaceAppHealth, specifically WorkspaceAppHealthInitializing. If disabled we can ignore it.

Ah, I see. So this would be the case where the agent is ready but the app is still initializing, correct? Do you think it makes sense to get into that level of detail? We have different possible AppHealth statuses:

WorkspaceAppHealthDisabled     WorkspaceAppHealth = "disabled"
WorkspaceAppHealthInitializing WorkspaceAppHealth = "initializing"
WorkspaceAppHealthHealthy      WorkspaceAppHealth = "healthy"
WorkspaceAppHealthUnhealthy    WorkspaceAppHealth = "unhealthy"

I'm guessing only the initializing here would make sense, because the others would probably affect the overall task status, correct?

Copy link
Member

Choose a reason for hiding this comment

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

So this would be the case where the agent is ready but the app is still initializing, correct?

Yep! 👍🏻

Do you think it makes sense to get into that level of detail?

It would better reflect how we determine the tasks status in the tasks_with_status view.

I'm guessing only the initializing here would make sense, because the others would probably affect the overall task status, correct?

Correct. 👍🏻

We could consider unhealthy as well, but that would open a can of worms I'd prefer to avoid for now (messages for agent health, workspace build failure, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in b1cb7fe

}
Expand Down
Loading