Skip to content

feat: pass workflow context as attachments#444

Open
captainsafia wants to merge 10 commits into
mainfrom
safia/many-tweaks
Open

feat: pass workflow context as attachments#444
captainsafia wants to merge 10 commits into
mainfrom
safia/many-tweaks

Conversation

@captainsafia
Copy link
Copy Markdown
Collaborator

Summary

  • Cleaned up the outer-loop skills around explicit Inputs, Process, and Outputs sections.
  • Removed cloud-mode-specific and artifact-CLI-specific verbiage from skills so they stay execution-form agnostic.
  • Added Oz SDK attachment helpers and propagated attachments through workflow dispatch, webhook runtime wiring, and the Oz client.
  • Converted large/untrusted workflow context from inline prompt content to run attachments.
  • Removed low-value tests that asserted on literal prompt prose while preserving behavior and dispatch coverage.

Input mapping changes

PR review agent

  • pr_description_text is now provided as pr_description.md.
  • pr_diff_text is now provided as pr_diff.txt.
  • spec_context_text is now provided as spec_context.md.

Issue triage agent

  • issue_body is now provided as issue_body.md.
  • original_report is now provided as original_issue_report.md.
  • comments_text is now provided as issue_comments.md.
  • triggering_comment_text is now provided as triggering_comment.md.
  • triage_config is now provided as triage_config.json.
  • template_context is now provided as issue_template_context.json.

Respond-to-PR-comment agent

  • spec_context_text is now provided as spec_context.md.
  • PR body, conversation comments, review comments, the triggering comment, and PR diff remain fetched on demand through fetch_github_context.py, matching the existing model for that workflow.

Verify-PR agent

  • verification_skills_text is now provided as verification_skills.md.

Create-spec agent

  • issue_body is now provided as issue_body.md.
  • comments_text is now provided as issue_comments.md.
  • triggering_comment_text is now provided as triggering_comment.md.

Create-implementation and plan-approved agents

  • spec_context_text is now provided as spec_context.md.
  • Issue body, prior comments, and triggering comments remain fetched on demand through fetch_github_context.py, matching the existing implementation workflow model.

Validation

  • python3 -m pytest tests/test_attachments.py tests/test_dispatch.py tests/test_oz_client.py tests/test_webhook_dispatch.py tests/test_workflow_adapters.py tests/test_builders.py tests/test_triage.py tests/test_review_pr_reviewer_sampling.py
  • python3 -m pytest tests
  • git diff --check

Notes

Co-Authored-By: Oz oz-agent@warp.dev

captainsafia and others added 3 commits May 7, 2026 17:51
Restructure outer-loop skills around inputs, process, and outputs, and remove cloud-mode-specific implementation verbiage so the skills stay execution-form agnostic.

Co-Authored-By: Oz <oz-agent@warp.dev>
Add shared attachment helpers, propagate attachments through workflow dispatch and Oz SDK calls, and convert workflow prompts to reference attached context files instead of inlining large GitHub-backed inputs.

Co-Authored-By: Oz <oz-agent@warp.dev>
Drop low-value tests that asserted on literal generated prompt prose while preserving behavior, routing, dispatch, and result-application coverage.

Co-Authored-By: Oz <oz-agent@warp.dev>
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@captainsafia

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR moves large workflow context into Oz run attachments and threads attachments through dispatch, webhook runtime, workflow prompts, and SDK client helpers.

Concerns

  • The result-file handoff was changed from explicit run artifact uploads to leaving files in the repository root, but the existing poll/apply code still loads named FILE artifacts from the run. This will prevent completed workflows from applying their review.json, triage_result.json, verification_report.json, or pr-metadata.json outputs unless artifact collection is updated or the upload instructions are restored.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread core/workflows/review_pr.py Outdated
The poller consumes file outputs via load_artifact() / load_review_artifact(),
which only polls FILE artifacts attached to the run. Leaving files at the
repository root means successful runs will not be applied.

