GitHub PR coding agent workflow
Keep issue evidence, proposed diffs, test plans, approval, and GitHub side effects in one run graph.
Coding agents can change many files, open pull requests too early, or lose the reasoning and tests behind a change.
Repo tools, branch creation, PR creation, comments, audit, and approvals are usually spread across app code and provider logs.
Synapsor scopes repo/issue session values, records evidence and proposed diffs, requires maintainer approval before PR, and queues GitHub actions through the outbox.
Example names and seed ids are developer-defined. SESSION values are set by your backend. ARG values come from the SDK/HTTP call. Handles such as wrp://..., evidence://..., and agent-run://... are returned by Synapsor and should be stored for audit/replay.
Read the value-source guideThe coding framework still writes code, while Synapsor records issue -> evidence -> proposed diff -> tests -> approval -> PR.
Production checks
- repo_id and issue_id are trusted session fields.
- Opening a PR requires maintainer approval.
- GitHub actions are recorded as external action intents.
- Run graph preserves evidence, diff proposal, test plan, approval, and PR confirmation.
CREATE TABLE issues (
id TEXT PRIMARY KEY,
tenant_id TEXT NOT NULL,
repo_id TEXT NOT NULL,
title TEXT NOT NULL,
body TEXT NOT NULL
);CREATE AGENT WORKFLOW dev.pr_review_flow
SESSION REQUIRE tenant_id, principal, repo_id, issue_id
ALLOWED CAPABILITIES (
dev.analyze_issue,
dev.propose_code_change,
dev.summarize_diff,
dev.propose_test_plan
)
ALLOWED EXTERNAL ACTIONS (
github.create_branch,
github.open_pull_request,
github.comment_on_issue
)
AUTO BRANCH ON PROPOSAL
EVIDENCE REQUIRED
CHECKPOINT EVERY STEP
ON RISK medium REQUIRE APPROVAL ROLE 'maintainer';run = db.agent_runs.start(
workflow="dev.pr_review_flow",
input={"issue_id": "123", "user_request": "Fix issue #123"},
)
analysis = run.invoke_capability(
"dev.analyze_issue",
step_key="analyze_issue",
arguments={"issue_id": "123"},
response_envelope=True,
)
diff = run.invoke_capability(
"dev.propose_code_change",
step_key="propose_code_change",
mode="propose_only",
arguments={"issue_id": "123", "scope": "minimal_fix"},
response_envelope=True,
)