Skip to content

feat(tools): Persist skill-script outputs as artifacts - #6675

Open
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:feat/skill-script-auto-artifacts
Open

feat(tools): Persist skill-script outputs as artifacts#6675
a2105z wants to merge 1 commit into
google:mainfrom
a2105z:feat/skill-script-auto-artifacts

Conversation

@a2105z

@a2105z a2105z commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Skill scripts materialize into a tempdir that is deleted after execution, so generated files (PDFs, exports, images) were lost.
  • The skill wrapper now walks the tempdir after the script runs, emits new files (excluding packaged skill resources / __pycache__) via a stdout marker, and RunSkillScriptTool saves them with tool_context.save_artifact.
  • Tool results include saved_artifacts when persistence succeeds.

Fixes #5579

Test plan

  • Unit tests for marker extraction, save path, shell envelope + marker, missing artifact service
  • Integration tests with UnsafeLocalCodeExecutor + InMemoryArtifactService (save + no re-save of skill resources)
  • Full test_skill_toolset.py (135 passed) + path traversal tests
  • Pre-commit on touched files

Skill scripts wrote files into a TemporaryDirectory that was deleted after
execution, so generated PDFs/exports were lost. Capture new files from the
script workspace, save them via tool_context.save_artifact, and return
saved_artifacts in the tool result.

Fixes google#5579
@a2105z

a2105z commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Hi @klateefa @GWeale @DeanChensj — ready for review when you have a moment.

This implements #5579: skill scripts that write files (reports/PDFs/exports) now have those outputs auto-saved as session artifacts, with saved_artifacts returned on the tool result. Packaged skill resources are excluded; __pycache__ / oversized files are skipped.

@a2105z

a2105z commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@xuanyang15 -> ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Support automatic artifact storage for files generated by skill toolset scripts

3 participants