Skip to content

Support multiple artifact directories per invocation#38

Merged
jackcbrown89 merged 2 commits intomainfrom
worktree-jb-multiple-artifact-dirs
Apr 30, 2026
Merged

Support multiple artifact directories per invocation#38
jackcbrown89 merged 2 commits intomainfrom
worktree-jb-multiple-artifact-dirs

Conversation

@jackcbrown89
Copy link
Copy Markdown
Contributor

@jackcbrown89 jackcbrown89 commented Apr 30, 2026

Summary

  • Add artifacts_dirs: string[] to InvocationMessage and CommandExecutionMessage so a single invocation/command-execution can declare multiple artifact directories. The underlying ArtifactManager already supported multiple watched directories per session — this change just opens up the wire.
  • TS runtime accepts both fields during a transition: the legacy singular artifacts_dir is kept and marked @deprecated, with a one-line logger.warn when it's used. collectArtifactDirs() in session.ts merges and dedupes.
  • Python client cuts over cleanly to artifacts_dirs: list[str] | None on QueryOptions and ExecuteCommandsOptions. Pairing rule with on_artifact_upload_request is preserved (empty list = None). The duplicated __post_init__ validation across the two dataclasses is extracted to _validate_artifact_pairing.
  • Docs updated: python-client.mdx, both package READMEs.

Test plan

  • vitest run in packages/runtimeuse — 149 tests pass, including 4 new tests covering multi-dir, the deprecated singular field, and dedup of overlapping fields.
  • pytest test/test_client.py in packages/runtimeuse-client-python — 58 tests pass, including new tests asserting that artifacts_dirs is forwarded to both invocation_message and command_execution_message and that artifacts_dir is no longer sent.
  • pytest test/e2e/ — 37 tests pass, including a new test_multiple_artifacts_dirs_in_single_invocation that has a pre-agent command write to one directory and the agent write to another within a single invocation, then asserts both files upload.
  • Run advanced LLM tests against live providers if you want to verify there too — kwarg renamed, no behavioral change.

Note

Medium Risk
Touches the cross-language wire format for artifact uploads and changes the Python public API from artifacts_dir to artifacts_dirs, so mismatched client/runtime versions could break artifact watching despite runtime backward compatibility.

Overview
Adds multi-directory artifact watching by introducing artifacts_dirs on both InvocationMessage and CommandExecutionMessage, and updating the TypeScript runtime to merge/dedupe artifacts_dirs with the deprecated legacy artifacts_dir (emitting a warning when the old field is used).

Updates the Python client API to replace artifacts_dir with artifacts_dirs: list[str] | None for QueryOptions/ExecuteCommandsOptions, forwards the new field on the wire, and refactors the “artifacts + callback must be paired” validation into a shared helper (treating [] as disabled). Docs and tests are updated, including new coverage for multi-dir uploads and deprecated-field compatibility; versions are bumped to 0.14.2.

Reviewed by Cursor Bugbot for commit c4af077. Bugbot is set up for automated code reviews on this repo. Configure here.

Add `artifacts_dirs: string[]` to `InvocationMessage` and
`CommandExecutionMessage`. The TS runtime accepts both fields during a
transition (the legacy singular `artifacts_dir` is marked deprecated and
logs a warning); the Python client cuts over cleanly to
`artifacts_dirs: list[str] | None` on `QueryOptions` and
`ExecuteCommandsOptions`. The underlying `ArtifactManager` already
supported multiple watched directories per session, so this change just
opens up the wire so a single invocation can declare more than one.
@jackcbrown89 jackcbrown89 merged commit b84e1b0 into main Apr 30, 2026
6 checks passed
@jackcbrown89 jackcbrown89 deleted the worktree-jb-multiple-artifact-dirs branch April 30, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant