From Slack Thread to Pull Request the Anatomy of a Managed Agent Round Trip
Managed agents close the loop only when the environment is right.

To run Claude Code in the cloud without managing infrastructure, teams can use Anthropic-managed VMs that execute tasks independently of a developer’s laptop. A managed agent round trip connects that execution to a trigger, repository clone, code changes, tests, and a reviewable pull request. The decisive choice is the environment around the agent, because closing the loop reliably requires suitable configuration, permissions, and review controls.
What a managed agent round trip actually is, and why it matters
A managed round trip is a delegation boundary. The developer hands over a task rather than supervising each command, and the platform returns an artifact that can be reviewed. That distinguishes an asynchronous coding agent from an interactive copilot, whose work remains tied to a developer’s ongoing session. The agent is a delegate. Its useful output is a proposed change that has passed through an execution and validation process.
The loop is closed when work passes from each stage to the next without a person having to step in before review. An agent that writes code but needs someone to install a missing dependency has not completed the round trip autonomously. Neither has one that leaves a developer to reconstruct its work before opening a pull request. When those handoffs work, tasks can run in parallel, survive a closed laptop, and reserve developer attention for review.
Stage one: how a Slack message, Linear ticket, or GitHub event becomes an agent task
The trigger determines which existing work can enter the loop. A Slack message can supply a request, a Linear ticket can supply a tracked issue, and a GitHub event can initiate work around repository activity. Schedules and webhooks can also start work without an explicit message. No new work queue is inherently necessary. The practical distinction between platforms is how much of the team’s existing workflow they can accept as input.
A trigger must provide more than a signal to start. It passes forward the task description and linked context, which may include an issue body, a Sentry error, or a pull request comment. The platform also brokers the credentials or repository access needed for execution. Those inputs connect the request to the environment that will act on it. A missing credential can stop the task before the agent reads any code.
Codex supports scheduled tasks and GitHub-event triggers, while Claude Code routines can run on a schedule. The loop can therefore open while the team sleeps.
Stage two: the isolated VM spins up and the repository lands inside it
Each task receives a fresh, isolated execution environment. The VM or container is scoped to that task and contains what the agent needs without touching the developer’s machine. The repository is cloned at task submission, so the starting point is its state at that instant, excluding a developer’s local changes. Isolation establishes a clean boundary around execution. The agent needs a properly configured environment to do the work inside it.
OpenAI runs each Codex cloud task on its own VM, started from a prepared cloud environment. Setup scripts install dependencies with network access, but the agent phase runs with internet access off by default. Teams can enable that access per environment. This choice of how to host the agent also involves a security tradeoff. An offline agent cannot fetch a missing package midway through a task, so preparation has to account for the work it will perform.
Environment variables, network secrets, and setup scripts must be declared in advance. Codex’s reusable environment model and Claude Code’s cached setup scripts make that preparation reusable across runs. Codex also retains task files, including uncommitted changes, recoverable for up to seven days after the last turn. Execution location is another environment choice. Anthropic lets Team and Enterprise organizations run Claude Code cloud sessions in self-hosted environments on their own servers, and Cursor has self-hosted workers that run tasks inside the network.
Stage three: the agent reads the codebase, plans, and writes changes across files
Once the repository is available, the agent must understand enough of it to produce coherent changes across files. Claude Code reads the codebase before it makes edits and follows the project instructions in a CLAUDE.md file. Its context therefore includes both the task and the repository’s stated conventions. Reading precedes writing for a reason. A change that touches several files depends on understanding how those files relate.
Some systems expose a checkpoint between understanding and execution. Jules produces an execution plan that a team can review and edit before it runs. Context can also extend beyond the repository. Linear Agent uses MCP, or Model Context Protocol, to gather evidence from tools such as Sentry or Datadog and inspect the codebase to trace the root cause.
The environment sets limits on what the agent can investigate and then run. Claude Code has shell-command allow and deny rules in settings.json, where deny rules take precedence, and teams can use an optional sandbox to limit what commands can reach. These controls are needed because the agent cannot trust everything in the repository as an instruction. Issues, README files, comments, dependency metadata, webpages, and tool output can expose an agent to indirect prompt injection. Sandboxing and deterministic controls for high-consequence actions constrain what hostile content can cause, rather than relying on the agent to recognize every attempt.
Stage four: the test suite runs inside the same VM, and failures feed back into the loop

