Repository navigation
feat(operator): KapeTool memory deletion-protection finalizer + Qdrant collection lifecycle (#38) - #147
Merged
Conversation
6 tasks
… Qdrant collection lifecycle
Adds kape.io/tool-protection finalizer to all memory-type KapeTools on
reconcile. Deletion is blocked with Ready=False/ReferencedByHandlers and
a DeletionBlocked event while any KapeHandler carries
kape.io/tool-ref-{name}=true. Once no referencing handlers remain, the
new qdrant package calls DELETE /collections/{name} (idempotent on 404)
before releasing the finalizer.
On StatefulSet ReadyReplicas >= 1, EnsureCollection calls PUT
/collections/{name} (idempotent on 200/409). Existing KapeTools without
the finalizer receive it retroactively on next reconcile.
Closes #38
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dzungtr
force-pushed
the
feat/38-kapetool-deletion-qdrant
branch
from
July 19, 2026 14:57
27a2836 to
b77a688
Compare
This was referenced Oct 11, 2026
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
kape.io/tool-protectionfinalizer to all memory-typeKapeToolresources on reconcile (retroactive for existing resources)Ready=False / ReferencedByHandlerscondition andDeletionBlockedevent while anyKapeHandlercarrieskape.io/tool-ref-{name}=true; finalizer released once no referencing handlers remainoperator/infra/qdrantpackage:EnsureCollection(idempotent on 200/409) called when StatefulSet reaches ReadyReplicas ≥ 1,DeleteCollection(idempotent on 404) called before finalizer removalports.ToolRepositoryandk8s.ToolRepositorygainAddFinalizer/RemoveFinalizer(mirrorsSchemaRepositorypattern)Test plan
TestToolReconciler_MemoryType_FinalizerAddedOnCreate— finalizer is added on first reconcileTestToolReconciler_MemoryType_UpgradePath_FinalizerAddedRetroactively— existing tools without finalizer get it on next reconcileTestToolReconciler_MemoryType_DeletionBlockedWhenHandlerReferences— finalizer stays,DeletionBlockedevent emittedTestToolReconciler_MemoryType_DeletionUnblocksWhenNoHandlers— finalizer removed, Qdrant DELETE called (200 response)TestToolReconciler_MemoryType_DeleteCollection_Idempotent404— 404 from Qdrant treated as successTestEnsureCollection_Idempotent200/TestEnsureCollection_Idempotent409— collection create idempotencyTestDeleteCollection_Idempotent200/TestDeleteCollection_Idempotent404— collection delete idempotencyTestToolRepository_AddRemoveFinalizer— k8s adapter correctly patches finalizersgo test ./operator/...)Closes #38
🤖 Generated with Claude Code