The coding agent is the core of Deployaar. It is the component that turns an approved spec into real, committed code. Given a list of ordered engineering tasks, the agent spins up an isolated cloud sandbox, clones your linked GitHub repository, implements every task using the full power of a shell environment, and pushes a branch that becomes a pull request — all without a human writing a single line of code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/paramveer-cyber/Deployaar/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
Inngest event fires
When a user assigns all tasks to the coding agent, the service creates an agent run record and sends a
coding-agent/run.requested Inngest event. The onCodingAgentRunRequested function picks it up with retries: 1.Sandbox provisioned (or resumed)
The workflow checks for an existing
sandboxId on the agent run record. If one exists, it calls Sandbox.connect(sandboxId) to resume the existing sandbox. If that fails (sandbox expired), or if no ID is stored, a fresh sandbox is created with Sandbox.create({ template: env.E2B_TEMPLATE_ID }). The sandbox ID is immediately persisted so future Inngest retries can resume it.Repository cloned
On a fresh sandbox (not resumed), the agent generates a short-lived GitHub App installation token and runs:The working directory for all subsequent operations is
/home/user/repo.Repo index built
buildRepoIndex runs git ls-files, reads up to 8 key configuration files (package.json, tsconfig.json, turbo.json, etc.), detects the tech stack from package.json dependencies, and produces a structured index string. This index is injected at the top of the agent’s system prompt so it understands the project layout before touching any file.Agent loop starts
generateText is called with the full system prompt (repo index + clarification thread + PRD + task list) and stopWhen: [isStepCount(MAX_ITERATIONS), summaryDetector]. The agent reasons about task dependencies, then implements each task in order using its three tools.TypeScript verification
After completing all tasks the agent is instructed to run exactly one TypeScript check:The
|| true ensures the command always exits 0. If the output is empty, the code is type-correct. If errors are printed, the agent reads them and makes one correction pass, then re-runs tsc once to confirm. Total tsc runs: at most two.Branch pushed and PR opened
The agent emits
<task_summary> XML tags to signal completion. The workflow then checks out branch deployaar_{featureRequestId}, commits all changes, force-pushes to GitHub, and creates a PR via octokit.rest.pulls.create with title [Deployaar] {featureRequest.title}. The PR body contains the task summary.Agent Tools
The agent has exactly three tools. They are executed directly inside therunCodingAgent function, which is itself wrapped in a single step.run("run-coding-agent", ...) call in the Inngest function. This means the entire agent run is one durable Inngest step — if the process restarts mid-run, Inngest reruns runCodingAgent from the beginning of that step rather than replaying individual tool calls.
| Tool | Signature | Purpose |
|---|---|---|
terminal | terminal({ command: string }) | Runs any shell command inside /home/user/repo. Used for pnpm add, git operations, pnpm exec tsc, and inspecting the file system. Returns combined stdout and stderr. |
readFiles | readFiles({ paths: string[] }) | Reads one or more file contents from the sandbox. Paths are relative to /home/user/repo. Returns [{ path, content }]. Missing files return [File not found: <path>] instead of throwing. |
createOrUpdateFiles | createOrUpdateFiles({ files: Array<{ path: string, content: string }> }) | Writes or overwrites files in the sandbox. Paths are relative to /home/user/repo. Accepts a batch of files in one call. Returns the list of paths written. |
Inngest Checkpointing
Every expensive operation in the coding agent workflow is wrapped instep.run(). This means Inngest checkpoints the result of each call to its durable execution log. If the process crashes, is restarted, or the Render instance is recycled mid-run, the workflow replays only from the last un-checkpointed step — all previous tool outputs are replayed from the log without re-executing.
The key steps in the Inngest function are:
runCodingAgent function itself also persists the sandboxId immediately after provisioning, so a Render instance restart mid-run can resume the same E2B sandbox.
Sandbox Resumption
The sandbox connection logic follows a try/connect-or-create pattern:sandboxIsResumed is true, the clone step is skipped entirely — the repository is already present at /home/user/repo from the previous run.
You must create an E2B sandbox template with Node.js and
pnpm pre-installed and set E2B_TEMPLATE_ID to its template ID. The coding agent runs pnpm add to install dependencies and pnpm exec tsc to verify types, so both must be available in the template image.Branch and PR Naming
| Item | Pattern | Example |
|---|---|---|
| Branch name | deployaar_{featureRequestId} | deployaar_a1b2c3d4-e5f6-... |
| PR title | [Deployaar] {featureRequest.title} | [Deployaar] Add dark mode toggle to settings page |
| PR body | Task summary extracted from <task_summary> tags + _ShipFlow-Feature: {featureRequestId}_ footer | — |
| Commit message | feat: {featureRequest.title} [deployaar] | feat: Add dark mode toggle to settings page [deployaar] |
deployaar_([0-9a-f-]{36}) is also used by the webhook handler to route incoming pull_request events back to the correct feature request for AI review.
MAX_ITERATIONS
The agent loop is bounded by a hard cap of 40 iterations:<task_summary> XML tags. If the agent exhausts all 40 iterations without emitting a summary, the run is marked failed, the sandbox is killed, and an error is logged: