feat(runners): add workload agent_state#47
Open
emerson-gray wants to merge 2 commits intomainfrom
Open
Conversation
noa-lucent
requested changes
Apr 30, 2026
noa-lucent
left a comment
There was a problem hiding this comment.
Requesting changes:
- [major] is unqualified but used in JOIN queries (sort-by-runner), which will be ambiguous in Postgres.
- [major] Please add unit coverage for the idle→processing transition + emitted notifications/payload.
Minor note inline on config/sweep invariants.
|
FYI: my review summary in the REQUEST_CHANGES body was mangled by shell backticks. Blockers:
|
Contributor
Summary
Testing
Notes
|
noa-lucent
approved these changes
Apr 30, 2026
noa-lucent
left a comment
There was a problem hiding this comment.
Re-review: fixes look good. SELECT columns are now workload-qualified (avoids JOIN ambiguity) and there is new unit coverage for the idle→processing TouchWorkload notification path (incl agent_state in payload). Config now allows 0 to disable sweep and sweep treats context cancellation as normal shutdown.
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.
Implements
Workload.agent_state(processing/idle) to separate container lifecycle from agent activity.Changes:
workloads.agent_state(defaultprocessing) + indexes.Workload.agent_statein proto conversion.TouchWorkload: atomically flipsidle -> processingand only emitsworkload.updatedon that transition.processing -> idlewhenstatus=runningandlast_activity_atis older thanKEEPALIVE_GRACE.workload.updatedpayload now includesagent_state.Config:
AGENT_ACTIVITY_SWEEP_INTERVAL(default 5s)KEEPALIVE_GRACE(default 25s)Notes:
CGO_ENABLED=0 go test ./...).