docs: add curl/REST API respond-to-comment example workflow#28
Closed
captainsafia wants to merge 1 commit into
Closed
docs: add curl/REST API respond-to-comment example workflow#28captainsafia wants to merge 1 commit into
captainsafia wants to merge 1 commit into
Conversation
Add a self-contained example workflow that triggers when a PR comment mentions @oz-agent. Instead of using the oz-agent-action, it uses curl against the Oz REST API to spawn a cloud agent run, mirroring the prompting pattern of respond-to-comment.yml. The workflow reacts to the comment with an emoji, starts the run via POST /agent/runs, resolves the shared session via GET /agent/runs/{id}, replies on the PR with the session link, and posts a follow-up back into the triggered Oz session via POST /agent/runs/{id}/followups when needed. Co-Authored-By: Oz <oz-agent@warp.dev>
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
Adds a self-contained example GitHub Actions workflow,
examples/respond-to-comment-rest-api.yml, that triggers whenever a commentmentioning
@oz-agentis posted on a PR. Unlike the existingrespond-to-comment.yml, this example does not use thewarpdotdev/oz-agent-actionaction — it talks to the Oz REST API directly withcurland spawns a cloud agent run, mirroring the prompting pattern of theexisting workflow.
What it does
eyesemoji (acknowledgement).actions/github-script,reusing the same Context/Instructions structure as
respond-to-comment.yml.curl(POST /agent/runs) and captures therun_id. The prompt and config are assembled withjq(--rawfile/--arg)to avoid shell/JSON injection from comment bodies.
GET /agent/runs/{run_id}(with light polling).POST /agent/runs/{run_id}/followupswhen necessary, to relay extra GitHubcontext (e.g. the exact comment URL to reply to).
Setup notes (documented in the workflow header + README)
WARP_API_KEY.WARP_ENVIRONMENT_IDpointing at an Oz environment that hasthe repo checked out and
ghauthenticated, so the cloud agent can push changesand reply on GitHub.
WARP_API_BASE(defaults tohttps://app.warp.dev/api/v1) andWARP_AGENT_MODEL.The new example is intentionally not registered in
scripts/build-workflows.mjssince that generator wraps the action; running
npm run gen-workflowsleaves thegenerated
.github/workflows/andconsumer-workflows/directories unchanged.README documents the new example alongside the existing scenarios.
Testing
nodeYAML parse of the new workflow (parses, 7 steps).npm run gen-workflowsruns cleanly and produces no changes to generated dirs.npx prettier --checkpasses on the new workflow and README.Conversation: https://staging.warp.dev/conversation/053b43d7-6e7c-4a2e-bcde-c0d4498779ef
Run: https://oz.staging.warp.dev/runs/019ef6e7-bb9c-7860-82f2-83b7dcfe1e6f
This PR was generated with Oz.