Skip to main content

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.

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.
Never configure pnpm dev or pnpm start commands in your repository’s setup scripts that run on clone. The agent’s system prompt explicitly prohibits starting dev servers, and doing so inside the sandbox wastes execution time and may exhaust the iteration budget before any tasks are completed.

How It Works

1

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.
2

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.
3

Repository cloned

On a fresh sandbox (not resumed), the agent generates a short-lived GitHub App installation token and runs:
git clone --depth 1 https://x-access-token:<token>@github.com/<owner>/<repo>.git /home/user/repo
git config user.email "agent@deployaar.com"
git config user.name "Deployaar Agent"
The working directory for all subsequent operations is /home/user/repo.
4

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.
5

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.
6

TypeScript verification

After completing all tasks the agent is instructed to run exactly one TypeScript check:
pnpm exec tsc --noEmit 2>&1 || true
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.
7

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 the runCodingAgent 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.
ToolSignaturePurpose
terminalterminal({ 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.
readFilesreadFiles({ 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.
createOrUpdateFilescreateOrUpdateFiles({ 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.
Example tool call for writing a new file:
createOrUpdateFiles({
  files: [
    {
      path: "src/components/DarkModeToggle.tsx",
      content: "// full file content here"
    }
  ]
})

Inngest Checkpointing

Every expensive operation in the coding agent workflow is wrapped in step.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:
await step.run("mark-agent-run-queued", () => updateAgentRun(agentRunId, { status: "queued" }));
const result = await step.run("run-coding-agent", () =>
  runCodingAgent(featureRequestId, agentRunId, requestedByUserId),
);
The 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:
if (existingRun?.sandboxId) {
  try {
    sandbox = await Sandbox.connect(existingRun.sandboxId);
    sandboxIsResumed = true;
  } catch {
    // Sandbox expired — provision a fresh one
    sandbox = await Sandbox.create({ template: env.E2B_TEMPLATE_ID });
  }
} else {
  sandbox = await Sandbox.create({ apiKey: env.E2B_API_KEY, template: env.E2B_TEMPLATE_ID });
}
When 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

ItemPatternExample
Branch namedeployaar_{featureRequestId}deployaar_a1b2c3d4-e5f6-...
PR title[Deployaar] {featureRequest.title}[Deployaar] Add dark mode toggle to settings page
PR bodyTask summary extracted from <task_summary> tags + _ShipFlow-Feature: {featureRequestId}_ footer
Commit messagefeat: {featureRequest.title} [deployaar]feat: Add dark mode toggle to settings page [deployaar]
The branch name pattern 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:
const MAX_ITERATIONS = 40;

stopWhen: [
  isStepCount(MAX_ITERATIONS),
  ({ steps }) => {
    const lastStepText = steps[steps.length - 1]?.text ?? "";
    return Promise.resolve(extractTaskSummary(lastStepText) !== null);
  },
],
The loop stops at whichever condition fires first: the step count reaches 40, or the agent emits <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:
Agent exhausted 40 iterations without signalling completion
In this case the feature request status is not automatically moved forward. A new agent run must be triggered manually after investigating why the agent stalled.

TypeScript Verification

After completing all tasks the agent runs a single TypeScript check as a self-review step:
pnpm exec tsc --noEmit 2>&1 || true
The agent is instructed to fix any printed errors in one pass only, then re-run tsc once to confirm. It must not run tsc more than twice in total. The verification step does not block the PR from being opened — if errors remain after the fix pass, the PR is still created and the AI code reviewer will catch any functional issues.

Build docs developers (and LLMs) love