An open-source, faster Devin alternative
TypeScript
docs(agents): explain reviewed repository imports
Igor Zalutski0d3bc5f3854f
diff --git a/docs/agent-sessions/agents.mdx b/docs/agent-sessions/agents.mdxindex 40d085a1..73b8d171 100644--- a/docs/agent-sessions/agents.mdx+++ b/docs/agent-sessions/agents.mdx@@ -6,7 +6,7 @@ description: "Reusable agent configuration"An **agent** is a reusable identity, runtime, model, and deployed behavior. Every [session](/agent-sessions/sessions) runs on an agent, so create one first, then start as many sessions on it as you like. For the built-in runtimes, behavior is `prompt` plus optional skills and is frozen into independently routable [revisions](/agent-sessions/revisions). A [Flue](/agent-sessions/flue) agent instead carries its instructions, tools, and packaged skills in a compiled Flue app.-<Note>You can create and edit built-in runtime agents in the [dashboard](https://app.opencomputer.dev). For Flue, choose **Create agent → Import from GitHub** to build an existing repository, or deploy a local checkout with `oc agent deploy`. Both paths produce the same deployment and revision history.</Note>+<Note>The [dashboard](https://app.opencomputer.dev) starts with **Import from GitHub** and keeps **Configure manually** available. Repository import recognizes a complete [Flue](/agent-sessions/flue) app; prompt- or skills-only folders are not converted into an agent. You can also deploy a local Flue checkout with `oc agent deploy`. Both Flue paths produce the same deployment and revision history.</Note><CodeGroup>@@ -52,11 +52,22 @@ For a built-in runtime, the only behavior an agent needs is a **model** and a **|---|---|---|| **Default agent** | `name` + `model` (+ a prompt) | a working agent on the default runtime — no setup || **+ Skills** | [`SKILL.md` folders](/agent-sessions/skills) (upload a `.zip`, or include in a repo) | reusable procedures the agent loads when relevant — still the default runtime |-| **+ Deploy from a repo / CLI** | keep built-in behavior in `prompt.md` + `skills/`, or keep a Flue app in a self-contained npm root | versioned [deployments and revisions](/agent-sessions/revisions); Flue repository imports also include durable build logs |+| **+ Source-controlled deployment** | link a manually configured built-in agent to `prompt.md` + `skills/`, or import a complete Flue app from a self-contained npm root | versioned [deployments and revisions](/agent-sessions/revisions); Flue imports also include durable build logs || **+ Custom runtime** *(coming soon)* | bring your own runtime image | full control of the execution environment |At every built-in rung the agent is a small directory, at most `agent.toml` + `prompt.md` + `skills/`. You can stop at any rung; most agents never go past skills.+## Create from a repository++Choose **Agents → Create agent → Import from GitHub**, install the OpenComputer GitHub App if needed, and select a repository, production branch, and root. **Review agent** resolves one exact commit without running repository code.++- A complete Flue root shows its entrypoint, model, Managed model access, and an editable OpenComputer agent name.+- A broken Flue root explains what must be fixed. OpenComputer does not reinterpret it as another agent type.+- An unrecognized root creates nothing. You can choose another folder, fork the Flue starter, or configure a built-in agent manually.+- In a monorepo, OpenComputer may suggest bounded candidate folders. You choose one explicitly and review it before deployment.++Review and import are intentionally separate. Import rechecks the exact source plan; if the repository changed in between, nothing is created and the dashboard asks you to review again. A successful import returns the new agent and its first deployment immediately, so you can follow live build logs while the deployment continues.+## Session-pinned configFor a built-in runtime, creating a session **freezes** the agent's active [revision](/agent-sessions/revisions), including its `prompt`, `model`, `runtime`, and `skills`. It also pins the resolved credential. A one-off [`model`](/agent-sessions/sessions#model) override is pinned in the same way. Editing the named agent does not change a running or resumed session: existing sessions keep what they started with, while new sessions pick up the change. Rotating a credential's **key value** is the exception, so a compromised key can be replaced; see [credentials](/agent-sessions/credentials).diff --git a/docs/agent-sessions/api-reference.mdx b/docs/agent-sessions/api-reference.mdxindex 6c5a66dd..21ba4312 100644--- a/docs/agent-sessions/api-reference.mdx+++ b/docs/agent-sessions/api-reference.mdx@@ -254,6 +254,8 @@ Body: `{ text, idempotency_key? }` or `{ envelope }`. Returns `202` (or `200` on| Call | Purpose || --- | --- || `oc.agents.create(params)` | Create a reusable agent. |+| `oc.agents.repository.review(params)` | Resolve and interpret an exact repository source without running it. |+| `oc.agents.repository.import(params)` | Import an exact reviewed source and enqueue its first deployment. || `oc.agents.get(id)` · `oc.agents.list()` | Fetch / list. || `oc.agents.update(id, params)` | Update bindings (credential / limits) — `prompt`/`model` deploy a revision. || `oc.agents.delete(id)` | Delete an agent. |@@ -265,7 +267,7 @@ Body: `{ text, idempotency_key? }` or `{ envelope }`. Returns `202` (or `200` on| Method · Path | Purpose || --- | --- || `POST /agents` | Create a reusable agent. |-| `POST /agents/import` | Atomically create a Flue agent from an inspected GitHub source and enqueue its first deployment. |+| `POST /agents/import` | Atomically create an agent from an exact reviewed GitHub source and enqueue its first deployment. || `GET /agents/:id` · `GET /agents` | Fetch / list. || `PATCH /agents/:id` | Update bindings; `prompt`/`model` deploy a revision. || `DELETE /agents/:id` | Delete an agent. |@@ -289,7 +291,7 @@ Body: `name`, `prompt`, `model`, `runtime?` (`claude`|`codex`), `key?`, `credent`POST /agents` is **idempotent by `name`**: fresh → `201`, matching config → `200`, differing → `409`. Editing `prompt`/`model` (here or via [deploy](#deployments-and-revisions)) creates a **revision**; the agent keeps a pointer to its **active revision** (`GET /agents/:id` → `active_revision`) and sessions pin it. The agent row holds only identity + bindings.-`POST /agents/import` is the Flue repository-import command described below. It deliberately creates+`POST /agents/import` is the reviewed repository-import command described below. It deliberately createsan agent with no active revision; revision #1 appears only after the queued build and live deploymentverify successfully.@@ -299,11 +301,20 @@ You **deploy** an agent's behavior. A deployment is a time-aware attempt; only aproduces an immutable **revision**. Failed attempts and their logs remain in deployment history. Seethe [Deployments & revisions guide](/agent-sessions/revisions).-### Import a Flue repository+### Review and import a repository agent-Repository inspection and import are currently REST/dashboard surfaces. Inspection resolves the-moving production branch to one commit and validates bounded metadata without executing repository-code:+Review resolves the moving production branch to one exact commit and interprets bounded metadata+without executing repository code. Repository-first import currently accepts the exact Flue result.++<CodeGroup>++```ts TypeScript SDK+const review = await oc.agents.repository.review({+ repo: "repo_...",+ path: "agents/support",+ productionRef: "main",+});+``````http REST APIPOST /github/deploy-app/inspect@@ -311,18 +322,81 @@ Authorization: Bearer $OPENCOMPUTER_API_KEY{"repo": "repo_...",- "path": "",+ "path": "agents/support","production_ref": "main"}```-The response includes `repository`, normalized `root`, `production_ref`, exact `sha`, the manifest-projection (`entrypoint`, `model`, `runtime`, non-secret `vars`), package and lockfile metadata,-published builder Node, source counts, `variable_names`, and safe `warnings`. It never includes a-repository token or source bytes.+</CodeGroup>++The response always includes repository identity, normalized `root`, `production_ref`, exact `sha`,+`review_fingerprint`, and one `interpretation`:++```json Exact Flue review+{+ "repository": { "id": "repo_...", "full_name": "acme/agents", "default_branch": "main" },+ "root": "agents/support",+ "production_ref": "main",+ "sha": "0123456789abcdef0123456789abcdef01234567",+ "interpretation": {+ "disposition": "exact",+ "source_profile": "flue-app-v1",+ "source_profile_version": 1,+ "summary": "Flue agent detected",+ "reason_code": "flue_detected",+ "assumptions": [],+ "agent": { "runtime": "flue", "model": "anthropic/claude-haiku-4-5" }+ },+ "profile": {+ "source_profile": "flue-app-v1",+ "source_profile_version": 1,+ "manifest": { "schema_version": 1, "entrypoint": "support-triage", "model": "anthropic/claude-haiku-4-5", "runtime": { "family": "flue", "type": "default" }, "vars": {} },+ "package": { "name": "support-agent", "node_engine": ">=22.19 <23", "flue_cli": "^1.0.0" },+ "lockfile": { "version": 3 },+ "builder": { "node": "22.19.0" },+ "source": { "files": 12, "bytes": 4096 },+ "variable_names": [],+ "warnings": []+ },+ "review_fingerprint": "sha256:...",+ "candidate_roots": [],+ "candidate_roots_truncated": false+}+```-After review, submit the same source coordinates with a human-readable agent name. The name is-independent of the Flue entrypoint in `agent.toml`.+`interpretation.disposition` is `exact`, `invalid`, or `unrecognized`. Invalid and unrecognized are+successful review responses, not service failures: `invalid` includes bounded `issues`; an+unrecognized root can include up to 20 `candidate_roots` and explicitly reports truncation. Only+`exact` includes a deployable `profile` and may proceed to import. No response contains a repository+token or source bytes.++Import sends the same source coordinates, a human-readable agent name, and the exact review receipt.+The name is independent of the Flue entrypoint in `agent.toml`.++<CodeGroup>++```ts TypeScript SDK+if (review.interpretation.disposition !== "exact") {+ throw new Error(review.interpretation.summary);+}++const result = await oc.agents.repository.import({+ name: "Support triage",+ credential: "managed",+ idempotencyKey: "stable-key-for-this-import",+ source: {+ type: "github",+ repo: review.repository.id,+ path: review.root,+ productionRef: review.productionRef,+ },+ review: {+ sha: review.sha,+ sourceProfile: review.interpretation.sourceProfile,+ fingerprint: review.reviewFingerprint,+ },+});+``````http REST APIPOST /agents/import@@ -335,21 +409,30 @@ Idempotency-Key: <stable-key-for-this-import>"source": {"type": "github","repo": "repo_...",- "path": "",+ "path": "agents/support","production_ref": "main"+ },+ "review": {+ "sha": "0123456789abcdef0123456789abcdef01234567",+ "source_profile": "flue-app-v1",+ "fingerprint": "sha256:..."}}```-The server repeats authoritative inspection, then creates `{ agent, source, deployment }` atomically.-The deployment starts at `accepted`; the agent is visible but cannot start sessions until it reaches-`ready`. Reusing the same idempotency key and command returns the same import; reusing it with-different fields returns `409 idempotency_conflict`. A name or repository-root conflict also returns-`409` and identifies the existing agent when available.+</CodeGroup>++The server reauthorizes the repository and re-derives the reviewed plan, then creates+`{ agent, source, deployment }` atomically. If the branch head or relevant source changed, it returns+`409 source_changed_re_review` and creates nothing. Reusing the same idempotency key and command+returns the same import; reusing it with different fields returns `409 idempotency_conflict`. A name+or repository-root conflict also returns `409` and identifies the existing agent when available.-The source remains linked after import. A later GitHub push that touches the selected root on its-production branch automatically creates the next deployment. Flue ignores non-production pushes;-the current runtime has one live Worker and no preview/staged Worker.+The source remains linked after import. Its `source_profile`, `source_profile_version`, and+`review_fingerprint` describe the reviewed source identity. A later GitHub push that touches the+selected production root automatically creates the next deployment. If that root no longer matches+the imported source profile, the link status becomes `source_profile_changed`; no build starts and+the current active revision remains unchanged.### Deploy@@ -392,7 +475,7 @@ the current runtime has one live Worker and no preview/staged Worker.behavior — omitted `skills` = none) **or** `{ type:"github", ref?, sha? }` (deploys an already-linkedrepository; `repo`/`path` come from the server-owned link). `activate:false` stages an inline built-indeployment. Built-in GitHub links remain branch-driven. A new Flue repository agent instead starts-with [`POST /agents/import`](#import-a-flue-repository); import deploys the reviewed production head,+with [`POST /agents/import`](#review-and-import-a-repository-agent); import deploys the reviewed production head,and subsequent production-branch pushes deploy automatically. Flue has no preview/staged Worker.`POST …/revisions` is inline-only sugar.diff --git a/docs/agent-sessions/flue.mdx b/docs/agent-sessions/flue.mdxindex e0b9ca6b..64e78bc1 100644--- a/docs/agent-sessions/flue.mdx+++ b/docs/agent-sessions/flue.mdx@@ -79,8 +79,9 @@ The shortest path for an existing Flue app is the dashboard:1. Fork the [Flue starter](https://github.com/diggerhq/oc-flue-starter/fork), or push your own app to GitHub.2. Open **Agents → Create agent → Import from GitHub**.3. Install the OpenComputer GitHub App on the repository, then select the repository, production branch, and root directory.-4. Review the detected Flue entrypoint, model, and exact commit. Give the OpenComputer agent a human-readable name; it may differ from the `agent.toml` Flue entrypoint.-5. Choose **Deploy agent**. The deployment page keeps one chronological log and summarizes progress as **Prepare**, **Build**, and **Deploy**.+4. Choose **Review agent**. OpenComputer resolves one exact commit and checks the root without running repository code.+5. Review the detected Flue entrypoint and model. Give the OpenComputer agent a human-readable name; it may differ from the `agent.toml` Flue entrypoint.+6. Choose **Deploy agent**. The deployment page opens immediately, keeps one chronological log, and summarizes progress as **Prepare**, **Build**, and **Deploy**.The selected root is its own build context and must contain `agent.toml`, `package.json`, and acommitted `package-lock.json`. The package must declare a Node engine compatible with the exact@@ -88,6 +89,15 @@ managed builder version and a semver dependency on the Flue CLI. npm workspaces,files above the selected root, private registries, submodules, Git LFS, custom install/buildcommands, and build-time secrets are not supported.+`agent.toml` is authoritative. If it is malformed, declares an unsupported runtime, or is missing+from a root that otherwise has strong Flue markers, review returns **This Flue agent needs a fix**.+OpenComputer does not fall back to generated behavior or another runtime. A prompt- or skills-only+folder is unrecognized; use a complete Flue root, choose another folder, fork the starter, or create+a built-in agent manually.++For a monorepo, reviewing an unrecognized parent can suggest bounded candidate roots. Selecting a+candidate changes the root and performs a fresh review—it never deploys the suggestion automatically.+OpenComputer resolves the selected branch to one commit, fetches only that tracked tree in ashort-lived Git sandbox, and transfers tokenless source to a separate build sandbox. The build runsfixed `npm ci --no-audit --no-fund` and offline `oc agent build` commands in an ordinary disposable@@ -101,12 +111,21 @@ new exact commit. Flue ignores pushes to other branches because it has one livepreview/staged Worker in the current profile.</Note>+The review step returns a receipt for the exact source plan. Import re-resolves GitHub authority and+checks that receipt before creating anything. If the branch or a relevant file changed, the dashboard+shows **Repository changed since review** and asks you to review again.+If install or build fails, the agent remains visible but undeployed: it has no usable revision andcannot start a session. Open the failed deployment for its persisted error summary and bounded log,fix the repository, and push the linked production branch. The first successful deployment createsrevision **#1**. **Deploy latest** can manually rebuild its current head after a transient platformfailure.+If a later production push removes or replaces the Flue definition, the deployment stops before+build with `source_profile_changed`; the active revision stays live. Restore the Flue app in the+linked root, or unlink the source and import the repository as a new agent. Unlinking does not delete+the existing agent, its active revision, or its sessions.+## Deploy from your machineRequirements: Node 22.19 or newer, the `oc` CLI, and an OpenComputer organization with Managed modeldiff --git a/docs/agent-sessions/repos.mdx b/docs/agent-sessions/repos.mdxindex 81c6d022..28c9987a 100644--- a/docs/agent-sessions/repos.mdx+++ b/docs/agent-sessions/repos.mdx@@ -121,12 +121,22 @@ does nothing but Git, and is gone before the next turn.## Use a repo to deploy a Flue agentChoose **Agents → Create agent → Import from GitHub** when the repository is the agent-implementation itself. The dashboard uses the OpenComputer App to:+implementation itself. Repository-first creation currently recognizes a complete Flue application.+The dashboard uses the OpenComputer App to:-1. inspect the selected branch and root without running repository code;-2. review the exact commit, Flue entrypoint, model, and agent name while validating the managed Node/package contract;-3. create an undeployed agent and its first deployment attempt; and-4. fetch that exact tracked tree in a short-lived Git box.+1. resolve the selected branch and root at one exact commit without running repository code;+2. explain whether it found a valid Flue app, a Flue app that needs a fix, or no supported agent definition;+3. let you review the Flue entrypoint, model, and independent agent name; and+4. revalidate that reviewed source before creating an undeployed agent and its first deployment.++Recognition is deterministic. A root-level `agent.toml` is authoritative: if it is malformed or+unsupported, the result is a fixable error rather than a guess. Without a manifest, a root-level+`flue.config.*` file or a Flue package dependency is treated as Flue intent and reports the missing+manifest. A prompt, `skills/` folder, README, or unrelated package is not converted automatically.++If the selected root is unrecognized, the review can return up to 20 candidate roots from a bounded+search no more than six folders deep. Candidates are suggestions, never an automatic selection;+choose one and review it separately. When the result is truncated, select a narrower root.The Git box writes a bounded, digest-checked source archive to object storage and is destroyed.A different sandbox receives that archive without `.git` or GitHub auth, runs the fixed install and@@ -134,7 +144,7 @@ build commands as an ordinary disposable OpenComputer sandbox, and emits an artideployment credential belongs to another trusted service and is never present during source orbuild work.-Flue repository deployment currently supports one self-contained npm root with `agent.toml`,+Flue repository deployment supports one self-contained npm root with `agent.toml`,`package.json`, and `package-lock.json`. The initial import links that root to its production branch;each later push touching the root automatically deploys the branch's new exact head. Other branchesdo not create Flue preview deployments. **Deploy latest** remains available for manually rebuilding@@ -142,6 +152,19 @@ the current production head after a transient failure. See[Flue deployment](/agent-sessions/flue#deploy-from-github) for the full build contract and failurejourney.+The review receipt binds the repository, root, branch, exact commit, detected agent profile, and+relevant files. If any of those change before import, OpenComputer returns a source-changed conflict+and creates nothing. Review the current commit again rather than assuming the old confirmation still+applies.++The source link also remembers that the agent was imported as Flue. Normal Flue changes keep+deploying on push. If the linked root stops being a Flue app, the deployment fails before build and+the active revision stays live. Restore the Flue definition, or unlink the source and import it as a+new agent. Unlinking stops push-to-deploy; it does not delete or convert the existing agent, revision,+or sessions.++<Note>The deployment repository is not a session working repository. Importing it does not mount its files into later sessions or grant the running agent GitHub access. Choose session [sources](#how-it-works) separately when an agent needs code to work on.</Note>+## Connecting GitHubPick one. Either way, OpenComputer mints a fresh, repo-scoped token **per operation** (read-only