aaif-goose / aaif-goose/goose

Define an atomic session lifecycle across storage and ACP caches

Offen
#11,611 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
54.2k
Forks
6.2k
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
262

Beschreibung

**What problem would this solve?**

Session activation and teardown currently span three independently synchronized representations: the persisted session row, the `AgentManager` cache, and the ACP connection's active-session map. Session IDs can be reused after deletion, while agent construction and ACP registration can finish asynchronously after they began.

There is no single lifecycle contract that proves an agent being published still belongs to the current persisted row. Local fixes in one cache leave another publication boundary open, and cancellation or an uncertain delete result makes it unclear which in-memory state may safely be retained.

**What would a good outcome look like?**

Creation, activation, registration, teardown, and ID reuse obey one race-free lifecycle contract across persistence and every in-memory representation.

The design should specify:

- the immutable identity or generation that binds a persisted row to every cached or ACP-active agent
- how an activation proves that identity is still current at its final publication point
- how teardown fences new and in-flight creation before persistent mutation and remains active through all cache invalidation
- cancellation-safe cleanup when a request is dropped at any await point
- behavior after a confirmed delete failure versus an uncertain commit outcome
- how storage-only CLI operations and both agent-loop implementations participate without duplicating lifecycle rules
- compatibility and migration behavior for existing session IDs and persisted data

**Possible approaches**

- Make session IDs non-reusable so the public ID is also the durable lifecycle identity.
- Add an immutable row UUID or generation and propagate a lifecycle lease through agent construction and ACP registration.
- Introduce a transaction-scoped session lifecycle coordinator that owns persistence, manager-cache, and ACP-map publication/removal.
- Unify this identity with the authorization contract discussed in #11609 if one primitive can safely serve both concerns.

The accepted design should include deterministic creator/delete/recreate, delayed ACP registration, failed-delete, and cancellation interleavings.

**Additional context**

A focused synchronization attempt found that protecting only agent construction and the manager cache is insufficient: ACP registration is a later publication point, and restoring state by a reused ID cannot prove that it belongs to the same row. This needs an agreed cross-layer identity and transaction boundary before implementation continues.

- [x] I have verified this does not duplicate an existing feature request

Do not begin implementation until the issue reaches **Ready** on the [Goose Issues board](https://github.com/orgs/aaif-goose/projects/1).

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.