a2aproject / a2aproject/a2a-dotnet
[Feat]: Better scoped `DistributedCacheTaskStore`
- Lingua principale
- C#
- Stelle
- 262
- Fork
- 64
- Merge medio
- 5g 2h
- PR unite (30g)
- 31
Descrizione
### Is your feature request related to a problem? Please describe.
I would like some way to make `DistributedCacheTaskStore` scoped to an organization or a user.
We are building an application that will host multiple agents for multiple organizations / users.
I would like some way of scoping some tasks to an organization / user. A simple way of doing this is make this service `Scoped` and configure it something like `BuildTaskCacheKey(string taskId) => $"{httpContext. GetOrganization()}::task:{taskId}";`.
### Describe the solution you'd like
Allow some way to overwrite
```
static string BuildTaskCacheKey(string taskId) => $"task:{taskId}";
static string BuildPushNotificationsCacheKey(string taskId) => $"task-push-notification:{taskId}";
```
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Find the DistributedCacheTaskStore class and its static BuildTaskCacheKey and BuildPushNotificationsCacheKey methods. Understand how the cache keys are currently used. The change likely involves making these methods virtual or adding a scoping delegate. Check for existing scoping patterns in the project, such as how organization/user context is obtained (e.g., from IHttpContextAccessor). Verify by running any existing tests related to caching.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- api, backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100