Skip to content

spec: support configurable template formats for Oz responses#361

Open
oz-for-oss[bot] wants to merge 5 commits intomainfrom
oz-agent/spec-issue-347
Open

spec: support configurable template formats for Oz responses#361
oz-for-oss[bot] wants to merge 5 commits intomainfrom
oz-agent/spec-issue-347

Conversation

@oz-for-oss
Copy link
Copy Markdown

@oz-for-oss oz-for-oss Bot commented Apr 26, 2026

Summary

  • add a product spec for configurable Oz workflow comment templates in .github/oz/config.yml
  • add a tech spec for a workflow_comments section, a centralized template registry, and helper/script refactors
  • scope the first release to workflow-owned deterministic response text while leaving model-authored prose out of config

Validation

Notes

  • no open product questions remain for the first release; model-authored prose stays out of scope

Co-Authored-By: Safia Abdalla <captainsafia@users.noreply.github.com>
@oz-for-oss
Copy link
Copy Markdown
Author

oz-for-oss Bot commented Apr 26, 2026

@oz-for-oss[bot]

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

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Powered by Oz

Copy link
Copy Markdown
Author

@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 adds product and tech specs for configurable workflow_comments in .github/oz/config.yml, centered on a shared template registry, strict validation, and preserving current behavior when no overrides are configured.

Concerns

  • The tech spec's migration target list still omits several deterministic workflow-owned comment surfaces that remain hardcoded outside helpers, so the scoped implementation would not yet satisfy the product claim that current hardcoded workflow comment copy becomes configurable.
  • The Next steps design only templates the section heading while leaving the actual step text hardcoded in workflow entrypoints, which keeps some of the most repository-specific workflow guidance out of config.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Powered by Oz

Comment thread specs/GH347/tech.md Outdated
Comment thread specs/GH347/tech.md
Copy link
Copy Markdown
Collaborator

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

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

@oz-agent Let's make the following tweaks to the spec.

Comment thread specs/GH347/product.md Outdated
Comment thread specs/GH347/product.md
Comment thread specs/GH347/tech.md Outdated
Comment thread specs/GH347/tech.md Outdated
Comment thread specs/GH347/tech.md
@oz-for-oss
Copy link
Copy Markdown
Author

oz-for-oss Bot commented Apr 26, 2026

@captainsafia

I'm working on changes requested in this PR (responding to a PR review body). Spec context was found and will be used to ground the change.

You can view the conversation on Warp.

I pushed changes to this PR based on the comment.

Replied to and attempted to resolve 5 review comments that this run addressed.

Next steps:

  • Review the changes pushed to this PR.
  • Follow up with another comment if further adjustments are needed.

Powered by Oz

Co-Authored-By: Safia Abdalla <captainsafia@users.noreply.github.com>
@captainsafia captainsafia added the plan-approved Indicates that the plan associated with this PR has been approved. label Apr 26, 2026
Co-Authored-By: Safia Abdalla <captainsafia@users.noreply.github.com>
@captainsafia
Copy link
Copy Markdown
Collaborator

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Author

oz-for-oss Bot commented Apr 26, 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 posted feedback on this pull request.

Powered by Oz

Copy link
Copy Markdown
Author

@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 adds a centralized workflow comment template registry, extends .github/oz/config.yml loading to support workflow_comments, routes several existing helper/entrypoint strings through the new renderer, and adds specs, docs, and targeted tests for the new configuration surface.

Concerns

  • The first-release template surface is still incomplete. Several deterministic workflow-owned completion/no-op messages remain hardcoded outside workflow_comments, so repositories still cannot fully customize the core progress-comment copy promised by the product/tech specs. Examples include create_spec_from_issue.py:201, create_implementation_from_issue.py:245, respond_to_pr_comment.py:309, and the review completion/no-op paths in review_pr.py:432-446 and review_pr.py:738.
  • The render-time Missing placeholder values... error omits the resolved config path, which makes broken overrides harder to trace than the README/spec contract suggests.

Verdict

Found: 0 critical, 1 important, 1 suggestions

Request changes

Powered by Oz

Comment thread specs/GH347/tech.md

#### 2a. Enumerate the first-release template registry

The first release should explicitly register every deterministic user-visible string that is currently hardcoded in helpers or workflow entrypoints, rather than leaving implementers to rediscover them during coding. The initial namespace/key set should be documented in the new module and reflected in README examples.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This first-release registry still falls short of the product goal to make core workflow completion copy configurable. The implementation in this PR leaves several deterministic completion/no-op messages hardcoded outside workflow_comments — for example create_spec_from_issue.py:201, create_implementation_from_issue.py:245, respond_to_pr_comment.py:309, and review_pr.py:432-446 / review_pr.py:738. Repositories would still need to fork Python to change those responses, so the surface list here should either add those keys or narrow the promised coverage.

