Agent Sessions is in private preview. The feature is enabled per workspace by the Orq.ai team and the API is not part of the public SDKs yet. Behavior and field names can still change.
Triggers and actions
GitHub events reach the platform through the GitHub App webhook.
POST /v2/loops/{loop_id}/trigger fires a loop manually with caller-supplied variables, which is also how the generic webhook adapter works.
Repository tokens come from the GitHub App installation on the factory’s connection. Write access asks for contents: write and pull_requests: write, plus issues: write once the installation has accepted it; without it the agent cannot comment on issues. When the App asks for a permission the installation has not accepted, Integrations shows Accept the App’s new permissions on GitHub, and the connection’s menu links to the page on GitHub where its owner accepts it.
Runs, queue and limits
Every invocation is recorded as an loop run. A run moves throughqueued → running → completed or failed, or is recorded as skipped without a session.
Loop.limits controls how invocations turn into sessions:
Disabling a loop leaves its queued runs waiting until it is enabled again; deleting it fails them. A run whose session never starts within 40 minutes, or whose session run ended without the control plane noticing, is settled by the reconcile sweep.
The Activity view under the loop lists queued, running, completed, failed and skipped runs with their linked sessions and posted reviews; the loop row shows how many runs are queued and running and a 30-day sparkline of daily invocations.
GET /v3/factories/{factory_id}/loops/activity returns the same counts per loop.
Pull-request reviews
The Code review and Security audit templates setaction.post_review. For such loops the run prompt is extended with an output contract, and when the repository contains a REVIEW.md at its root (read at the pull request’s head ref), its content is added to the prompt as the repository’s review guidelines.
The agent ends its final message with a JSON block:
The block is parsed leniently (last fenced JSON block, bare object or bare array). Findings are stored on the run and posted as one pull-request review through the GitHub App: findings with a file and line become inline comments, the rest go into the review body, and when GitHub rejects a line outside the diff the review is re-posted with every finding folded into the body. Free-text final messages without a JSON block are posted as the review summary.
With
action.auto_fix, a review with at least one finding above info continues the same session with the findings to fix; when that run completes, the platform commits the workspace and pushes fix: apply review findings to the pull-request branch (same-repository branches only). The review URL and fix commit appear on the run. Merging stays a human decision.
Reviews require a GitHub repository credential from the GitHub App installation on the factory’s connection. GitLab merge-request discussions are not supported yet; loops that post reviews on GitLab repositories fail with an explanatory error.