You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to work on this bug. I plan to preserve the configured LocalFilesystemSpec when materializing a declarative ISOLATED subagent, keep its workspace separate, and use the configured namespace factory in the context-bound workspace path. I'll add regressions for inherited policy, custom spec behavior, and user/session isolation before preparing a focused PR.
This contribution will be developed with AI assistance under the account owner's authorization.
Confirmed on main, in HarnessAgentBuilderSupport.cloneLocalSpecForSubagent: it copies project, mode and additionalRoots, then builds a fresh LocalFilesystemSpec. So isolationScope, sharedLocalWorkspace, projectWritable, executeTimeoutSeconds, maxOutputBytes, env and inheritEnv all fall back to their defaults, and any overriding subclass is discarded in favour of the base type.
The consequence you describe follows directly: build() falls back to IsolationScope.USER, every path gains a userId prefix the parent never configured, and the parent's toFilesystem override stops applying to its own subagents.
What I would change:
add copy() to LocalFilesystemSpec that carries every field and keeps the concrete type (a protected newInstance() or a virtual copy()), so a cloned spec differs from its parent only in the workspace root;
have cloneLocalSpecForSubagent call it rather than hand-picking three fields — that way the next field added to the spec cannot be silently dropped again;
align the hardcoded ctxNs = uid -> List.of(uid) in workspaceFor with fsIsolationScope.toNamespaceFactory(), so the state/namespace layout matches the isolation scope that is actually configured.
Test: a parent with isolationScope(AGENT) plus non-default timeout and env → the spawned subagent exposes the same values, and the namespace factory yields no user prefix.
Two questions before I start, both about scope rather than about the bug:
Do you need the subclass itself preserved, or would copying the fields by name on the base type cover your case? Preserving the type is stricter and I would rather do it, but it is the part with more room for surprises.
I would like to take this one unless you are already on it.
Activity
wcy12378 commentedon Nov 6, 2026
I'd like to work on this bug. I plan to preserve the configured LocalFilesystemSpec when materializing a declarative ISOLATED subagent, keep its workspace separate, and use the configured namespace factory in the context-bound workspace path. I'll add regressions for inherited policy, custom spec behavior, and user/session isolation before preparing a focused PR.
This contribution will be developed with AI assistance under the account owner's authorization.
wahllllll commentedon Nov 7, 2026
Confirmed on
main, inHarnessAgentBuilderSupport.cloneLocalSpecForSubagent: it copiesproject,modeandadditionalRoots, then builds a freshLocalFilesystemSpec. SoisolationScope,sharedLocalWorkspace,projectWritable,executeTimeoutSeconds,maxOutputBytes,envandinheritEnvall fall back to their defaults, and any overriding subclass is discarded in favour of the base type.The consequence you describe follows directly:
build()falls back toIsolationScope.USER, every path gains auserIdprefix the parent never configured, and the parent'stoFilesystemoverride stops applying to its own subagents.What I would change:
copy()toLocalFilesystemSpecthat carries every field and keeps the concrete type (a protectednewInstance()or a virtualcopy()), so a cloned spec differs from its parent only in the workspace root;cloneLocalSpecForSubagentcall it rather than hand-picking three fields — that way the next field added to the spec cannot be silently dropped again;ctxNs = uid -> List.of(uid)inworkspaceForwithfsIsolationScope.toNamespaceFactory(), so the state/namespace layout matches the isolation scope that is actually configured.Test: a parent with
isolationScope(AGENT)plus non-default timeout and env → the spawned subagent exposes the same values, and the namespace factory yields no user prefix.Two questions before I start, both about scope rather than about the bug:
RemoteFilesystemSpec#sharedLocalWorkspaceasymmetry ([Bug]:read_file/list_files 无法读取应用服务写入工作区根目录的文件:default backend 命名空间前缀导致读写不对称 #3245) — shouldcopy()be defined symmetrically across both specs in the same change, or is the local one enough for now?I would like to take this one unless you are already on it.