a2aproject / a2aproject/a2a-dotnet

[Feat]: Better scoped `DistributedCacheTaskStore`

未关闭
#192 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
262
派生
64
平均合并
5 天 2 小时
30 天内合并 PR
31

描述

### 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

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。