Skip to content

Auto-add unique runId/index suffix to default output paths#226

Open
smithyyang wants to merge 2 commits into
nicobailon:mainfrom
smithyyang:fix-output-unique-suffix
Open

Auto-add unique runId/index suffix to default output paths#226
smithyyang wants to merge 2 commits into
nicobailon:mainfrom
smithyyang:fix-output-unique-suffix

Conversation

@smithyyang
Copy link
Copy Markdown

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.md
  • Unique per task, chain step, or async run
  • Explicit output: "/tmp/custom.md" stays exact (not modified)
  • Progress tracks in .progress_<runId>/progress.md under the same directory

Affects: 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.md without conflict.
No ~/ pollution. All files in /tmp/.

Follow-up: progress naming could use progress_<runId>.md for consistency (currently uses hidden subdirectory).

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high Important user-facing bug or high-value maintenance item ready-for-human Needs human implementation or product/design judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants