Repository navigation
Description
Problem
At dev-vibecoded commit 897e85177c03b0dfb8618e1f3cf09250a9cbebe6, a delegated task cannot select its own working folder. Relative file-tool paths and the system prompt use the instance/project directory even when independent child tasks should work in different folders.
A folder selection must change path resolution, not authorization. It must not reroot the instance or approval store, change the process cwd, or weaken restrictions inherited from an ancestor.
Required behavior
- Add optional
task.directory; resolve relative requests from the calling session's folder and inherit that folder when omitted. - Require an existing directory. Expand only
~. Canonicalize the selected folder, including symlinks/junctions, before recording it. - Persist the folder on the child session. Foreground, background and resumed execution use that record. Reject an explicit different folder on resume; legacy sessions without a selection retain their creation directory.
- Resolve relative
read,grep,glob,edit,writeandapply_patchpaths, and default search roots, from the session folder. Report the selected folder and the unchanged project directory separately in the prompt. - Keep
external_directorychecks anchored to the instance. Selecting an external folder adds no allow rule. Preserve ancestor denies and existing allowed external grants; isolate parents and siblings, including nested and ancestor-relative selections. - Use platform path rules: Windows drive-absolute and UNC paths are absolute; drive-relative (
C:folder) and drive-rooted (\folder) requests are rejected rather than resolved from ambient process state. Compare Windows case spellings consistently.
Shell integration is a separate, unfinished acceptance item
The shell tool still needs a coordinated change to use the session folder for both its default cwd and the base of a relative workdir. Today both use the instance directory. An explicit absolute shell workdir remains subject to existing external-directory checks.
Do not describe file-tool support as completion of shell cwd support. Shell and permission-policy changes must be coordinated with their current owner rather than edited concurrently.
Verification required
- Real task/session and tool regressions for inheritance, sibling isolation, fixed-on-resume behavior, legacy rows, canonical paths and prompt reporting.
- Permission controls proving no new grant from selection, retained external allows, and no escape from ancestor denies.
- Linux execution plus actual Windows CI execution of drive/case/junction behavior. Platform-spelling simulations or Linux-skipped Windows tests are not Windows execution evidence.
- Package typecheck and the unchanged full package test command. Any failure must be compared with the same command and test-list prefix on the exact base before attributing it to pre-existing behavior; no assertion, timeout, test-list or isolation waiver.
- Preserve unrelated accepted changes when integrating the implementation.
An implementation may publish the file-tool portion as a draft while explicitly leaving the shell acceptance item unfinished. Such a partial PR should reference this issue without closing it.
Activity
test(opencode): use native absolute paths on Windows (Refs #779)
fix(opencode): keep child folder prompts truthful about shell cwd (Refs
style(opencode): keep the shell-cwd prompt correction narrow (Refs #779)
docs(opencode): preserve the shell cwd snippet (Refs #779)
test(opencode): align workdir test suites with dev-vibecoded (Refs #779)
fix(opencode): classify incomplete/multi-slash win32 workdir prefixes…
Merge dev-vibecoded into delegated working folders (Refs #779)