feat(sisyphus-task): add workdir parameter to constrain spawned agents #693
+411
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add
workdirparameter tosisyphus_tasktool to constrain spawned agents to specific directories. Enables orchestrators to delegate work to git worktrees or project subdirectories with strict boundary enforcement. This allows users to orchestrate in parallel with worktrees being enforced without files being created or edited outside of the tree and having to be fixed after-the-fact.Changes
workdirparameter toSisyphusTaskArgsinterface and tool schema (optional string)buildSystemContent()to include<Workdir_Context>block in system content for sync/background tasksbuildPromptWithWorkdir()helper to prepend workdir context to resume promptsSISYPHUS_TASK_DESCRIPTIONand tool schema with workdir usage and requirementsNote: the
workdirsupports Windows-absolute paths when the plugin runs on Windows (and intentionally rejects Windows-style paths on non-Windows where they can’t resolve), so this isn’t an issue in practice I believe.Testing
bun run typecheck bun test src/tools/sisyphus-task/tools.test.tsAll 29 tests pass.
Manual Validation
Prompt for agent:
Expected results:
Related Issues
Summary by cubic
Adds an optional workdir parameter to sisyphus_task to confine spawned agents to a specific directory. This enforces project/worktree boundaries for sync, background, and resume flows, preventing file changes outside the target.
Written for commit 8d1efb7. Summary will update on new commits.