Skip to content

fix(harness): isolate subagent task handles by storage namespacee - #4043

Merged
juruoO-o merged 1 commit into
agentscope-ai:mainfrom
yin-bo-Final:fix/subagent-task-namespace-isolation
Nov 11, 2026
Merged

juruoO-o merged 1 commit into
agentscope-ai:mainfrom
yin-bo-Final:fix/subagent-task-namespace-isolation

Conversation

@yin-bo-Final

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

When users a and b shared a task repository and used the same parent session ID,
b could look up or cancel a's background task if b knew its task ID. The workspace
kept their persisted records separate, but the local cache only checked the
session ID and task ID.

This change includes the task storage namespace in the local cache key. Task
lookup, cancellation, recovery, and maintenance now follow the same isolation
rules as the stored records. Workspaces configured to share tasks still do so.

Added regression tests for cross-user lookup and cancellation, shared workspaces,
anonymous users, and remote task recovery.

To run the focused tests:

mvn -pl agentscope-harness -am "-Dtest=WorkspaceTaskRepository*Test" "-Dsurefire.failIfNoSpecifiedTests=false" test

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@mintlify

mintlify Bot commented Nov 7, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 8e8a22d.

Approve preview

@jujn jujn added the P0 重要紧急 label Nov 10, 2026

@juruoO-o juruoO-o left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缓存键按实际任务存储 namespace、sessionId 和 taskId 组合,查询、列表、取消、远程恢复及维护路径保持一致;显式共享工作区的行为得以保留,持久化格式不变。针对当前 head 与 main 的合并结果,先前本地 WorkspaceTaskRepositoryNamespaceTest 14 项全部通过。本轮复核 head 未变,未发现阻塞问题。

@juruoO-o
juruoO-o merged commit e6a4229 into agentscope-ai:main Nov 11, 2026
7 checks passed
chickenlj added a commit that referenced this pull request Nov 13, 2026
)

Source: e6a4229
Candidate: 9221b57c85b2f3d4b15a453a621150d8afbee026
Union-Of: execution53+skill-union(810c7d7) + tasks-standalone(511fd8a5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P0 重要紧急

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants