Add webhook action executor (HTTP POST)#8
Merged
jaredzwick merged 1 commit intomainfrom May 3, 2026
Merged
Conversation
First concrete action executor: each Agent.actions entry is now a
typed JSON spec like {"type":"webhook", ...}. The webhook executor
POSTs payload to url with optional headers, surfaces non-2xx as a
structured error, and is fully covered by wiremock-backed tests so
no external services are required.
- src/executors/{mod.rs, webhook.rs}: typed Action enum + dispatch
- src/main.rs: new `pypes agent <NAME> run` CLI subcommand
- src/lib.rs: expose modules to examples and downstream crates
- examples/webhook_executor.rs: end-to-end demo with in-process mock
- examples/webhook.json: agent definition with one webhook action
- README: Action Executors → Webhook section + integration table flip
- CHANGELOG: Unreleased entry
Co-Authored-By: Paperclip <noreply@paperclip.ing>
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
Ships the first concrete action executor for
pypesdev/agentsso agents can finally act, not just store. Per HIR-110 (Tier 1 #2 of HIR-105).Agent.actionsstorage on disk is unchanged (Vec<String>); each entry is now interpreted as a typed JSONActionspec at execution time. Strings that don't parse fall through asUnrecognizedinstead of breaking the loop.webhook: HTTP POST a payload to a URL with optional headers; 2xx is success, anything else surfaces as a structuredNonSuccessStatuserror.pypes agent <NAME> runruns every stored action through the executor pipeline.wiremock— no external services required to runcargo test.What's in the diff
src/executors/mod.rs— typedActionenum (#[serde(tag = "type")]), dispatch loop, parse helpers + tests.src/executors/webhook.rs—WebhookAction+execute_webhook+WebhookError. Header passthrough is the extent of auth handling (per the issue's "out of scope").src/main.rs—AgentCommands::Runwires the executor to the CLI.src/lib.rs— new, so examples/downstream crates canuse pypes::executors.examples/webhook_executor.rs— end-to-end demo: spins up a tiny in-process axum receiver, runs the executor, prints the captured request.examples/webhook.json— minimal agent definition with one webhook action; pair withpypes agent webhook-demo run.README.md— new Action Executors → Webhook section + integration table flipped from experimental to shipped.CHANGELOG.md— Unreleased entry.Cargo.toml—reqwest(rustls, no native TLS) +wiremockdev-dep.Example output
Test plan
cargo build— clean.cargo test— 8 passed (4 new webhook executor + 2 new action parser + 2 pre-existing).cargo run --example webhook_executor— receives the POST and prints captured payload.pr_checkworkflow green.Out of scope (separate tickets)
🤖 Generated with Claude Code