Repository navigation
feat: activity for hibernating, hibernated and waking workloads - #38
Merged
Merged
Conversation
threads.proto gained DeleteOrganizationResources, and CI generates the Threads bindings from the module's main on every run, so the fakes no longer satisfy ThreadsServiceClient and internal/server stops compiling its tests. A CI run on main today fails the same way. The stubs are #37's, byte for byte and in the same place, so whichever of the two lands second merges without a conflict.
A workload can now sleep between turns and come back on the same record: running -> hibernating -> hibernated, then hibernated -> waking -> running on the next message. Chat rejected the three statuses as unsupported, so an instance whose workload slept was logged as a Runners failure and shown as finished, with its workload dropped from active_workload_ids -- and a waking one read the same, where the chat should show the agent coming back. waking now contributes pending. hibernating and hibernated contribute finished: the agent is asleep between turns, and the next message wakes it. All three are listed in active_workload_ids, a hibernated workload because it is the one that moves next -- the chat-app has to be in its room already to see the waking -> running that follows the user's message. The running case and how agent_state is read are unchanged. The committed protos were regenerated from buf.build/agynio/api main: they predated the three statuses. They pick up what else landed there since, and protoc-gen-go v1.36.12, which builds against the pinned v1.36.11 runtime. See agynio/architecture: changes/2026-10-27-workload-hibernation.md
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.
Chat's
activity_statusandactive_workload_idslearn the three hibernation statuses, as chat.md — Activity Status specifies them:active_workload_idswakingpendinghibernatingfinishedhibernatedfinishedA hibernated workload stays in
active_workload_idsbecause it is the one that moves next: the chat-app has to be in itsworkload:{id}room already to see thewaking → runningthat follows the user's next message.Until now the three statuses failed
validateWorkloadStatus. A sleeping instance was logged as a Runners failure and shown asfinishedwith its workload dropped from the list, and a waking one read the same. Therunningcase and howagent_stateis read are unchanged.Safe to merge ahead of the rest of the rollout: nothing writes these statuses until a runner advertises
hibernate, and the k8s-runner advertises nothing.changes/2026-10-27-workload-hibernation.md(Delta table, Chat row)HIBERNATING,HIBERNATED,WAKINGinrunners/v1WorkloadStatus)Also in this PR
chat/v1andthreads/v1and builds against the committedrunners/v1,runner/v1andidentity/v1bindings, which predated the new values. All six files were regenerated frombuf.build/agynio/apimain with the Dockerfile's path list, so they also carry what else landed there since (DeleteOrganizationResources,IDENTITY_TYPE_PLATFORM, the runner'sHibernateWorkload/WakeWorkload, …) and protoc-gen-go v1.36.12, which builds against the pinned v1.36.11 runtime;go.modis unchanged.buf dep updatedoes not apply: the repository has no local protos, and it fails with "had no .proto files".threads.protogainedDeleteOrganizationResources, and since CI generates Threads from the module's main, the fakes no longer compile — onmainas well. The stubs are Add DeleteOrganizationResources #37's, byte for byte and in the same place, so whichever of the two lands second merges cleanly.Relation to #28
#28 restructures the
runningcase and howagent_stateis normalized; it has conflicted withmainsince #30 landed the sameagent_statederivation. This PR touches neither: it addswakingto the pending case list, afinishedcase forhibernating/hibernated, and the three statuses to the status check and the ID filter. Checked by applying #28'sserver.godiff to both bases: the same three hunks reject onmainand on this branch, and its fourth applies cleanly on both, so this PR adds no conflict to it.Tests
TestGetChatsWakingWorkloadReturnsPending,TestGetChatsHibernatingWorkloadReturnsFinished,TestGetChatsHibernatedWorkloadReturnsFinished), each also checking the ID list, plusTestGetChatsActiveWorkloadIDsIncludeHibernationStatusesfor the list across several participants (astoppedone left out,wakingoutranking the sleeping ones). All four fail against the previous derivation.gofmt -landgo vet ./...clean;CHAT_E2E_INPROCESS=1 go test ./...andgo test -race ./internal/servergreen. CI's own steps (generatechat/v1+threads/v1only,go testwithout e2e,go build) green on a clean export of the branch. The repository has no linter config; staticcheck was not run (the local binary is built with Go 1.25 and cannot load the 1.26 toolchain).Not in this PR
The spec splits
failedon the instance's state (active→pending,paused→finished). Chat reads no instance state and maps everyfailedtopending. That predates hibernation and is left as it is.