Repository navigation
Conversation
Keep explicit deletion available after a runtime loses its settlement callback. Preserve dispatch, checkpoint and claimed lifecycle exclusions. Verify failed deletion and a lost response after deletion with PostgreSQL-backed workflow tests. Refs kagent-dev#3010. This restores deletion, not in-place conversation recovery. AI assistance: implementation and validation assisted by OpenAI Codex. Signed-off-by: Junfeng Yu <64075563+Jacob953@users.noreply.github.com>
Reproduce exhausted Go ADK settlement retries through gRPC and PostgreSQL. Preserve deletion write exclusions and document the separate recovery gap for abandoned quiescence claims. Link the shared tracking issues and state the conditions required before relaxing recovery guards. AI assistance: implementation and validation assisted by OpenAI Codex. Signed-off-by: Junfeng Yu <64075563+Jacob953@users.noreply.github.com>
Preserve idle expiration cleanup checks while allowing the explicit deletion escape for kagent-dev#3010 B. Reject late publication after deletion admission, including preparation failure, and retain idempotent published acknowledgements. Cover all boundary states, initial and updated boundaries, failure retries and settlement/deletion ordering. Automatic publication and same-session recovery remain outside this deletion fix. AI assistance: implementation and validation assisted by OpenAI Codex. Signed-off-by: Junfeng Yu <64075563+Jacob953@users.noreply.github.com>
Use PostgreSQL clock cutoffs in the TTL regression to avoid host/container skew. Add shared E2E coverage for deleting staged terminal and waiting boundaries while a real Actor is running, including a lost public reply and rejected stale writes. Document the harness selectors. Validated locally with the Go ADK harness on Kind/Substrate/gVisor, full affected race suites, 100 TTL repetitions, and Go lint. AI assistance: implementation and validation assisted by OpenAI Codex. Signed-off-by: Junfeng Yu <64075563+Jacob953@users.noreply.github.com>
Jacob953
marked this pull request as ready for review
October 15, 2026 06:29
Jacob953
marked this pull request as draft
October 15, 2026 07:02
Jacob953
marked this pull request as ready for review
October 15, 2026 07:19
moezdil
reviewed
Oct 15, 2026
moezdil
reviewed
Oct 15, 2026
Use one admission query for lifecycle operations, dispatch, task writes and checkpoint creation. Allow unpublished boundaries only for explicit deletion, while retaining claimed quiescence and live dispatch protections. Remove fork tracking and unrelated cancellation references from source comments. Verify explicit deletion still rejects live dispatch and checkpoint creation. Refs kagent-dev#3010. AI assistance: implementation and validation assisted by OpenAI Codex. Signed-off-by: Junfeng Yu <64075563+Jacob953@users.noreply.github.com>
Wait for the executor cleanup callback instead of counting telemetry flushes. Join the test A2A server and check its exit error. Assert the precise public task state after settlement retries fail. Clarify the deletion fault fixture's effect ordering and verify its lifecycle interface at compile time. Tighten comments and document the limit on settlement acknowledgement idempotence after deletion. Refs kagent-dev#3010. AI assistance: implementation and validation assisted by OpenAI Codex. Signed-off-by: Junfeng Yu <64075563+Jacob953@users.noreply.github.com>
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.
When a runtime saves a terminal or waiting task boundary but its
SettleTaskacknowledgement never commits, the Session rejects further work and lifecycle operations, including deletion. This PR allows a caller to delete that Session through the existing durable Actor deletion workflow.Related issue: #3010, case B: unsettled task boundary blocks Delete. This implements the issue's explicit-deletion alternative. It partially addresses #3010; automatic publication and recovery of the original Session remain open.
Ready for maintainer review of the deletion semantics and retained lifecycle guards.
Implementation
DELETEmay proceed despite unpublished task events. Live dispatch reservations, claimed quiescence work and checkpoint creation still block deletion. The existing workflow records deletion intent before backend cleanup and retains it for retry if cleanup fails.ErrConflict(Abortedover gRPC), including after deletion preparation fails. It cannot publish task state/history or enqueue push notifications. A previously published acknowledgement remains idempotent until final deletion.Deletion discards the pending result and removes the Session's runtime through the existing deletion workflow. It does not resume the conversation. Orphaned active tasks and abandoned quiescence claims require separate recovery work.
Validation
INPUT_REQUIREDandAUTH_REQUIRED, both initial creation and later updates, deletion/settlement ordering, idempotence, callback suppression and workflow retries after partial failure. Passed under the race detector.TestSessionUnpublishedBoundaryDeletionstages completed and input-required boundaries through TaskStore while a real Actor is blocked at a mock model request. It checks Actor removal, rejected stale writes, a lost successful public deletion reply and no compute recreation. Go ADK cases passed on Kind 1.37.0, Substrate 0.5.0-alpha2 and gVisor on arm64.make -C go lintpassed.The TTL regression test also now takes its precise cutoffs from PostgreSQL, matching the event clock. This removes a host/container clock-skew failure in the test without changing production TTL timing. It passed 100 consecutive race runs.
Relevant commands, from
go/with Docker and the repository's envtest assets configured:With the clean-install E2E fixtures configured as described in
go/core/test/e2e/README.md:An additional local infrastructure probe verified that deletion intent survives backend unavailability and controller replacement, and a fresh request completes deletion after recovery. That probe is not a committed regression test. Lost Substrate deletion responses are covered by workflow fault tests; the live E2E test injects loss of the public API reply after success.
Pending review and validation
AI assistance: OpenAI Codex assisted with implementation, testing and this PR description.