Tests run in the same isolated environment before the pull request is opened. Their results become evidence the agent can act on, rather than a verdict left for someone else to interpret. On failure, the agent reads the output, reasons about the cause, amends the code, and reruns the tests. This is the loop within the loop. It distinguishes managed execution from a code-generation call that ends when the proposed code is written.
That feedback depends on a runnable test environment. Because Codex’s agent phase is offline by default, tests can reach external services only if internet access has been enabled for the environment. A test suite that requires those services cannot validate the change merely because the agent produced plausible code. Teams must therefore set up tests to run offline or enable the network access they need.
Feedback can continue after the pull request exists. Jules automatically detects and fixes CI failures on pull requests it creates, while Claude Code’s auto-fix option watches a pull request and responds to CI failures and review comments. Local validation and later CI feedback occupy different points in the same process. The former tests changes before submission, while the latter gives the agent another opportunity to respond to failures surfaced downstream. Neither substitutes for the human decision about whether to accept the change.
Stage five: the pull request lands, with context, recordings, and a human review gate
The pull request is the unit of accountable agent work. Its diff shows the proposed change, while the original trigger context explains what prompted it. Session logs or recordings, where provided, let reviewers inspect the execution behind that proposal. These records connect intent to implementation. Without them, a reviewer may have code to inspect but little evidence of how the agent arrived there.
GitHub Copilot coding agent keeps inspectable session logs and tags the team for review when it finishes. A human must approve its pull requests before CI/CD workflows can run, keeping a person in control of what runs next. Cursor’s self-hosted workers run tool calls locally, and its cloud agent loop opens a draft pull request when the task is done. The agent investigates and proposes. A human then merges, comments, or sends the work back.
Linear demonstrates how this artifact fits into an existing work system. Its agent can write code using Claude Code and Codex, allowing teams to triage, plan, review, and ship within Linear. Linear reports resolving a meaningful share of incoming bug reports through this workflow internally, mostly on the first pass. Faire doubled weekly pull request throughput with Cursor Cloud Agents and compressed an 18-month migration into work managed by a single engineer directing a fleet of agents, using Cursor Automations without manual prompting. As production of reviewable changes expands, review capacity becomes the next constraint.
Why the environment, not the agent harness, is what determines whether the loop closes reliably
Review capacity is a productive constraint because it appears after the execution system has done its job. A stalled clone, missing dependency, inaccessible test service, or absent audit trail prevents the work from reaching that point. These are failures of the surrounding system. A different agent harness does not supply a missing credential or make a network-dependent test run offline. The agent relies on the environment for the access, tools, and boundaries necessary to finish.
This requires distinguishing the agent’s reasoning from the conditions under which that reasoning becomes a usable contribution. The harness is increasingly interchangeable within those conditions. Codex CLI 0.165.0, for example, adds a built-in Google Cloud Vertex AI provider, illustrating how provider choice can change inside an existing tool. For engineering leads, the decision frame is to evaluate the environment first and treat harness choice as a variable within it.
Governance reinforces that distinction. SOC 2 Type II, SSO integration, audit logging connected to security monitoring systems, secret scanning on agent pull requests, and sandbox isolation are environment and platform properties. European enterprises also face obligations when generated code is incorporated into a high-risk AI system. Under the EU AI Act, the organization that deploys the system must meet the requirements for technical documentation, human oversight, and an audit trail. Switching agents does not transfer those responsibilities, so the platform must support the organization’s governance requirements as well as execution.
How should a team choose a platform to run Claude Code in the cloud?
Engineering teams should assess seven environment properties, namely trigger integration, VM isolation and configuration, harness flexibility, test infrastructure, PR governance, security controls, and pricing model. Trigger coverage comes first because Slack, Linear, GitHub, GitLab, and schedules need supported triggers to feed the existing workflow into execution. Isolation and declarable variables, secrets, and setup scripts come next. Self-hosting is a separate requirement for teams that need execution inside their own infrastructure. That investment can survive a change in agent if the environment offers harness flexibility.
The hosted options have concrete differences in access and operation. Claude Code cloud sessions run on Anthropic-managed VMs, or self-hosted environments for Team and Enterprise organizations, and are accessible through claude.ai/code, the Claude mobile app, the Claude Desktop app, or the terminal with claude --cloud. Codex cloud uses OpenAI-managed containers and a reusable environment model, available on Plus, all Pro tiers, Business, Enterprise, Healthcare, and Education plans. Cursor cloud agents run on Cursor’s cloud or self-hosted workers and support parallel agents. Those deployment choices are not equivalent. The appropriate fit depends on where execution must happen and how the team prepares its environment.
Test infrastructure should let the full suite finish without running into network or memory limits. PR governance should provide a reviewable, auditable artifact with session context, while security controls such as SOC 2 Type II, SCIM, audit logs, secret scanning, and self-hosting should be built into the product. Per-workspace-minute compute with no charge while workspaces sleep tracks actual use, whereas fixed-seat or credit-pool models can penalize parallelism at scale. Teams should therefore look beyond which agent can write the code to which platform can turn delegated work into a tested proposal that the team can responsibly review.


