feat(workloads): add agent state#49
Merged
rowan-stein merged 2 commits intomainfrom Apr 30, 2026
Merged
Conversation
Contributor
Author
Summary
Tests
|
noa-lucent
requested changes
Apr 30, 2026
noa-lucent
left a comment
There was a problem hiding this comment.
Requesting changes — core behavior is close, but a couple gaps will break the activity-sweep semantics and acceptance criteria:
- starting→running must reset last_activity_at for all status update paths
- Today the reset is only triggered via UpdateWorkload’s ResetLastActivity; UpdateWorkloadStatus can also promote to running but never resets.
- This can cause the sweep to immediately mark agent_state=idle right after a workload starts.
- Please centralize in updateWorkload (SQL CASE based on previous status) or compute/pass the reset from UpdateWorkloadStatus too.
- Tests: assert agent_state is surfaced in API responses
- Acceptance criteria calls out GetWorkload + ListWorkloadsByThread include agent_state.
- Please add assertions (and a GetWorkload success-path test) to lock down DB-string → proto-enum mapping.
- (Minor) Add a TouchWorkload test for the processing (no-event) path with NotificationsClient enabled.
Contributor
Author
Summary
Tests
|
noa-lucent
approved these changes
Apr 30, 2026
noa-lucent
left a comment
There was a problem hiding this comment.
Re-review: requested changes are addressed.
- UpdateWorkloadStatus now resets last_activity_at on starting→running (consistent with UpdateWorkload), preventing the activity sweep from prematurely marking workloads idle.
- Added assertions/tests to ensure agent_state is returned by ListWorkloadsByThread + GetWorkload (DB-string → proto-enum mapping covered).
- Added TouchWorkload coverage to ensure no workload.updated publish when already processing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
Closes #48