Skip to content

Add DeleteOrganizationResources - #37

Open
vitramir wants to merge 1 commit into
mainfrom
delete-organization-resources
Open

vitramir wants to merge 1 commit into
mainfrom
delete-organization-resources

Conversation

@vitramir

@vitramir vitramir commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Step 4 of the organization teardown: the organization's chats, ahead of the threads they sat on, which Threads removes in the same step.

The teardown deletes the rows outright rather than reusing DeleteChat's soft delete. deleted_at exists so a chat a user removed can still be read; an organization being torn down has nothing left to read it, and a row holding an organization_id that resolves to nothing is exactly what this change set is fixing.

Internal RPC — no OpenFGA check and no caller identity, gated by a new Istio AuthorizationPolicy admitting only the organizations ServiceAccount. The delete is unconditional and therefore idempotent, which is what lets the cascade retry a step it is unsure finished.

The threads test fakes gained a DeleteOrganizationResources stub, since threads.proto gained the same RPC.

Chart bumped to 0.2.0 for the new template.

Part of organization settings and deletion.

Step 4 of the organization teardown: the organization's chats, ahead of the
threads they sat on, which Threads removes in the same step.

The teardown deletes the rows outright rather than reusing DeleteChat's soft
delete. A deleted_at exists so a chat a user removed can still be read; an
organization being torn down has nothing left to read it, and a row holding an
organization_id that resolves to nothing is the thing being fixed.

Internal RPC, so no permission check and no caller identity -- the Istio policy
settles that Organizations is the only caller. The delete is unconditional and
therefore idempotent, which is what lets the cascade retry a step it is unsure
finished.
vitramir added a commit that referenced this pull request Oct 31, 2026
* test: stub DeleteOrganizationResources on the Threads fakes

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.

* feat: activity for hibernating, hibernated and waking workloads

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant