Support multiple artifact directories per invocation#38
Merged
jackcbrown89 merged 2 commits intomainfrom Apr 30, 2026
Merged
Conversation
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.
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.
Summary
artifacts_dirs: string[]toInvocationMessageandCommandExecutionMessageso a single invocation/command-execution can declare multiple artifact directories. The underlyingArtifactManageralready supported multiple watched directories per session — this change just opens up the wire.artifacts_diris kept and marked@deprecated, with a one-linelogger.warnwhen it's used.collectArtifactDirs()insession.tsmerges and dedupes.artifacts_dirs: list[str] | NoneonQueryOptionsandExecuteCommandsOptions. Pairing rule withon_artifact_upload_requestis preserved (empty list =None). The duplicated__post_init__validation across the two dataclasses is extracted to_validate_artifact_pairing.python-client.mdx, both package READMEs.Test plan
vitest runinpackages/runtimeuse— 149 tests pass, including 4 new tests covering multi-dir, the deprecated singular field, and dedup of overlapping fields.pytest test/test_client.pyinpackages/runtimeuse-client-python— 58 tests pass, including new tests asserting thatartifacts_dirsis forwarded to bothinvocation_messageandcommand_execution_messageand thatartifacts_diris no longer sent.pytest test/e2e/— 37 tests pass, including a newtest_multiple_artifacts_dirs_in_single_invocationthat has a pre-agent command write to one directory and the agent write to another within a single invocation, then asserts both files upload.Note
Medium Risk
Touches the cross-language wire format for artifact uploads and changes the Python public API from
artifacts_dirtoartifacts_dirs, so mismatched client/runtime versions could break artifact watching despite runtime backward compatibility.Overview
Adds multi-directory artifact watching by introducing
artifacts_dirson bothInvocationMessageandCommandExecutionMessage, and updating the TypeScript runtime to merge/dedupeartifacts_dirswith the deprecated legacyartifacts_dir(emitting a warning when the old field is used).Updates the Python client API to replace
artifacts_dirwithartifacts_dirs: list[str] | NoneforQueryOptions/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 to0.14.2.Reviewed by Cursor Bugbot for commit c4af077. Bugbot is set up for automated code reviews on this repo. Configure here.