Auto-add unique runId/index suffix to default output paths#226
Open
smithyyang wants to merge 2 commits into
Open
Auto-add unique runId/index suffix to default output paths#226smithyyang wants to merge 2 commits into
smithyyang wants to merge 2 commits into
Conversation
When no explicit `output` is passed in the subagent call and the output comes from the agent config default (e.g. `output: /tmp/research.md`), the framework now appends `_<runId>_<index>` to prevent collisions in parallel execution and avoid hardcoded-path confusion. - Foreground single: suffix added when `params.output` is undefined - Foreground parallel: suffix added per task when no task-level override - Async single + async chain: same logic - Progress tracks alongside output in the same directory Progress path is `.progress_<runId>/progress.md` (same directory); a follow-up could use `progress_<runId>.md` for consistency. Related: nicobailon#220, nicobailon#223, nicobailon#224
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem: When subagent output comes from agent config default (e.g.
output: /tmp/research.md), parallel tasks write to the same path, and the model may follow hardcoded prompt filenames instead of the runtime output override.Fix: When output is from agent default (no task-level override), auto-append
_<runId>_<index>to the filename at runtime./tmp/research.md→/tmp/research_abc123_0.mdoutput: "/tmp/custom.md"stays exact (not modified).progress_<runId>/progress.mdunder the same directoryAffects: foreground single, foreground parallel, async single, async chain — all execution paths.
Validation: 3-researcher parallel run produced
/tmp/research_b90ae4e0_0.md,_1.md,_2.mdwithout conflict.No
~/pollution. All files in/tmp/.Follow-up: progress naming could use
progress_<runId>.mdfor consistency (currently uses hidden subdirectory).