Restores the 'oz artifact upload' (with 'oz-preview artifact upload' fallback)
instructions in all 7 locations across 5 workflow files:
- review_pr.py: review.json
- verify_pr_comment.py: verification_report.json + media artifacts
- create_spec_from_issue.py: pr-metadata.json
- respond_to_pr_comment.py: pr-metadata.json + resolved_review_comments.json
- triage_new_issues.py: triage_result.json
- create_implementation_from_issue.py: pr-metadata.json

Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia
Copy link
Copy Markdown
Collaborator Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 8, 2026

@captainsafia

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR moves large workflow context from inline prompts into Oz run attachments and threads attachment payloads through dispatch, webhook wiring, workflow adapters, and the SDK client.

Concerns

  • Triage dispatch now creates six attachments, but the Oz SDK/API attachment schema documents a maximum of five per run, so triage runs can be rejected before an agent starts.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread core/workflows/triage_new_issues.py Outdated
captainsafia and others added 3 commits May 11, 2026 13:11
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia
Copy link
Copy Markdown
Collaborator Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 11, 2026

@captainsafia

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR moves large workflow context into Oz run attachments and updates dispatch/runtime plumbing to pass those attachments through.

Concerns

  • Several updated skills still tell agents to read the pre-migration context filenames (pr_description.txt or issue_comments.txt) while the dispatch prompts now attach pr_description.md and issue_comments.md. That mismatch can make agents skip PR descriptions or issue comment context in the affected workflows.

Verdict

Found: 0 critical, 4 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread .agents/skills/create-product-spec/SKILL.md Outdated
Comment thread .agents/skills/create-tech-spec/SKILL.md Outdated
Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia
Copy link
Copy Markdown
Collaborator Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 11, 2026

@captainsafia

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR moves large workflow context into Oz run attachments and threads attachment payloads through dispatch, webhook, workflow prompts, and the Oz client.

Security

  • New workflow context attachments can contain issue bodies, comments, and generated repository context, but most of the new scratch attachment filenames are not ignored, which makes accidental commits of untrusted or sensitive workflow context more likely.

Concerns

  • The review state payload still retains raw pr_body even though the PR description is now attachment-backed.
  • The verification skill tells agents to leave supporting files in paths described by the report, but the report schema has no artifact/path field.

Verdict

Found: 0 critical, 1 important, 2 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread .gitignore
Comment thread core/workflows/review_pr.py
Comment thread .agents/skills/verify-pr/SKILL.md Outdated
Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia
Copy link
Copy Markdown
Collaborator Author

/oz-review

@captainsafia
Copy link
Copy Markdown
Collaborator Author

@vkodithala @peicodes I'm making this change to move us from embedding certain context directly in the prompt to using Oz's attachment functionality to resolve it. This should help make the prompts that we pass to the agent more concise and let the harness resolve additional information using attachments.

Comment thread oz/attachments.py
Comment on lines +39 to +43
__all__ = [
"DEFAULT_TEXT_ATTACHMENT_MIME_TYPE",
"SdkAttachment",
"text_attachment",
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOC/for future reference: noticed that you're explicitly listing exports here, is this the pattern you're adopting for module files created in oz-for-oss, or is there a particular reason that you use __all__ here (since everything's exported)? Unimportant, but curious :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has mostly helped me with bookkeeping with of the methods defined here are actually referenced as a public surface area by the workflows. It's not the biggest value add since everything is publicly exported in this module anyways. I find it helps me with readability and identifying the key highlights from agent-generated code but we can remove it if it becomes crufty.

Copy link
Copy Markdown

@vkodithala vkodithala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read through your plan and went through the important codepaths, LGTM! Thanks for the fix!

Comment thread oz/attachments.py Outdated
Comment thread core/workflows/attachments.py Outdated
Co-Authored-By: Oz <oz-agent@warp.dev>
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.

2 participants