name: str(value)
for name, value in (context or {}).items()
}
missing = sorted(name for name in placeholders if name not in normalized_context)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

💡 [SUGGESTION] The other validation failures include the resolved .github/oz/config.yml path, but this render-time error does not. If a repo override uses an allowed placeholder that the caller forgot to supply, the maintainer only sees namespace.key, which is harder to trace than the README/spec contract implies. Consider including the resolved config path in this exception when the selected template came from workflow_comments.

… registry

Add missing completion/no-op template keys to the registry and route
all previously hardcoded entrypoint strings through render_comment_template:
- create-spec-from-issue.complete_no_diff
- create-implementation-from-issue.complete_no_diff
- respond-to-pr-comment.complete_no_diff
- review-pull-request.complete_no_feedback / complete_approved_with_reviewers /
  complete_approved_no_reviewers / complete_changes_requested / complete_commented

Also include the resolved config path in the render-time missing-placeholder
error when the template came from a workflow_comments override, and update
the tech spec to enumerate all first-release keys including the completion paths.

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

Addressed the review feedback:

Hardcoded workflow comments moved to template registry:

  • create-spec-from-issue.complete_no_diff — "I analyzed this issue but did not produce a spec diff." (was hardcoded at create_spec_from_issue.py:201)
  • create-implementation-from-issue.complete_no_diff — "I analyzed this issue but did not produce an implementation diff." (was hardcoded at create_implementation_from_issue.py:245)
  • respond-to-pr-comment.complete_no_diff — "I analyzed the request but did not produce any changes." (was hardcoded at respond_to_pr_comment.py:309)
  • review-pull-request.complete_no_feedback — no-feedback no-op path (was hardcoded at review_pr.py:738)
  • review-pull-request.complete_approved_with_reviewers — uses ${reviewer_mentions} placeholder
  • review-pull-request.complete_approved_no_reviewers
  • review-pull-request.complete_changes_requested
  • review-pull-request.complete_commented

The _format_review_completion_message() helper in review_pr.py now delegates to render_comment_template() for all four review completion variants.

Config path in render-time errors: When a template was configured via workflow_comments and a caller fails to supply a placeholder value, the error now includes the resolved .github/oz/config.yml path (matching the format used by all other config validation errors). Default-template missing-placeholder errors are unchanged.

Spec updated: specs/GH347/tech.md section 2a now enumerates all first-release keys including the completion/no-op paths and ${reviewer_mentions} in the placeholder list.

@captainsafia
Copy link
Copy Markdown
Collaborator

@oz-agent Resolve the merge conflicts in this PR.

@oz-for-oss
Copy link
Copy Markdown
Author

oz-for-oss Bot commented Apr 27, 2026

@captainsafia

I'm working on changes requested in this PR (responding to a PR conversation comment). Spec context was found and will be used to ground the change.

You can view the conversation on Warp.

I pushed changes to this PR based on the comment.

Next steps:

  • Review the changes pushed to this PR.
  • Follow up with another comment if further adjustments are needed.

Powered by Oz

Co-Authored-By: Safia Abdalla <captainsafia@users.noreply.github.com>
@captainsafia
Copy link
Copy Markdown
Collaborator

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Author

oz-for-oss Bot commented Apr 27, 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 posted feedback on this pull request.

Powered by Oz

Copy link
Copy Markdown
Author

@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 introduces the new workflow_comments config surface, adds a centralized template registry and render path across the workflow scripts, expands unit coverage, and documents/specifies the new override model.

Concerns

  • The new product spec/example and placeholder guidance imply that create-spec-from-issue.complete_created can interpolate ${spec_preview_markdown} and ${next_steps_markdown}, but the shipped implementation currently validates that template against allowed_placeholders=("pr_url",) only. A maintainer who copies the documented example will get a config-validation failure instead of the advertised behavior.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Powered by Oz

Comment on lines +202 to +204
"complete_created",
"I created a new [spec PR](${pr_url}) for this issue.",
allowed_placeholders=("pr_url",),
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] The new product spec/example now shows create-spec-from-issue.complete_created embedding ${spec_preview_markdown} and ${next_steps_markdown}, but this allowlist only permits pr_url. Copying that documented config currently fails validation instead of working. Either expose those placeholders here (and pass them from the caller) or update the spec/docs to describe the shipped surface as separate shared.spec_preview / shared.next_steps_section overrides.

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

Labels

plan-approved Indicates that the plan associated with this PR has been approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants