Skip to content

An open-source, faster Devin alternative

TypeScript

fix(agents): harden repository onboarding recovery

Igor Zalutski3ca1c1a79164
diff --git a/docs/agent-sessions/agents.mdx b/docs/agent-sessions/agents.mdx
index 73b8d171..02756ae6 100644
--- a/docs/agent-sessions/agents.mdx
+++ b/docs/agent-sessions/agents.mdx
@@ -6,7 +6,14 @@ 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>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>
+<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>
@@ -42,18 +49,21 @@ Content-Type: application/json
Pass your model `key` inline and it's stored as a [credential](/agent-sessions/credentials) and attached to the agent — sessions run the model on it. The provider is taken from `model` (Anthropic for `anthropic/…`, OpenAI for `openai/…`), so the key has to be for that provider. Already have a credential? Reference it with `credential: "cred_…"` instead. Or skip keys entirely with `credential: "managed"` to run the model **via OpenComputer, billed to your credits** (the default for new orgs). Omit both `key` and `credential` to use your org default. Optionally set default [`limits`](/agent-sessions/sessions#limits) (`tokens`/`turn_seconds`/`turns`) too; sessions inherit them.
-<Tip>Keep the org key and model key on your backend. Only return session-scoped client tokens to browsers.</Tip>
+<Tip>
+ Keep the org key and model key on your backend. Only return session-scoped
+ client tokens to browsers.
+</Tip>
## Start simple, add capability as you go
For a built-in runtime, the only behavior an agent needs is a **model** and a **prompt**. Everything beyond that is additive: reach for a rung only when you need it, and nothing earlier is undone. Flue has a separate [app deployment path](/agent-sessions/flue#add-opencomputer-to-a-flue-app).
-| Rung | What you add | What you get |
-|---|---|---|
-| **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 |
-| **+ 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 |
+| Rung | What you add | What you get |
+| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
+| **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 |
+| **+ 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.
@@ -66,7 +76,7 @@ Choose **Agents → Create agent → Import from GitHub**, install the OpenCompu
- 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.
+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. Connect Slack from that deployment page while the live build log continues; when both are ready, the primary action changes to **Open Slack** without a refresh.
## Session-pinned config
diff --git a/docs/agent-sessions/api-reference.mdx b/docs/agent-sessions/api-reference.mdx
index 2f20ca39..31614efd 100644
--- a/docs/agent-sessions/api-reference.mdx
+++ b/docs/agent-sessions/api-reference.mdx
@@ -11,7 +11,7 @@ Each section toggles between the **TypeScript SDK** (`@opencomputer/sdk`), **RES
import { OpenComputer, connectSession } from "@opencomputer/sdk";
const oc = new OpenComputer({ apiKey: process.env.OPENCOMPUTER_API_KEY! });
-const session = await oc.sessions.get("ses_..."); // server, org key
+const session = await oc.sessions.get("ses_..."); // server, org key
// or, in a browser: await connectSession({ sessionId, clientToken })
```
@@ -22,7 +22,13 @@ oc agent deploy # deploy the agent directory in the cwd
oc agent build --dir . --check-only --json # validate a Flue app without credentials or deployment
```
-<Note>The SDK uses **camelCase** for fields and params (`last_turn` → `lastTurn`, `idempotency_key` → `idempotencyKey`); the wire shapes below are raw JSON. Opaque blobs — session `metadata`, event `refs`/`raw` — pass through **verbatim**; everything else (incl. event `body`) is camelCased. The CLI prints a table, or raw JSON with `--json`.</Note>
+<Note>
+ The SDK uses **camelCase** for fields and params (`last_turn` → `lastTurn`,
+ `idempotency_key` → `idempotencyKey`); the wire shapes below are raw JSON.
+ Opaque blobs — session `metadata`, event `refs`/`raw` — pass through
+ **verbatim**; everything else (incl. event `body`) is camelCased. The CLI
+ prints a table, or raw JSON with `--json`.
+</Note>
## Sessions
@@ -30,47 +36,47 @@ oc agent build --dir . --check-only --json # validate a Flue app without creden
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.sessions.create(params)` | Start a session → a `Session` handle (carries `.clientToken`). |
-| `oc.sessions.get(id)` | Fetch a session. |
-| `oc.sessions.list(params)` | List sessions (filtered, paginated). |
-| `session.archive()` | Cancel any active turn, then close (read-only). |
-| `session.cancel()` | Cooperatively stop the active turn (no-op if not running). |
-| `session.result()` | `{ lastTurn, result? }` — the resolved final event. |
-| `session.turns()` · `session.turn(id)` | Per-turn history: timing, error. |
-| `session.sources` · `session.listSources()` | Source checkout status — create snapshot · live poll. |
-| `session.mintClientToken(opts)` | Mint a client token. |
+| Call | Purpose |
+| ------------------------------------------- | -------------------------------------------------------------- |
+| `oc.sessions.create(params)` | Start a session → a `Session` handle (carries `.clientToken`). |
+| `oc.sessions.get(id)` | Fetch a session. |
+| `oc.sessions.list(params)` | List sessions (filtered, paginated). |
+| `session.archive()` | Cancel any active turn, then close (read-only). |
+| `session.cancel()` | Cooperatively stop the active turn (no-op if not running). |
+| `session.result()` | `{ lastTurn, result? }` — the resolved final event. |
+| `session.turns()` · `session.turn(id)` | Per-turn history: timing, error. |
+| `session.sources` · `session.listSources()` | Source checkout status — create snapshot · live poll. |
+| `session.mintClientToken(opts)` | Mint a client token. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /sessions` | Start a session → `{ session, client_token }`. |
-| `GET /sessions/:id` | Fetch a session. |
+| Method · Path | Purpose |
+| ----------------------------------------------------------------- | ------------------------------------------------------------- |
+| `POST /sessions` | Start a session → `{ session, client_token }`. |
+| `GET /sessions/:id` | Fetch a session. |
| `GET /sessions?status=&agent=&key=&after=&before=&limit=&cursor=` | List sessions (filtered, paginated; `cursor` = `nextCursor`). |
-| `POST /sessions/:id/archive` | Cancel any active turn, then close (read-only). |
-| `POST /sessions/:id/cancel` | Cooperatively stop the active turn (no-op if not running). |
-| `GET /sessions/:id/result` | The result helper — `{ last_turn, result? }`. |
-| `GET /sessions/:id/turns` · `…/turns/:turnId` | Per-turn history: timing, error. |
-| `GET /sessions/:id/sources` | Source checkout status (`SourceSummary[]`). |
-| `POST /sessions/:id/client-tokens` | Mint a client token. |
+| `POST /sessions/:id/archive` | Cancel any active turn, then close (read-only). |
+| `POST /sessions/:id/cancel` | Cooperatively stop the active turn (no-op if not running). |
+| `GET /sessions/:id/result` | The result helper — `{ last_turn, result? }`. |
+| `GET /sessions/:id/turns` · `…/turns/:turnId` | Per-turn history: timing, error. |
+| `GET /sessions/:id/sources` | Source checkout status (`SourceSummary[]`). |
+| `POST /sessions/:id/client-tokens` | Mint a client token. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
+| Command | Purpose |
+| ------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| `oc session create --agent <id\|name> [--revision <n>] [--input <text>]` | Start a session (`--revision` pins a specific revision; default = active). |
-| `oc session get <id>` | Fetch a session. |
-| `oc session list [--agent <id>] [--status <s>]` | List sessions. |
-| `oc session cancel <id>` | Cooperatively stop the active turn. |
-| `oc session result <id>` | The resolved final result. |
-| `oc session steer <id> <text>` | Send input to a running or waiting session. |
-| *(archive · turns · sources · client tokens — REST/SDK only)* | |
+| `oc session get <id>` | Fetch a session. |
+| `oc session list [--agent <id>] [--status <s>]` | List sessions. |
+| `oc session cancel <id>` | Cooperatively stop the active turn. |
+| `oc session result <id>` | The resolved final result. |
+| `oc session steer <id> <text>` | Send input to a running or waiting session. |
+| _(archive · turns · sources · client tokens — REST/SDK only)_ | |
</Tab>
@@ -91,49 +97,49 @@ A built-in runtime session pins the agent's active revision for its whole life.
**`Session`**
-| Field | Type | Notes |
-|---|---|---|
-| `id` `status` `head` `input_cursor` | | id, [lifecycle](/agent-sessions/sessions#lifecycle) status, latest event seq, input cursor |
-| `agent_id` `credential_id` | string | resolved + pinned at create |
-| `agent_snapshot` | object | `{ prompt_hash, model, runtime, revision }` — `revision` = the pinned revision number |
-| `last_turn` | `Turn`-ish | `{ id, state, yield_reason?, result_event_id? }` |
-| `limits?` | object | `{ tokens?, turn_seconds?, turns? }` |
-| `metadata?` | object | opaque app routing state |
-| `key?` `created_at` | | get-or-create key, timestamp |
+| Field | Type | Notes |
+| ----------------------------------- | ---------- | ------------------------------------------------------------------------------------------ |
+| `id` `status` `head` `input_cursor` | | id, [lifecycle](/agent-sessions/sessions#lifecycle) status, latest event seq, input cursor |
+| `agent_id` `credential_id` | string | resolved + pinned at create |
+| `agent_snapshot` | object | `{ prompt_hash, model, runtime, revision }` — `revision` = the pinned revision number |
+| `last_turn` | `Turn`-ish | `{ id, state, yield_reason?, result_event_id? }` |
+| `limits?` | object | `{ tokens?, turn_seconds?, turns? }` |
+| `metadata?` | object | opaque app routing state |
+| `key?` `created_at` | | get-or-create key, timestamp |
**`Turn`**
-| Field | Notes |
-|---|---|
-| `id` `state` | turn id, current state |
-| `yield_reason?` | why it ended (below) |
-| `result_event_id?` | the event carrying the result |
-| `error?` | failure detail, if any |
-| `started_at?` `completed_at?` | timing |
+| Field | Notes |
+| ----------------------------- | ----------------------------- |
+| `id` `state` | turn id, current state |
+| `yield_reason?` | why it ended (below) |
+| `result_event_id?` | the event carrying the result |
+| `error?` | failure detail, if any |
+| `started_at?` `completed_at?` | timing |
A turn's **`yield_reason`** tells you why it stopped:
-| Value | Meaning |
-|---|---|
-| `completed` | finished normally |
-| `needs_input` | the agent asked a question — answer it by [steering](#steer) |
-| `error` | the turn failed (see `error`) |
+| Value | Meaning |
+| ----------------------------------------------------- | -------------------------------------------------------------- |
+| `completed` | finished normally |
+| `needs_input` | the agent asked a question — answer it by [steering](#steer) |
+| `error` | the turn failed (see `error`) |
| `budget_exceeded` / `deadline_exceeded` / `max_turns` | a [limit](#sessions) tripped — tokens / wall-clock / auto-runs |
-| `canceled` | you cancelled it |
+| `canceled` | you cancelled it |
**`SessionSource`** — one of two variants:
-| Variant | Shape |
-|---|---|
+| Variant | Shape |
+| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| registered | `{ repo, ref, sha?, name? }` — `repo` is a `repo_…` id or `"owner/repo"`; App-backed auth. `sha` is **optional** (omit → control plane resolves `ref`→HEAD and pins it at create) |
-| inline | `{ url, ref, sha, name?, auth }` — `sha` **required**; `auth = { type:"risky_short_lived_token", token, expires_at }` (can't refresh) |
+| inline | `{ url, ref, sha, name?, auth }` — `sha` **required**; `auth = { type:"risky_short_lived_token", token, expires_at }` (can't refresh) |
**`SourceSummary`** (sanitized; on create + `GET …/sources`)
-| Field | Notes |
-|---|---|
-| `name` `path` `sha` `resolved_sha?` | checkout identity + resolved commit |
-| `status` | `pending · materializing · resolved · failed · unavailable · auth_required` |
+| Field | Notes |
+| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `name` `path` `sha` `resolved_sha?` | checkout identity + resolved commit |
+| `status` | `pending · materializing · resolved · failed · unavailable · auth_required` |
| `error_code?` `error_message?` `retryable?` | on failure — `source.`-prefixed, e.g. `source.auth_required` (App not installed), `source.repo_not_selected` (install doesn't cover the repo), `source.permission_missing`, `source.mint_failed`, `source.ref_not_found`, `source.sha_mismatch`. [Full list](/agent-sessions/repos) |
## Events
@@ -142,34 +148,34 @@ A turn's **`yield_reason`** tells you why it stopped:
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `session.listEvents(opts)` | Read events since a cursor. |
-| `session.events(opts)` | Live stream from a cursor — a self-resuming async iterator. |
-| `session.event(id)` | Fetch one event (resolve `resultEventId`). |
-| `session.eventContent(id)` | Fetch a blob-backed body (large outputs). |
-| `session.messages(opts)` | User-message history. |
+| Call | Purpose |
+| -------------------------- | ----------------------------------------------------------- |
+| `session.listEvents(opts)` | Read events since a cursor. |
+| `session.events(opts)` | Live stream from a cursor — a self-resuming async iterator. |
+| `session.event(id)` | Fetch one event (resolve `resultEventId`). |
+| `session.eventContent(id)` | Fetch a blob-backed body (large outputs). |
+| `session.messages(opts)` | User-message history. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `GET /sessions/:id/events?after=<seq>&level=<lvl>` | Read events since a cursor. |
-| `GET /sessions/:id/events?…&stream=sse` | Live SSE stream from a cursor. |
-| `GET /sessions/:id/events/:eventId` | Fetch one event. |
-| `GET /sessions/:id/events/:eventId/content` | Fetch a blob-backed body. |
-| `GET /sessions/:id/messages` | User-message history. |
+| Method · Path | Purpose |
+| -------------------------------------------------- | ------------------------------ |
+| `GET /sessions/:id/events?after=<seq>&level=<lvl>` | Read events since a cursor. |
+| `GET /sessions/:id/events?…&stream=sse` | Live SSE stream from a cursor. |
+| `GET /sessions/:id/events/:eventId` | Fetch one event. |
+| `GET /sessions/:id/events/:eventId/content` | Fetch a blob-backed body. |
+| `GET /sessions/:id/messages` | User-message history. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
+| Command | Purpose |
+| -------------------------------------------------------------- | --------------------------- |
| `oc session logs <id> [--follow] [--level <lvl>] [--type <t>]` | Read or live-stream events. |
-| *(single event · event content · messages — REST/SDK only)* | |
+| _(single event · event content · messages — REST/SDK only)_ | |
</Tab>
@@ -179,13 +185,13 @@ Filter by `type` (exact or `prefix.*`), `turn_id`, `limit`. `after` resumes from
**`Event`**
-| Field | Notes |
-|---|---|
-| `id` `seq` `ts` `session` | id, monotonic seq, timestamp, session id |
-| `actor` `type` `level` | source, event [type](/agent-sessions/events#event-shape), visibility level |
-| `body` | the payload (camelCased; switch on `type`, don't parse prose) |
-| `turn_id?` | the turn it belongs to |
-| `content_ref?` `body_truncated?` `body_bytes?` | large bodies are offloaded — fetch via `…/events/:id/content` |
+| Field | Notes |
+| ---------------------------------------------- | -------------------------------------------------------------------------- |
+| `id` `seq` `ts` `session` | id, monotonic seq, timestamp, session id |
+| `actor` `type` `level` | source, event [type](/agent-sessions/events#event-shape), visibility level |
+| `body` | the payload (camelCased; switch on `type`, don't parse prose) |
+| `turn_id?` | the turn it belongs to |
+| `content_ref?` `body_truncated?` `body_bytes?` | large bodies are offloaded — fetch via `…/events/:id/content` |
## Steer
@@ -193,24 +199,24 @@ Filter by `type` (exact or `prefix.*`), `turn_id`, `limit`. `after` resumes from
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
+| Call | Purpose |
+| ----------------------------------------- | ------------------------------------------- |
| `session.steer(text, { idempotencyKey })` | Append an input message; wakes the session. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
+| Method · Path | Purpose |
+| ----------------------------- | ------------------------------------------- |
| `POST /sessions/:id/messages` | Append an input message; wakes the session. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
+| Command | Purpose |
+| ------------------------------ | ------------------------------------------- |
| `oc session steer <id> <text>` | Append an input message; wakes the session. |
</Tab>
@@ -221,27 +227,27 @@ Body: `{ text, idempotency_key? }` or `{ envelope }`. Returns `202` (or `200` on
## Watches
-*Managed with the SDK (`session.watches.create/list/delete`), the CLI (`oc session watch/watches/unwatch`), or REST — authenticate with your **org API key** (server-side). The agent-facing path is the [`watch_pull_request`](/agent-sessions/runtime-tools#github-tools) runtime tool. Full guide: [Watches](/agent-sessions/watches).*
+_Managed with the SDK (`session.watches.create/list/delete`), the CLI (`oc session watch/watches/unwatch`), or REST — authenticate with your **org API key** (server-side). The agent-facing path is the [`watch_pull_request`](/agent-sessions/runtime-tools#github-tools) runtime tool. Full guide: [Watches](/agent-sessions/watches)._
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /sessions/:id/watches` | Declare a watch → `201 { watch }`. Body: `{ type:"github_pr", repo?, pr?, wake_on, intent? }`. |
-| `GET /sessions/:id/watches` | List watches → `{ data: [watch] }`. |
-| `DELETE /sessions/:id/watches/:watchId` | Remove a watch → `{ ok: true }`. |
+| Method · Path | Purpose |
+| --------------------------------------- | ---------------------------------------------------------------------------------------------- |
+| `POST /sessions/:id/watches` | Declare a watch → `201 { watch }`. Body: `{ type:"github_pr", repo?, pr?, wake_on, intent? }`. |
+| `GET /sessions/:id/watches` | List watches → `{ data: [watch] }`. |
+| `DELETE /sessions/:id/watches/:watchId` | Remove a watch → `{ ok: true }`. |
`wake_on` is the wake condition (`checks` default · `review` · `comment` · `merge`); `intent` is the freeform "why," replayed on wake. `repo`/`pr` are optional — omitted, they resolve to the PR this session opened. A watch fires only on PRs the **same session** opened, on Connected-App (`oc_app`) repos. Limits: **10** active watches per session, **30-day** TTL (and never outlives the PR).
**`Watch`**
-| Field | Notes |
-|---|---|
-| `id` `type` | `wch_…`; `type` = `github_pr` |
-| `repo` `pr` | watched repo · PR number |
-| `wake_on` | wake condition: `checks` (default) · `review` (a review decision) · `comment` · `merge` (merged/closed) |
-| `intent?` | freeform note ("why"), replayed on wake |
-| `status` | `active · closed · revoked · auth_required` |
-| `origin` | how it was declared (runtime tool / management API) |
-| `last_snapshot_at?` `expires_at` `created_at` | last authoritative PR re-read · 30-day TTL lapse · timestamp |
+| Field | Notes |
+| --------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
+| `id` `type` | `wch_…`; `type` = `github_pr` |
+| `repo` `pr` | watched repo · PR number |
+| `wake_on` | wake condition: `checks` (default) · `review` (a review decision) · `comment` · `merge` (merged/closed) |
+| `intent?` | freeform note ("why"), replayed on wake |
+| `status` | `active · closed · revoked · auth_required` |
+| `origin` | how it was declared (runtime tool / management API) |
+| `last_snapshot_at?` `expires_at` `created_at` | last authoritative PR re-read · 30-day TTL lapse · timestamp |
**Delivered events** — appended into the session log at level `user` with `source: "github"`, carrying a normalized summary (not the raw webhook): `github.pr.checks_completed` · `github.pr.review_submitted` · `github.pr.comment` · `github.pr.merged` · `github.pr.closed`.
@@ -251,37 +257,37 @@ Body: `{ text, idempotency_key? }` or `{ envelope }`. Returns `202` (or `200` on
<Tab title="TypeScript SDK">
-| 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. |
+| 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. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /agents` | Create a reusable agent. |
-| `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. |
+| Method · Path | Purpose |
+| --------------------------------- | ------------------------------------------------------------------------------------------------- |
+| `POST /agents` | Create a reusable agent. |
+| `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. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
+| Command | Purpose |
+| -------------------------------------------------------------- | ------------------------ |
| `oc agent create <name> --model <m> [--runtime claude\|codex]` | Create a reusable agent. |
-| `oc agent get <id\|name>` · `oc agent list` | Fetch / list. |
-| `oc agent update <id> [--credential <c>] [--limits …]` | Update bindings. |
-| `oc agent delete <id>` | Delete an agent. |
+| `oc agent get <id\|name>` · `oc agent list` | Fetch / list. |
+| `oc agent update <id> [--credential <c>] [--limits …]` | Update bindings. |
+| `oc agent delete <id>` | Delete an agent. |
</Tab>
@@ -334,7 +340,11 @@ The response always includes repository identity, normalized `root`, `production
```json Exact Flue review
{
- "repository": { "id": "repo_...", "full_name": "acme/agents", "default_branch": "main" },
+ "repository": {
+ "id": "repo_...",
+ "full_name": "acme/agents",
+ "default_branch": "main"
+ },
"root": "agents/support",
"production_ref": "main",
"sha": "0123456789abcdef0123456789abcdef01234567",
@@ -350,8 +360,18 @@ The response always includes repository identity, normalized `root`, `production
"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" },
+ "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 },
@@ -370,6 +390,33 @@ unrecognized root can include up to 20 `candidate_roots` and explicitly reports
`exact` includes a deployable `profile` and may proceed to import. No response contains a repository
token or source bytes.
+The non-exact variants keep the common repository/root/SHA/fingerprint fields shown above and use
+these shapes:
+
+```json Invalid or unrecognized interpretation
+{
+ "interpretation": {
+ "disposition": "invalid",
+ "source_profile": "flue-app-v1",
+ "source_profile_version": 1,
+ "summary": "This Flue agent needs a fix",
+ "reason_code": "manifest_invalid",
+ "issues": [
+ { "code": "manifest_invalid", "message": "…", "path": "agent.toml" }
+ ]
+ },
+ "profile": null,
+ "candidate_roots": [],
+ "candidate_roots_truncated": false
+}
+```
+
+An unrecognized interpretation has `source_profile: null`, `source_profile_version: null`, and
+`reason_code: "unrecognized_source"`. Its optional candidate entries are
+`{ path, source_profile: "flue-app-v1" | null, summary, marker }`; selecting one always performs a
+new review. `candidate_roots_truncated` means more matches existed than the bounded response could
+return, so ask the user to choose a narrower root rather than selecting one automatically.
+
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`.
@@ -440,32 +487,32 @@ the current active revision remains unchanged.
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.agents.deployments.create(id, { input, activate?, idempotencyKey? })` | Deploy (`input.type: "inline" \| "github"`). |
-| `oc.agents.deployments.list(id)` · `.get(id, depId)` | Deployment history · one deployment. |
-| `oc.agents.deploy(dir)` *(Node)* | Bundle a local directory → inline deployment. |
+| Call | Purpose |
+| ------------------------------------------------------------------------- | --------------------------------------------- |
+| `oc.agents.deployments.create(id, { input, activate?, idempotencyKey? })` | Deploy (`input.type: "inline" \| "github"`). |
+| `oc.agents.deployments.list(id)` · `.get(id, depId)` | Deployment history · one deployment. |
+| `oc.agents.deploy(dir)` _(Node)_ | Bundle a local directory → inline deployment. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /agents/:id/deployments` | Deploy → `{ deployment }`. Body: `{ input, activate?=true, idempotency_key?, client_context? }`. |
-| `GET /agents/:id/deployments?before=&limit=` | Newest-first history with an opaque `next_cursor`. |
-| `GET /agents/:id/deployments/:deploymentId` | One attempt; poll asynchronous states until terminal. |
-| `GET /agents/:id/deployments/:deploymentId/logs?after=&limit=` | Ordered durable log chunks with opaque resume cursors. |
+| Method · Path | Purpose |
+| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
+| `POST /agents/:id/deployments` | Deploy → `{ deployment }`. Body: `{ input, activate?=true, idempotency_key?, client_context? }`. |
+| `GET /agents/:id/deployments?before=&limit=` | Newest-first history with an opaque `next_cursor`. |
+| `GET /agents/:id/deployments/:deploymentId` | One attempt; poll asynchronous states until terminal. |
+| `GET /agents/:id/deployments/:deploymentId/logs?after=&limit=` | Ordered durable log chunks with opaque resume cursors. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
-| `oc agent deploy [dir] [--agent <id\|name>] [--no-activate]` | Bundle a local directory → inline deployment. |
+| Command | Purpose |
+| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
+| `oc agent deploy [dir] [--agent <id\|name>] [--no-activate]` | Bundle a local directory → inline deployment. |
| `oc agent build --dir <dir> [--check-only] [--target cloudflare] [--output <dir>]` | Validate or build a Flue artifact without fetching, installing, authenticating, or deploying. |
-| `oc agent deployments [--agent <id>]` · `oc agent deployments get <id>` | History · one deployment. |
+| `oc agent deployments [--agent <id>]` · `oc agent deployments get <id>` | History · one deployment. |
</Tab>
@@ -481,18 +528,18 @@ and subsequent production-branch pushes deploy automatically. Flue has no previe
**`Deployment`**
-| Field | Notes |
-|---|---|
-| `id` `created_at` `updated_at` | Attempt identity and timestamps. |
-| `state` `phase` `terminal` | Internal state plus stable UI phase. Repository states: `accepted`, `queued`, `fetching`, `validating`, `installing`, `building`, `uploading`, `deploying`, `verifying`; terminals: `ready`, `failed`, `canceled`, `superseded`, `skipped`. |
-| `result` `error_class` `error?` | Terminal outcome and bounded, redacted failure detail. |
-| `revision_id` `revision?` `active` | Successful revision relation; absent for an unsuccessful attempt. |
-| `source_relation?` | Repository id/name, path, production ref, exact SHA, and commit URL. |
-| `build?` `configuration?` | Safe builder/artifact metadata and non-secret runtime configuration; variables are names only. |
-| `timing` | Accepted/started/finished coordinates plus queue/run/total durations. |
-| `log_bytes` `log_truncated` | Bounded log accounting. |
-| `live_touched` `agent_live?` | Whether deployment crossed the live Worker boundary and the current guarded/verified state. |
-| `allowed_actions` | Server-derived actions such as `view_commit`, `deploy_latest`, `open_agent`, or `start_session`. |
+| Field | Notes |
+| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` `created_at` `updated_at` | Attempt identity and timestamps. |
+| `state` `phase` `terminal` | Internal state plus stable UI phase. Repository states: `accepted`, `queued`, `fetching`, `validating`, `installing`, `building`, `uploading`, `deploying`, `verifying`; terminals: `ready`, `failed`, `canceled`, `superseded`, `skipped`. |
+| `result` `error_class` `error?` | Terminal outcome and bounded, redacted failure detail. |
+| `revision_id` `revision?` `active` | Successful revision relation; absent for an unsuccessful attempt. |
+| `source_relation?` | Repository id/name, path, production ref, exact SHA, and commit URL. |
+| `build?` `configuration?` | Safe builder/artifact metadata and non-secret runtime configuration; variables are names only. |
+| `timing` | Accepted/started/finished coordinates plus queue/run/total durations. |
+| `log_bytes` `log_truncated` | Bounded log accounting. |
+| `live_touched` `agent_live?` | Whether deployment crossed the live Worker boundary and the current guarded/verified state. |
+| `allowed_actions` | Server-derived actions such as `view_commit`, `deploy_latest`, `open_agent`, or `start_session`. |
List returns `{ data, next_cursor }`. Log reads return
`{ data: [{ seq, cursor, recorded_at, phase, stream, chunk }], next_cursor, has_more }`; treat `seq`
@@ -506,31 +553,31 @@ responses, and operator telemetry are never projected through these APIs.
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.agents.revisions.list(id)` · `.get(id, n)` | History · one revision (+ skill manifest). |
-| `oc.agents.revisions.activate(id, n)` | Set the active revision (rollback **or** promote). |
-| `oc.agents.activations.list(id)` | Active-pointer audit log. |
+| Call | Purpose |
+| ---------------------------------------------- | -------------------------------------------------- |
+| `oc.agents.revisions.list(id)` · `.get(id, n)` | History · one revision (+ skill manifest). |
+| `oc.agents.revisions.activate(id, n)` | Set the active revision (rollback **or** promote). |
+| `oc.agents.activations.list(id)` | Active-pointer audit log. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `GET /agents/:id/revisions` · `…/:rev` | History · one revision (+ skill manifest). |
+| Method · Path | Purpose |
+| ------------------------------------------ | --------------------------------------------- |
+| `GET /agents/:id/revisions` · `…/:rev` | History · one revision (+ skill manifest). |
| `POST /agents/:id/revisions/:rev/activate` | Set the active revision (rollback / promote). |
-| `GET /agents/:id/activations` | Active-pointer audit log. |
+| `GET /agents/:id/activations` | Active-pointer audit log. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
-| `oc agent revisions [--agent <id>]` · `oc agent revisions get <n>` | History · one revision. |
-| `oc agent rollback <n\|rev_…>` | Set the active revision (rollback / promote). |
-| `oc agent activations` | Active-pointer audit log. |
+| Command | Purpose |
+| ------------------------------------------------------------------ | --------------------------------------------- |
+| `oc agent revisions [--agent <id>]` · `oc agent revisions get <n>` | History · one revision. |
+| `oc agent rollback <n\|rev_…>` | Set the active revision (rollback / promote). |
+| `oc agent activations` | Active-pointer audit log. |
</Tab>
@@ -540,14 +587,14 @@ Revisions are **linear** (numbered, immutable). `:rev` is a `number` or `rev_…
**`Revision`**
-| Field | Notes |
-|---|---|
-| `id` `number` `created_at` `active` | id, monotonic number, timestamp, is-active flag |
-| `prompt` `model` | the behavior |
-| `skill_bundle_digest?` | content-addressed skills bundle (`null` = no skills) |
-| `digest` | behavior content hash (change detection) |
-| `runtime_ref` | `floating` (latest shared runtime) — `pinned` later (custom runtime) |
-| `files?` | `[{ path, mode, size }]` — only on `GET …/revisions/:rev` |
+| Field | Notes |
+| ----------------------------------- | -------------------------------------------------------------------- |
+| `id` `number` `created_at` `active` | id, monotonic number, timestamp, is-active flag |
+| `prompt` `model` | the behavior |
+| `skill_bundle_digest?` | content-addressed skills bundle (`null` = no skills) |
+| `digest` | behavior content hash (change detection) |
+| `runtime_ref` | `floating` (latest shared runtime) — `pinned` later (custom runtime) |
+| `files?` | `[{ path, mode, size }]` — only on `GET …/revisions/:rev` |
### Skills
@@ -555,28 +602,28 @@ Revisions are **linear** (numbered, immutable). `:rev` is a `number` or `rev_…
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.agents.skills.get(id)` | List the active revision's skills (name, description, files). |
-| `oc.agents.skills.put(id, zip)` | Replace skills from a `.zip` → new revision. |
-| `oc.agents.skills.delete(id)` | Remove all skills → new revision. |
+| Call | Purpose |
+| ------------------------------- | ------------------------------------------------------------- |
+| `oc.agents.skills.get(id)` | List the active revision's skills (name, description, files). |
+| `oc.agents.skills.put(id, zip)` | Replace skills from a `.zip` → new revision. |
+| `oc.agents.skills.delete(id)` | Remove all skills → new revision. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `GET /agents/:id/skills` | List the active revision's skills. |
-| `PUT /agents/:id/skills` | Replace skills from a `.zip` (`Content-Type: application/zip`) → new revision. |
-| `DELETE /agents/:id/skills` | Remove all skills → new revision. |
+| Method · Path | Purpose |
+| --------------------------- | ------------------------------------------------------------------------------ |
+| `GET /agents/:id/skills` | List the active revision's skills. |
+| `PUT /agents/:id/skills` | Replace skills from a `.zip` (`Content-Type: application/zip`) → new revision. |
+| `DELETE /agents/:id/skills` | Remove all skills → new revision. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
+| Command | Purpose |
+| ----------------------- | -------------------------------------------------------------------------------- |
| `oc agent deploy <dir>` | Deploy a directory; a `skills/` folder inside it ships as skills → new revision. |
Skills have no dedicated CLI verb yet — deploy a directory that contains a `skills/` folder, or use the REST endpoints / dashboard.
@@ -593,31 +640,31 @@ A skill is a folder with a `SKILL.md`; PUT/DELETE are **deployments** (versioned
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.agents.deploymentSource.link(id, params)` | Link a repo directory → push-to-deploy. |
-| `oc.agents.deploymentSource.get(id)` | The link + status. |
-| `oc.agents.deploymentSource.unlink(id)` | Remove the link (shared App webhook untouched). |
+| Call | Purpose |
+| --------------------------------------------- | ----------------------------------------------- |
+| `oc.agents.deploymentSource.link(id, params)` | Link a repo directory → push-to-deploy. |
+| `oc.agents.deploymentSource.get(id)` | The link + status. |
+| `oc.agents.deploymentSource.unlink(id)` | Remove the link (shared App webhook untouched). |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /agents/:id/deployment-source` | Link a repo directory. Body: `{ repo, path, production_ref?, deploy_now?=true }`. |
-| `GET /agents/:id/deployment-source` | The link + status. |
-| `DELETE /agents/:id/deployment-source` | Remove the link. |
+| Method · Path | Purpose |
+| -------------------------------------- | --------------------------------------------------------------------------------- |
+| `POST /agents/:id/deployment-source` | Link a repo directory. Body: `{ repo, path, production_ref?, deploy_now?=true }`. |
+| `GET /agents/:id/deployment-source` | The link + status. |
+| `DELETE /agents/:id/deployment-source` | Remove the link. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
-| `oc agent link <owner/repo> --path <p> [--branch <ref>] [--no-deploy]` | Link a repo directory. |
-| `oc agent status [id\|name]` | The agent's active revision + link status. |
-| `oc agent unlink` | Remove the link. |
+| Command | Purpose |
+| ---------------------------------------------------------------------- | ------------------------------------------ |
+| `oc agent link <owner/repo> --path <p> [--branch <ref>] [--no-deploy]` | Link a repo directory. |
+| `oc agent status [id\|name]` | The agent's active revision + link status. |
+| `oc agent unlink` | Remove the link. |
</Tab>
@@ -633,55 +680,57 @@ that deploy auto-activates. Repo/path are server-anchored to the link. Deploymen
**`DeploymentSource`**
-| Field | Notes |
-|---|---|
-| `agent_id` `repo_id` `path` | the linked agent · repo · directory within it |
-| `production_ref` | branch that auto-activates on push |
-| `status` | `active`, or a problem: `path_missing`, `ref_missing` (production branch deleted), `auth_required`, `repo_not_selected`, `app_suspended`, `error` |
-| `latest_seen_sha?` `active_deployed_sha?` | newest sha observed · sha behind the active revision |
+| Field | Notes |
+| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `agent_id` `repo_id` `path` | the linked agent · repo · directory within it |
+| `production_ref` | branch that auto-activates on push |
+| `status` | `active`, or a problem: `source_profile_changed`, `path_missing`, `ref_missing` (production branch deleted), `auth_required`, `repo_not_selected`, `app_suspended`, `error` |
+| `latest_seen_sha?` `active_deployed_sha?` | newest sha observed · sha behind the active revision |
+| `source_profile?` `source_profile_version?` | server-selected repository interpretation pinned for this link (`flue-app-v1`, version `1`) |
+| `review_fingerprint?` | digest of the latest accepted, exact-SHA reviewed plan; never source bytes or a credential |
## Schedules
-*Run an agent on a cron — each firing starts a session. Managed with the SDK, the `oc` CLI, or REST (org key). Full guide: [Schedules](/agent-sessions/schedules).*
+_Run an agent on a cron — each firing starts a session. Managed with the SDK, the `oc` CLI, or REST (org key). Full guide: [Schedules](/agent-sessions/schedules)._
<Tabs>
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.agents.schedules.create(id, params)` | Create a schedule (`{ name, cron, tz?, input, overlap? }`). |
-| `oc.agents.schedules.list(id)` · `.get(id, sid)` | List / fetch. |
-| `oc.agents.schedules.update(id, sid, params)` | Edit `cron`/`tz`/`input`/`overlap`, or `{ paused }`. |
-| `oc.agents.schedules.delete(id, sid)` | Delete (run history kept). |
-| `oc.agents.schedules.fire(id, sid)` | Fire now → a run; doesn't advance the cron. |
-| `oc.agents.schedules.runs(id, sid, { cursor?, limit? })` | Run history (each carries `sessionId`). |
+| Call | Purpose |
+| -------------------------------------------------------- | ----------------------------------------------------------- |
+| `oc.agents.schedules.create(id, params)` | Create a schedule (`{ name, cron, tz?, input, overlap? }`). |
+| `oc.agents.schedules.list(id)` · `.get(id, sid)` | List / fetch. |
+| `oc.agents.schedules.update(id, sid, params)` | Edit `cron`/`tz`/`input`/`overlap`, or `{ paused }`. |
+| `oc.agents.schedules.delete(id, sid)` | Delete (run history kept). |
+| `oc.agents.schedules.fire(id, sid)` | Fire now → a run; doesn't advance the cron. |
+| `oc.agents.schedules.runs(id, sid, { cursor?, limit? })` | Run history (each carries `sessionId`). |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /agents/:id/schedules` | Create → `201 { schedule }`. Body `{ name, cron, tz?, input, overlap? }`. |
-| `GET /agents/:id/schedules` · `…/:sid` | List / fetch. |
-| `PATCH /agents/:id/schedules/:sid` | Edit `cron`/`tz`/`input`/`overlap`, or `{ paused }`. |
-| `DELETE /agents/:id/schedules/:sid` | Delete → `204` (runs kept). |
-| `POST /agents/:id/schedules/:sid/fire` | Fire now → `201 { run }`; doesn't advance the cron. |
-| `GET /agents/:id/schedules/:sid/runs?cursor=&limit=` | Run history → `{ runs, next_cursor }`. |
+| Method · Path | Purpose |
+| ---------------------------------------------------- | ------------------------------------------------------------------------- |
+| `POST /agents/:id/schedules` | Create → `201 { schedule }`. Body `{ name, cron, tz?, input, overlap? }`. |
+| `GET /agents/:id/schedules` · `…/:sid` | List / fetch. |
+| `PATCH /agents/:id/schedules/:sid` | Edit `cron`/`tz`/`input`/`overlap`, or `{ paused }`. |
+| `DELETE /agents/:id/schedules/:sid` | Delete → `204` (runs kept). |
+| `POST /agents/:id/schedules/:sid/fire` | Fire now → `201 { run }`; doesn't advance the cron. |
+| `GET /agents/:id/schedules/:sid/runs?cursor=&limit=` | Run history → `{ runs, next_cursor }`. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
-| `oc agent schedule create <name> --agent <id> --cron <c> [--tz <z>] --input <s>` | Create a schedule. |
-| `oc agent schedules [--agent <id>]` · `oc agent schedule get <name>` | List / fetch. |
-| `oc agent schedule pause\|resume <name>` | Pause / resume. |
-| `oc agent schedule delete <name>` | Delete. |
-| `oc agent schedule fire <name>` | Fire now (prints the `ses_…`). |
-| `oc agent schedule runs <name>` | Run history. |
+| Command | Purpose |
+| -------------------------------------------------------------------------------- | ------------------------------ |
+| `oc agent schedule create <name> --agent <id> --cron <c> [--tz <z>] --input <s>` | Create a schedule. |
+| `oc agent schedules [--agent <id>]` · `oc agent schedule get <name>` | List / fetch. |
+| `oc agent schedule pause\|resume <name>` | Pause / resume. |
+| `oc agent schedule delete <name>` | Delete. |
+| `oc agent schedule fire <name>` | Fire now (prints the `ses_…`). |
+| `oc agent schedule runs <name>` | Run history. |
</Tab>
@@ -691,14 +740,14 @@ that deploy auto-activates. Repo/path are server-anchored to the link. Deploymen
**`Schedule`**
-| Field | Notes |
-|---|---|
-| `id` `agent_id` | `sch_…` · the owning agent |
-| `name` `cron` `tz?` `input` | handle (unique per agent) · 5-field cron · IANA tz · first message |
-| `overlap` | `skip` (default) · `allow` |
-| `state` | `active · paused · auto_paused` (five straight scheduled-firing failures auto-pause) |
-| `next_fire_at` `last_fired_at?` | next occurrence · last fire |
-| `consecutive_failures` `last_error?` | in-a-row enactment failures · last error (cleared on success) |
+| Field | Notes |
+| ------------------------------------ | ------------------------------------------------------------------------------------ |
+| `id` `agent_id` | `sch_…` · the owning agent |
+| `name` `cron` `tz?` `input` | handle (unique per agent) · 5-field cron · IANA tz · first message |
+| `overlap` | `skip` (default) · `allow` |
+| `state` | `active · paused · auto_paused` (five straight scheduled-firing failures auto-pause) |
+| `next_fire_at` `last_fired_at?` | next occurrence · last fire |
+| `consecutive_failures` `last_error?` | in-a-row enactment failures · last error (cleared on success) |
**`Run`** — one per firing decision, newest-first: `srn_…` with `outcome` (`enacted` · `skipped` · `failed`), `scheduled_for?` (`null` for a manual fire), `fired_at`, `session_id?` (when enacted), `error?`. Chain `session_id` into `GET /sessions/:id`.
@@ -712,21 +761,21 @@ return context, not a redirect URL. Status responses never contain credentials.
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.agents.authorizeManagedSlack(id, { returnDeploymentId? })` | Start managed-app OAuth. |
-| `oc.agents.getManagedSlack(id)` | Read workspace, app identity, state, and `openUrl`. |
-| `oc.agents.disconnectManagedSlack(id)` | Stop routing this agent without uninstalling the workspace app. |
+| Call | Purpose |
+| -------------------------------------------------------------- | --------------------------------------------------------------- |
+| `oc.agents.authorizeManagedSlack(id, { returnDeploymentId? })` | Start managed-app OAuth. |
+| `oc.agents.getManagedSlack(id)` | Read workspace, app identity, state, and `openUrl`. |
+| `oc.agents.disconnectManagedSlack(id)` | Stop routing this agent without uninstalling the workspace app. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
+| Method · Path | Purpose |
+| ------------------------------------------ | --------------------------------------------------------- |
| `POST /agents/:id/slack/managed/authorize` | Start managed-app OAuth; accepts `return_deployment_id?`. |
-| `GET /agents/:id/slack/managed` | Read the managed connection. |
-| `DELETE /agents/:id/slack/managed` | Disconnect the agent from the shared app. |
+| `GET /agents/:id/slack/managed` | Read the managed connection. |
+| `DELETE /agents/:id/slack/managed` | Disconnect the agent from the shared app. |
</Tab>
@@ -739,41 +788,41 @@ states expose only a stable `error_code`.
Builder-owned Slack apps remain a separate resource and can overlap during an
explicit handoff:
-| TypeScript SDK | REST API |
-| --- | --- |
-| `oc.agents.slackManifest(id)` | `POST /agents/:id/slack/manifest` |
-| `oc.agents.connectSlack(id, values)` | `POST /agents/:id/slack` |
-| `oc.agents.getSlack(id)` | `GET /agents/:id/slack` |
-| `oc.agents.disconnectSlack(id)` | `DELETE /agents/:id/slack` |
+| TypeScript SDK | REST API |
+| ------------------------------------ | --------------------------------- |
+| `oc.agents.slackManifest(id)` | `POST /agents/:id/slack/manifest` |
+| `oc.agents.connectSlack(id, values)` | `POST /agents/:id/slack` |
+| `oc.agents.getSlack(id)` | `GET /agents/:id/slack` |
+| `oc.agents.disconnectSlack(id)` | `DELETE /agents/:id/slack` |
See [Slack](/agent-sessions/slack) for installation, trust boundaries, and
conversation behavior.
## Destinations
-*Webhooks are configured via SDK/REST (no `oc` command).*
+_Webhooks are configured via SDK/REST (no `oc` command)._
<Tabs>
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `session.destinations.create(params)` | Register a webhook destination. |
-| `session.destinations.list()` · `.get(did)` | List / fetch. |
-| `session.destinations.update(did, params)` | Pause/resume (`enabled`), retune `level`/`types`, rotate `secret`. |
-| `session.destinations.delete(did)` | Remove. |
+| Call | Purpose |
+| ------------------------------------------- | ------------------------------------------------------------------ |
+| `session.destinations.create(params)` | Register a webhook destination. |
+| `session.destinations.list()` · `.get(did)` | List / fetch. |
+| `session.destinations.update(did, params)` | Pause/resume (`enabled`), retune `level`/`types`, rotate `secret`. |
+| `session.destinations.delete(did)` | Remove. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /sessions/:id/destinations` | Register a webhook destination. |
-| `GET /sessions/:id/destinations` · `…/:did` | List / fetch. |
-| `PATCH /sessions/:id/destinations/:did` | Pause/resume, retune, rotate. |
-| `DELETE /sessions/:id/destinations/:did` | Remove. |
+| Method · Path | Purpose |
+| ------------------------------------------- | ------------------------------- |
+| `POST /sessions/:id/destinations` | Register a webhook destination. |
+| `GET /sessions/:id/destinations` · `…/:did` | List / fetch. |
+| `PATCH /sessions/:id/destinations/:did` | Pause/resume, retune, rotate. |
+| `DELETE /sessions/:id/destinations/:did` | Remove. |
</Tab>
@@ -783,27 +832,27 @@ Destination body: `url`, `secret?`, `level?` (`user`), `types?[]`, `include_raw?
## Deliveries
-*Delivery records are read via SDK/REST (no `oc` command).*
+_Delivery records are read via SDK/REST (no `oc` command)._
<Tabs>
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `session.deliveries.list(opts)` | List deliveries — status, attempts, last response/error. |
-| `session.deliveries.get(id)` | One delivery, in detail. |
-| `session.deliveries.redeliver(id)` | Re-send any delivery. |
+| Call | Purpose |
+| ---------------------------------- | -------------------------------------------------------- |
+| `session.deliveries.list(opts)` | List deliveries — status, attempts, last response/error. |
+| `session.deliveries.get(id)` | One delivery, in detail. |
+| `session.deliveries.redeliver(id)` | Re-send any delivery. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `GET /sessions/:id/deliveries?destination=&status=&after=&limit=` | List deliveries. |
-| `GET /sessions/:id/deliveries/:id` | One delivery. |
-| `POST /sessions/:id/deliveries/:id/redeliver` | Re-send any delivery. |
+| Method · Path | Purpose |
+| ----------------------------------------------------------------- | --------------------- |
+| `GET /sessions/:id/deliveries?destination=&status=&after=&limit=` | List deliveries. |
+| `GET /sessions/:id/deliveries/:id` | One delivery. |
+| `POST /sessions/:id/deliveries/:id/redeliver` | Re-send any delivery. |
</Tab>
@@ -813,22 +862,22 @@ See [Webhooks](/agent-sessions/webhooks#signing-retries-and-dedupe) for signing,
**`Destination`**
-| Field | Notes |
-|---|---|
-| `id` `session` `kind` `created_at` `updated_at` | |
-| `url` | webhook target |
-| `level` `types` | visibility threshold · event-type filter |
-| `include_raw` `enabled` `has_secret` | include raw bodies · paused/active · whether a signing secret is set |
-| `created_after_seq` | only events after this seq are delivered |
+| Field | Notes |
+| ----------------------------------------------- | -------------------------------------------------------------------- |
+| `id` `session` `kind` `created_at` `updated_at` | |
+| `url` | webhook target |
+| `level` `types` | visibility threshold · event-type filter |
+| `include_raw` `enabled` `has_secret` | include raw bodies · paused/active · whether a signing secret is set |
+| `created_after_seq` | only events after this seq are delivered |
**`Delivery`**
-| Field | Notes |
-|---|---|
-| `id` `session` `destination` `created_at` `updated_at` | |
-| `event_id` `event_seq` | the event delivered |
-| `status` `attempts` `last_attempt_at` | delivery state, retry count, last try |
-| `response_code?` `error?` | last response · failure detail |
+| Field | Notes |
+| ------------------------------------------------------ | ------------------------------------- |
+| `id` `session` `destination` `created_at` `updated_at` | |
+| `event_id` `event_seq` | the event delivered |
+| `status` `attempts` `last_attempt_at` | delivery state, retry count, last try |
+| `response_code?` `error?` | last response · failure detail |
## GitHub Apps and Repos
@@ -838,36 +887,36 @@ A GitHub App lets OpenComputer mint short-lived, repo-scoped tokens; a **Repo**
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.repos.create(params)` · `.get(id)` · `.list()` · `.update(id, params)` | Register / fetch / list / rename a repo. |
-| `oc.github.apps.list()` | List GitHub Apps available to your org. |
-| `oc.github.apps.register(params)` | Register your own App (`byo_stored_key` / `byo_broker`). |
-| `oc.github.apps.createManifestUrl(params)` | One-click: a link to open; OpenComputer hosts the flow + key capture. |
-| `oc.github.apps.createManifest/completeManifest(params)` | Developer-driven manifest flow. |
-| `oc.github.apps.update(id, params)` · `delete(id)` | Update / rotate / remove an App. |
-| `oc.github.installations.list()` | List installations visible to OpenComputer. |
+| Call | Purpose |
+| -------------------------------------------------------------------------- | --------------------------------------------------------------------- |
+| `oc.repos.create(params)` · `.get(id)` · `.list()` · `.update(id, params)` | Register / fetch / list / rename a repo. |
+| `oc.github.apps.list()` | List GitHub Apps available to your org. |
+| `oc.github.apps.register(params)` | Register your own App (`byo_stored_key` / `byo_broker`). |
+| `oc.github.apps.createManifestUrl(params)` | One-click: a link to open; OpenComputer hosts the flow + key capture. |
+| `oc.github.apps.createManifest/completeManifest(params)` | Developer-driven manifest flow. |
+| `oc.github.apps.update(id, params)` · `delete(id)` | Update / rotate / remove an App. |
+| `oc.github.installations.list()` | List installations visible to OpenComputer. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /repos` · `GET /repos/:id` · `GET /repos` · `PATCH /repos/:id` | Register / fetch / list / rename a repo. |
-| `GET /github/apps` · `POST /github/apps` | List · register your own App. |
-| `PATCH /github/apps/:id` · `DELETE /github/apps/:id` | Update / rotate / remove. |
+| Method · Path | Purpose |
+| ---------------------------------------------------------------------------------- | ------------------------------------------- |
+| `POST /repos` · `GET /repos/:id` · `GET /repos` · `PATCH /repos/:id` | Register / fetch / list / rename a repo. |
+| `GET /github/apps` · `POST /github/apps` | List · register your own App. |
+| `PATCH /github/apps/:id` · `DELETE /github/apps/:id` | Update / rotate / remove. |
| `POST /github/apps/manifest` · `…/manifest/start` · `…/callback` · `…/conversions` | Manifest flow (hosted or developer-driven). |
-| `GET /github/installations` | List installations visible to OpenComputer. |
+| `GET /github/installations` | List installations visible to OpenComputer. |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
-| `oc repo add <owner/repo>` · `oc repo list` · `oc repo get <id>` | Register / list / fetch a repo. |
-| *(App install + manifest — browser flow; manage in the dashboard or via SDK/REST)* | |
+| Command | Purpose |
+| ---------------------------------------------------------------------------------- | ------------------------------- |
+| `oc repo add <owner/repo>` · `oc repo list` · `oc repo get <id>` | Register / list / fetch a repo. |
+| _(App install + manifest — browser flow; manage in the dashboard or via SDK/REST)_ | |
</Tab>
@@ -885,31 +934,31 @@ Repo = { id, provider, owner, repo, name?, created_at, updated_at }
<Tab title="TypeScript SDK">
-| Call | Purpose |
-| --- | --- |
-| `oc.credentials.create(params)` | Add a provider key. |
-| `oc.credentials.list()` · `oc.credentials.delete(id)` | List / remove. |
-| `oc.credentials.setDefault(params)` | Set the org default. |
+| Call | Purpose |
+| ----------------------------------------------------- | -------------------- |
+| `oc.credentials.create(params)` | Add a provider key. |
+| `oc.credentials.list()` · `oc.credentials.delete(id)` | List / remove. |
+| `oc.credentials.setDefault(params)` | Set the org default. |
</Tab>
<Tab title="REST API">
-| Method · Path | Purpose |
-| --- | --- |
-| `POST /credentials` | Add a provider key. |
-| `GET /credentials` · `DELETE /credentials/:id` | List / remove. |
-| `PUT /credentials/default` | Set the org default (provider derived). |
+| Method · Path | Purpose |
+| ---------------------------------------------- | --------------------------------------- |
+| `POST /credentials` | Add a provider key. |
+| `GET /credentials` · `DELETE /credentials/:id` | List / remove. |
+| `PUT /credentials/default` | Set the org default (provider derived). |
</Tab>
<Tab title="oc CLI">
-| Command | Purpose |
-| --- | --- |
-| `oc credential add --provider <p> --key <k> [--default]` | Add a provider key. |
-| `oc credential list` · `oc credential remove <id>` | List / remove. |
-| `oc credential set-default <id>` | Set the org default. |
+| Command | Purpose |
+| -------------------------------------------------------- | -------------------- |
+| `oc credential add --provider <p> --key <k> [--default]` | Add a provider key. |
+| `oc credential list` · `oc credential remove <id>` | List / remove. |
+| `oc credential set-default <id>` | Set the org default. |
</Tab>
diff --git a/docs/agent-sessions/flue.mdx b/docs/agent-sessions/flue.mdx
index 64e78bc1..f4a7fc16 100644
--- a/docs/agent-sessions/flue.mdx
+++ b/docs/agent-sessions/flue.mdx
@@ -5,9 +5,10 @@ description: "Deploy a Flue app as an OpenComputer agent"
---
<Note>
-**Experimental.** The supported profile is intentionally narrow. It currently covers direct text
-sessions on managed Anthropic models, with an optional OpenComputer sandbox. Flue is pre-1.0, and
-each deployment includes the exact Flue version installed in your app.
+ **Experimental.** The supported profile is intentionally narrow. It currently
+ covers direct text sessions on managed Anthropic models, with an optional
+ OpenComputer sandbox. Flue is pre-1.0, and each deployment includes the exact
+ Flue version installed in your app.
</Note>
[Flue](https://flueframework.com) is a TypeScript framework for durable agents. OpenComputer runs the
@@ -21,14 +22,14 @@ Starter: [`diggerhq/oc-flue-starter`](https://github.com/diggerhq/oc-flue-starte
The built-in runtimes run Claude Code, Codex, or pi as a managed coding agent. A Flue agent is
different: **your application is the runtime**. OpenComputer deploys and operates that app.
-| Concern | Built-in runtimes | Flue |
-| --- | --- | --- |
-| Agent loop | OpenComputer runs Claude Code, Codex, or pi | Your compiled Flue app contains the loop |
-| Session compute | Managed per-session brain and workspace sandboxes | One deployed app, with one Durable Object instance per session |
+| Concern | Built-in runtimes | Flue |
+| ------------------ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
+| Agent loop | OpenComputer runs Claude Code, Codex, or pi | Your compiled Flue app contains the loop |
+| Session compute | Managed per-session brain and workspace sandboxes | One deployed app, with one Durable Object instance per session |
| Conversation state | Checkpointed runtime files plus the OpenComputer event log | Flue stores its conversation in Durable Object SQLite; OpenComputer projects public milestones into its event log |
-| Tools and skills | Platform tools plus uploaded `prompt.md` and `skills/` | `defineTool` code and packaged skill imports compiled into the Worker |
-| Linux workspace | Part of the normal runtime | Absent by default; `ocSandbox` creates one only when an operation needs it |
-| Deployment | Upload prompt, model, and skill configuration | Build and deploy the compiled app |
+| Tools and skills | Platform tools plus uploaded `prompt.md` and `skills/` | `defineTool` code and packaged skill imports compiled into the Worker |
+| Linux workspace | Part of the normal runtime | Absent by default; `ocSandbox` creates one only when an operation needs it |
+| Deployment | Upload prompt, model, and skill configuration | Build and deploy the compiled app |
Under the hood, OpenComputer runs Flue's Cloudflare target as an agent Worker and gives each session
its own Durable Object. This architecture lets a Flue session start without provisioning a virtual
@@ -82,6 +83,7 @@ The shortest path for an existing Flue app is the dashboard:
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**.
+7. Choose **Connect Slack** while the build continues. When both are ready, the same page changes that action to **Open Slack**.
The selected root is its own build context and must contain `agent.toml`, `package.json`, and a
committed `package-lock.json`. The package must declare a Node engine compatible with the exact
@@ -105,10 +107,11 @@ OpenComputer sandbox. The build request carries no GitHub token, OpenComputer ke
credential, Workers credential, or secret store.
<Note>
-Repository import creates the initial deployment from the selected production branch. Each later
-push to that branch that touches the selected root automatically creates another deployment for the
-new exact commit. Flue ignores pushes to other branches because it has one live Worker and no
-preview/staged Worker in the current profile.
+ Repository import creates the initial deployment from the selected production
+ branch. Each later push to that branch that touches the selected root
+ automatically creates another deployment for the new exact commit. Flue
+ ignores pushes to other branches because it has one live Worker and no
+ preview/staged Worker in the current profile.
</Note>
The review step returns a receipt for the exact source plan. Import re-resolves GitHub authority and
@@ -179,8 +182,8 @@ npm install @opencomputer/flue
Export the OpenComputer route and register the managed model gateway inside your agent initializer:
```ts src/agents/support-triage.ts
-import { defineAgent, defineAgentProfile } from '@flue/runtime';
-import { DEFAULT_MODEL, route, useOcGateway } from '@opencomputer/flue';
+import { defineAgent, defineAgentProfile } from "@flue/runtime";
+import { DEFAULT_MODEL, route, useOcGateway } from "@opencomputer/flue";
export { route };
@@ -189,7 +192,8 @@ export default defineAgent((ctx) => {
return {
profile: defineAgentProfile({
- instructions: 'Triage customer requests and give the next concrete action.',
+ instructions:
+ "Triage customer requests and give the next concrete action.",
}),
model: DEFAULT_MODEL,
};
@@ -200,7 +204,7 @@ Use the default hosting app, which mounts Flue's routes, the deployment health e
OpenComputer telemetry:
```ts src/app.ts
-export { default } from '@opencomputer/flue/app';
+export { default } from "@opencomputer/flue/app";
```
Declare the deployment target:
@@ -222,14 +226,14 @@ choice when you do not need additional routes.
## What `@opencomputer/flue` supplies
-| Export | Purpose |
-| --- | --- |
-| `useOcGateway(ctx)` | Registers the managed Anthropic endpoint inside the Flue initializer |
-| `route` | Opts an agent into the HTTP transport used by managed dispatch |
-| `DEFAULT_MODEL` | Selects the supported prompt-caching-safe default model |
-| `@opencomputer/flue/app` | Provides Flue routes, `GET /health`, and telemetry wiring |
-| `@opencomputer/flue/wire` | Adds telemetry when your project owns its hosting app |
-| `ocSandbox(ctx.env)` | Adds an optional, demand-driven Linux shell and filesystem |
+| Export | Purpose |
+| ------------------------- | -------------------------------------------------------------------- |
+| `useOcGateway(ctx)` | Registers the managed Anthropic endpoint inside the Flue initializer |
+| `route` | Opts an agent into the HTTP transport used by managed dispatch |
+| `DEFAULT_MODEL` | Selects the supported prompt-caching-safe default model |
+| `@opencomputer/flue/app` | Provides Flue routes, `GET /health`, and telemetry wiring |
+| `@opencomputer/flue/wire` | Adds telemetry when your project owns its hosting app |
+| `ocSandbox(ctx.env)` | Adds an optional, demand-driven Linux shell and filesystem |
OpenComputer binds a platform-managed credential for its gateway during deployment. Your provider
key is not compiled into the app or exposed to the Worker.
@@ -240,16 +244,18 @@ Custom `defineTool` handlers run inside the Worker. Import any data or templates
Cloudflare build includes those files:
```ts src/tools/lookup-order.ts
-import { defineTool } from '@flue/runtime';
-import * as v from 'valibot';
-import orders from '../data/orders.json' with { type: 'json' };
+import { defineTool } from "@flue/runtime";
+import * as v from "valibot";
+import orders from "../data/orders.json" with { type: "json" };
export const lookupOrder = defineTool({
- name: 'lookup_order',
- description: 'Look up an order by id.',
+ name: "lookup_order",
+ description: "Look up an order by id.",
input: v.object({ order_id: v.string() }),
run({ input }) {
- return (orders as Record<string, unknown>)[input.order_id] ?? { found: false };
+ return (
+ (orders as Record<string, unknown>)[input.order_id] ?? { found: false }
+ );
},
});
```
@@ -279,13 +285,13 @@ optional OpenComputer sandbox follow the sandbox's separate network policy.
Add `ocSandbox` only when the agent needs a Linux shell or durable files:
```ts
-import { defineAgent, defineAgentProfile } from '@flue/runtime';
+import { defineAgent, defineAgentProfile } from "@flue/runtime";
import {
DEFAULT_MODEL,
ocSandbox,
route,
useOcGateway,
-} from '@opencomputer/flue';
+} from "@opencomputer/flue";
export { route };
@@ -294,7 +300,8 @@ export default defineAgent((ctx) => {
return {
profile: defineAgentProfile({
- instructions: 'Work in the sandbox only when a shell or file operation is needed.',
+ instructions:
+ "Work in the sandbox only when a shell or file operation is needed.",
}),
model: DEFAULT_MODEL,
sandbox: ocSandbox(ctx.env),
@@ -370,6 +377,7 @@ Durable Object is not version-pinned and can also be affected by the Worker chan
To restore a known-good build, check out that source and run `oc agent deploy` again. Flue and Durable
Object schema changes are forward-only, so do not downgrade across an incompatible Flue storage
version.
+
</Warning>
## Session behavior
@@ -391,16 +399,17 @@ and dashboard as the other runtimes. The important differences are:
## Current limitations
-- Direct text session messages are the supported ingress. Flue channels and workflows are not
- connected to OpenComputer yet.
+- Dashboard sessions and the OpenComputer-managed Slack app deliver direct text through the hosted
+ session wire. Native Flue channel bindings and workflows are not exposed by this hosting path.
- Repository sources, checkout, pull-request publishing, watches, and repo-backed workspaces are not
supported for Flue sessions.
- Repository deployment accepts one self-contained npm root with a committed npm lockfile. Pushes
to its linked production branch deploy automatically; preview branches and staged Flue Workers are
not supported.
-- The reviewed entrypoint, model, and variables are guarded. Changing those behavior-bearing
- manifest fields is rejected until existing-agent re-review is available; keep them stable after
- import for now.
+- Each production push is re-inspected at its exact commit. Valid Flue changes—including the
+ entrypoint, model, variables, package, and app source—deploy within the pinned `flue-app-v1`
+ profile; removing or replacing that profile stops before build and leaves the active revision
+ unchanged.
- File and image attachments are not supported.
- The managed gateway currently supports Anthropic models and requires Managed model access for the
organization. Per-session model selection is not supported.
diff --git a/docs/agent-sessions/repos.mdx b/docs/agent-sessions/repos.mdx
index 28c9987a..37936f4f 100644
--- a/docs/agent-sessions/repos.mdx
+++ b/docs/agent-sessions/repos.mdx
@@ -26,26 +26,27 @@ sandbox, and deploys the resulting artifact. Repository credentials reach neithe
## Concepts
-| Concept | Role | Boundary |
-| --- | --- | --- |
-| GitHub App | Mints operation-scoped GitHub tokens. | Not session refs. |
-| Installation | GitHub account and repo selection. | The repos the App may work in. |
-| Repo | A stable owner/repo handle. | No tokens, private keys, or session refs. |
-| Source | `ref`, `sha`, and local name for one session. | Auth comes from your configured GitHub App (OpenComputer App by default) unless inline. |
-| Git operations sandbox | Runs authenticated clone/fetch/publish work. | Separate from the agent; token lives only for one operation. |
-| Deployment source | Repository, root, and production branch for one agent. | Resolves one exact commit; source auth is discarded before build code runs. |
+| Concept | Role | Boundary |
+| ---------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------- |
+| GitHub App | Mints operation-scoped GitHub tokens. | Not session refs. |
+| Installation | GitHub account and repo selection. | The repos the App may work in. |
+| Repo | A stable owner/repo handle. | No tokens, private keys, or session refs. |
+| Source | `ref`, `sha`, and local name for one session. | Auth comes from your configured GitHub App (OpenComputer App by default) unless inline. |
+| Git operations sandbox | Runs authenticated clone/fetch/publish work. | Separate from the agent; token lives only for one operation. |
+| Deployment source | Repository, root, and production branch for one agent. | Resolves one exact commit; source auth is discarded before build code runs. |
<Note>
-`Repo` and `Source` are provider-neutral: `provider`, `owner`, `repo`, `ref`, `sha`.
-GitHub uses GitHub Apps as its auth surface. Other providers can add their own auth
-surface while sessions continue to reference repos and sources the same way.
+ `Repo` and `Source` are provider-neutral: `provider`, `owner`, `repo`, `ref`,
+ `sha`. GitHub uses GitHub Apps as its auth surface. Other providers can add
+ their own auth surface while sessions continue to reference repos and sources
+ the same way.
</Note>
## How it works
Every authenticated Git operation runs in its own **Git operations sandbox** — a minimal
box with `git` and nothing else, provisioned for that one operation and destroyed when it
-finishes. Checkout and publish get *different* boxes. Your agent's own sandboxes — the
+finishes. Checkout and publish get _different_ boxes. Your agent's own sandboxes — the
**brain** that runs the loop and the **hands** sandbox that holds the files — are never one
of these: they hold no token and never run authenticated `git` or `gh`. Files and patches
move between them through object storage, never next to a credential.
@@ -134,9 +135,11 @@ unsupported, the result is a fixable error rather than a guess. Without a manife
`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.
+If the selected root is unrecognized, the review can scan the same bounded tree of at most 25,000
+entries and return up to 20 candidate roots no more than six folders deep. Results follow fixed
+marker precedence, then shallower depth, then repository-relative byte order. 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
@@ -163,7 +166,12 @@ the active revision stays live. Restore the Flue definition, or unlink the sourc
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>
+<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 GitHub
@@ -171,11 +179,21 @@ Pick one. Either way, OpenComputer mints a fresh, repo-scoped token **per operat
for checkout, write only to publish) — the agent never holds one.
<CardGroup cols={2}>
- <Card title="Install the OpenComputer App" icon="github" href="https://github.com/apps/opencomputerdev/installations/new">
- Zero setup. Choose the repos and go — OpenComputer owns the key and mints per operation.
+ <Card
+ title="Install the OpenComputer App"
+ icon="github"
+ href="https://github.com/apps/opencomputerdev/installations/new"
+ >
+ Zero setup. Choose the repos and go — OpenComputer owns the key and mints
+ per operation.
</Card>
- <Card title="Create your own App" icon="wand-magic-sparkles" href="#bring-your-own-app">
- GitHub creates it in a few clicks; OpenComputer federates it, so PRs come from your identity.
+ <Card
+ title="Create your own App"
+ icon="wand-magic-sparkles"
+ href="#bring-your-own-app"
+ >
+ GitHub creates it in a few clicks; OpenComputer federates it, so PRs come
+ from your identity.
</Card>
</CardGroup>
@@ -184,7 +202,11 @@ for checkout, write only to publish) — the agent never holds one.
Use your own GitHub App so PRs, comments, and statuses come from **your** identity. OpenComputer
stores the key encrypted and signs the same per-operation tokens with it.
-<Note>[Watches](/agent-sessions/watches) currently require PRs opened through the **OpenComputer** App — a PR published with a bring-your-own App isn't watchable yet.</Note>
+<Note>
+ [Watches](/agent-sessions/watches) currently require PRs opened through the
+ **OpenComputer** App — a PR published with a bring-your-own App isn't
+ watchable yet.
+</Note>
**Create one** — `createManifestUrl` returns a link; open it and GitHub walks you through
creating the App, then OpenComputer captures the key and registers it. (Creating an App is a
@@ -193,7 +215,9 @@ GitHub-UI flow, so it's a link to open, not a pure API call.)
<CodeGroup>
```ts TypeScript SDK
-const { startUrl } = await oc.github.apps.createManifestUrl({ name: "Your Agents" });
+const { startUrl } = await oc.github.apps.createManifestUrl({
+ name: "Your Agents",
+});
// open startUrl → click "Create" on GitHub → done
```
@@ -212,7 +236,11 @@ Authorization: Bearer $OPENCOMPUTER_API_KEY
<CodeGroup>
```ts TypeScript SDK
-await oc.github.apps.register({ mode: "byo_stored_key", githubAppId: "123456", privateKey: pem });
+await oc.github.apps.register({
+ mode: "byo_stored_key",
+ githubAppId: "123456",
+ privateKey: pem,
+});
```
```http REST API
@@ -239,16 +267,18 @@ PRs**. Publishing requires a configured GitHub App — [install the OpenComputer
<CodeGroup>
```ts TypeScript SDK
-sources: [{
- url: "https://github.com/acme/web.git",
- ref: "refs/pull/42/head",
- sha: "abc123…",
- auth: {
- type: "risky_short_lived_token",
- token: "ghs_…",
- expiresAt: "…",
+sources: [
+ {
+ url: "https://github.com/acme/web.git",
+ ref: "refs/pull/42/head",
+ sha: "abc123…",
+ auth: {
+ type: "risky_short_lived_token",
+ token: "ghs_…",
+ expiresAt: "…",
+ },
},
-}]
+];
```
```json REST API
@@ -267,11 +297,12 @@ sources: [{
</CodeGroup>
<Warning>
-The inline token is **checkout-only** — it checks the repo out once and is then purged, so
-it **cannot publish or open PRs** (publishing requires a configured GitHub App). It also
-**can't refresh**, so use it only for sessions that finish within the token's life.
-OpenComputer rejects a far-future or missing expiry and holds the token encrypted only
-until the first checkout, then purges it. Use this only when a GitHub App is not configured.
+ The inline token is **checkout-only** — it checks the repo out once and is
+ then purged, so it **cannot publish or open PRs** (publishing requires a
+ configured GitHub App). It also **can't refresh**, so use it only for sessions
+ that finish within the token's life. OpenComputer rejects a far-future or
+ missing expiry and holds the token encrypted only until the first checkout,
+ then purges it. Use this only when a GitHub App is not configured.
</Warning>
## Register a repo
@@ -310,12 +341,14 @@ passed** — auth resolves through your configured GitHub App (the OpenComputer
const session = await oc.sessions.create({
agent: agent.id,
input: "Review this pull request.",
- sources: [{
- repo: repo.id,
- ref: "refs/pull/42/head",
- sha: "abc123…",
- name: "head",
- }],
+ sources: [
+ {
+ repo: repo.id,
+ ref: "refs/pull/42/head",
+ sha: "abc123…",
+ name: "head",
+ },
+ ],
});
// checked out at /workspace/sources/head before the first turn
```
diff --git a/sdks/typescript/package-lock.json b/sdks/typescript/package-lock.json
index c6c0dfd7..bc20364b 100644
--- a/sdks/typescript/package-lock.json
+++ b/sdks/typescript/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@opencomputer/sdk",
- "version": "0.12.2",
+ "version": "0.12.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@opencomputer/sdk",
- "version": "0.12.2",
+ "version": "0.12.3",
"license": "MIT",
"devDependencies": {
"@types/node": "^25.3.0",
diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json
index 77b6583b..ed7af07f 100644
--- a/sdks/typescript/package.json
+++ b/sdks/typescript/package.json
@@ -1,6 +1,6 @@
{
"name": "@opencomputer/sdk",
- "version": "0.12.2",
+ "version": "0.12.3",
"description": "TypeScript SDK for OpenComputer - cloud sandbox platform",
"type": "module",
"main": "dist/index.js",
diff --git a/sdks/typescript/src/agents/repository-agents.test.ts b/sdks/typescript/src/agents/repository-agents.test.ts
index ada09497..ecbdab9d 100644
--- a/sdks/typescript/src/agents/repository-agents.test.ts
+++ b/sdks/typescript/src/agents/repository-agents.test.ts
@@ -1,5 +1,17 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { OpenComputer } from "./client.js";
+import type { RepositorySourceInterpretation } from "./repository-agents.js";
+
+// @ts-expect-error invalid profile identity must be flue-app-v1@1 or null/null
+const crossedInvalidProfile: RepositorySourceInterpretation = {
+ disposition: "invalid",
+ sourceProfile: "flue-app-v1",
+ sourceProfileVersion: null,
+ summary: "Invalid source",
+ reasonCode: "manifest_invalid",
+ issues: [],
+};
+void crossedInvalidProfile;
const reviewResponse = {
repository: {
@@ -40,7 +52,7 @@ const reviewResponse = {
variable_names: [],
warnings: [],
},
- review_fingerprint: "sha256:reviewed",
+ review_fingerprint: `sha256:${"b".repeat(64)}` as const,
candidate_roots: [],
candidate_roots_truncated: false,
};
@@ -142,7 +154,7 @@ describe("agent repository review/import", () => {
review: {
sha: reviewResponse.sha,
source_profile: "flue-app-v1",
- fingerprint: "sha256:reviewed",
+ fingerprint: `sha256:${"b".repeat(64)}`,
},
});
});
diff --git a/sdks/typescript/src/agents/repository-agents.ts b/sdks/typescript/src/agents/repository-agents.ts
index 0b4606de..d30e9a6e 100644
--- a/sdks/typescript/src/agents/repository-agents.ts
+++ b/sdks/typescript/src/agents/repository-agents.ts
@@ -75,14 +75,15 @@ export type RepositorySourceInterpretation =
assumptions: string[];
agent: { runtime: "flue"; model: string };
}
- | {
+ | ({
disposition: "invalid";
- sourceProfile: SourceProfileId | null;
- sourceProfileVersion: 1 | null;
summary: string;
reasonCode: string;
issues: RepositoryReviewIssue[];
- }
+ } & (
+ | { sourceProfile: SourceProfileId; sourceProfileVersion: 1 }
+ | { sourceProfile: null; sourceProfileVersion: null }
+ ))
| {
disposition: "unrecognized";
sourceProfile: null;
@@ -100,7 +101,7 @@ interface RepositoryAgentReviewBase {
root: string;
productionRef: string;
sha: string;
- reviewFingerprint: string;
+ reviewFingerprint: `sha256:${string}`;
candidateRoots: RepositoryCandidateRoot[];
candidateRootsTruncated: boolean;
}
@@ -131,7 +132,7 @@ export type RepositoryAgentReview =
export interface RepositoryReviewReceipt {
sha: string;
sourceProfile: SourceProfileId;
- fingerprint: string;
+ fingerprint: `sha256:${string}`;
}
export interface ImportRepositoryAgentParams {
diff --git a/web/src/api/deploy-app-client.test.ts b/web/src/api/deploy-app-client.test.ts
index a8f84bf4..770160f9 100644
--- a/web/src/api/deploy-app-client.test.ts
+++ b/web/src/api/deploy-app-client.test.ts
@@ -58,7 +58,7 @@ describe('deploy app client', () => {
review: {
sha: 'a'.repeat(40),
source_profile: 'flue-app-v1',
- fingerprint: 'sha256:reviewed',
+ fingerprint: `sha256:${'b'.repeat(64)}`,
},
},
'import-command-1',
@@ -81,7 +81,7 @@ describe('deploy app client', () => {
review: {
sha: 'a'.repeat(40),
source_profile: 'flue-app-v1',
- fingerprint: 'sha256:reviewed',
+ fingerprint: `sha256:${'b'.repeat(64)}`,
},
})
})
diff --git a/web/src/api/repository-inspection-schemas.test.ts b/web/src/api/repository-inspection-schemas.test.ts
index 7793a4bd..e4f896df 100644
--- a/web/src/api/repository-inspection-schemas.test.ts
+++ b/web/src/api/repository-inspection-schemas.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, it } from 'vitest'
import { RepositorySourceInspectionSchema } from './schemas'
+const reviewFingerprint = `sha256:${'b'.repeat(64)}`
+
const common = {
repository: {
id: 'repo_0123456789abcdef01234567',
@@ -10,7 +12,7 @@ const common = {
root: '',
production_ref: 'main',
sha: 'a'.repeat(40),
- review_fingerprint: 'sha256:review',
+ review_fingerprint: reviewFingerprint,
candidate_roots: [],
candidate_roots_truncated: false,
}
@@ -52,7 +54,7 @@ describe('repository source inspection schema', () => {
})
expect(parsed.profile?.manifest.entrypoint).toBe('support-triage')
- expect(parsed.review_fingerprint).toBe('sha256:review')
+ expect(parsed.review_fingerprint).toBe(reviewFingerprint)
})
it('treats broken Flue and unrecognized source as review results', () => {
@@ -135,4 +137,51 @@ describe('repository source inspection schema', () => {
}),
).toThrow()
})
+
+ it('rejects crossed invalid profile identities and malformed receipts', () => {
+ const invalid = {
+ ...common,
+ profile: null,
+ interpretation: {
+ disposition: 'invalid',
+ summary: 'Invalid source',
+ reason_code: 'manifest_invalid',
+ issues: [],
+ },
+ }
+ expect(() =>
+ RepositorySourceInspectionSchema.parse({
+ ...invalid,
+ interpretation: {
+ ...invalid.interpretation,
+ source_profile: 'flue-app-v1',
+ source_profile_version: null,
+ },
+ }),
+ ).toThrow()
+ expect(() =>
+ RepositorySourceInspectionSchema.parse({
+ ...invalid,
+ interpretation: {
+ ...invalid.interpretation,
+ source_profile: null,
+ source_profile_version: 1,
+ },
+ }),
+ ).toThrow()
+ expect(() =>
+ RepositorySourceInspectionSchema.parse({
+ ...common,
+ review_fingerprint: 'sha256:not-a-digest',
+ profile: null,
+ interpretation: {
+ disposition: 'unrecognized',
+ source_profile: null,
+ source_profile_version: null,
+ summary: 'No agent found',
+ reason_code: 'unrecognized_source',
+ },
+ }),
+ ).toThrow()
+ })
})
diff --git a/web/src/api/schemas.ts b/web/src/api/schemas.ts
index b6bdce8d..fd75a08c 100644
--- a/web/src/api/schemas.ts
+++ b/web/src/api/schemas.ts
@@ -675,38 +675,50 @@ export const FlueSourceProfileSchema = z.object({
warnings: z.array(RepositoryReviewIssueSchema).default([]),
})
-export const RepositorySourceInterpretationSchema = z.discriminatedUnion(
- 'disposition',
- [
- z.object({
- disposition: z.literal('exact'),
- source_profile: z.literal('flue-app-v1'),
- source_profile_version: z.literal(1),
- summary: z.string(),
- reason_code: z.string(),
- assumptions: z.array(z.string()).default([]),
- agent: z.object({
- runtime: z.literal('flue'),
- model: z.string(),
- }),
- }),
- z.object({
- disposition: z.literal('invalid'),
- source_profile: z.literal('flue-app-v1').nullable(),
- source_profile_version: z.literal(1).nullable(),
- summary: z.string(),
- reason_code: z.string(),
- issues: z.array(RepositoryReviewIssueSchema).default([]),
- }),
- z.object({
- disposition: z.literal('unrecognized'),
- source_profile: z.null(),
- source_profile_version: z.null(),
- summary: z.string(),
- reason_code: z.literal('unrecognized_source'),
- }),
- ],
-)
+const ExactRepositorySourceInterpretationSchema = z.object({
+ disposition: z.literal('exact'),
+ source_profile: z.literal('flue-app-v1'),
+ source_profile_version: z.literal(1),
+ summary: z.string(),
+ reason_code: z.string(),
+ assumptions: z.array(z.string()).default([]),
+ agent: z.object({
+ runtime: z.literal('flue'),
+ model: z.string(),
+ }),
+})
+
+const InvalidRepositorySourceInterpretationBase = z.object({
+ disposition: z.literal('invalid'),
+ summary: z.string(),
+ reason_code: z.string(),
+ issues: z.array(RepositoryReviewIssueSchema).default([]),
+})
+
+const InvalidRepositorySourceInterpretationSchema = z.union([
+ InvalidRepositorySourceInterpretationBase.extend({
+ source_profile: z.literal('flue-app-v1'),
+ source_profile_version: z.literal(1),
+ }),
+ InvalidRepositorySourceInterpretationBase.extend({
+ source_profile: z.null(),
+ source_profile_version: z.null(),
+ }),
+])
+
+const UnrecognizedRepositorySourceInterpretationSchema = z.object({
+ disposition: z.literal('unrecognized'),
+ source_profile: z.null(),
+ source_profile_version: z.null(),
+ summary: z.string(),
+ reason_code: z.literal('unrecognized_source'),
+})
+
+export const RepositorySourceInterpretationSchema = z.union([
+ ExactRepositorySourceInterpretationSchema,
+ InvalidRepositorySourceInterpretationSchema,
+ UnrecognizedRepositorySourceInterpretationSchema,
+])
export const RepositorySourceInspectionSchema = z
.object({
@@ -717,10 +729,10 @@ export const RepositorySourceInspectionSchema = z
}),
root: z.string(),
production_ref: z.string(),
- sha: z.string(),
+ sha: z.string().regex(/^[0-9a-f]{40}$/i),
interpretation: RepositorySourceInterpretationSchema,
profile: FlueSourceProfileSchema.nullable(),
- review_fingerprint: z.string(),
+ review_fingerprint: z.string().regex(/^sha256:[0-9a-f]{64}$/),
candidate_roots: z.array(RepositoryCandidateRootSchema).max(20).default([]),
candidate_roots_truncated: z.boolean(),
})
diff --git a/web/src/api/slack-schemas.test.ts b/web/src/api/slack-schemas.test.ts
index 286692cf..6a5543ce 100644
--- a/web/src/api/slack-schemas.test.ts
+++ b/web/src/api/slack-schemas.test.ts
@@ -1,9 +1,14 @@
-import { describe, expect, it } from 'vitest'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { authorizeManagedSlack } from './client'
import {
ManagedSlackAuthorizeResponseSchema,
ManagedSlackConnectionSchema,
} from './schemas'
+afterEach(() => {
+ vi.unstubAllGlobals()
+})
+
describe('managed Slack response schemas', () => {
it('accepts the browser-safe active connection', () => {
const result = ManagedSlackConnectionSchema.parse({
@@ -38,4 +43,30 @@ describe('managed Slack response schemas', () => {
}),
).toThrow()
})
+
+ it('sends the exact deployment as structured OAuth return context', async () => {
+ let captured: RequestInit | undefined
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn((_input: string | URL | Request, init?: RequestInit) => {
+ captured = init
+ return Promise.resolve(
+ Response.json({
+ mode: 'managed',
+ status: 'pending',
+ authorize_url: 'https://slack.com/oauth/v2/authorize?state=opaque',
+ expires_at: '2026-07-16T18:10:00Z',
+ }),
+ )
+ }),
+ )
+
+ await authorizeManagedSlack('agt_example', 'dep_first')
+
+ expect(captured?.method).toBe('POST')
+ expect(captured?.body).toEqual(expect.any(String))
+ expect(JSON.parse(captured?.body as string)).toEqual({
+ return_deployment_id: 'dep_first',
+ })
+ })
})
diff --git a/web/src/components/agent-deploy-source.tsx b/web/src/components/agent-deploy-source.tsx
index f6068b33..ec05a32e 100644
--- a/web/src/components/agent-deploy-source.tsx
+++ b/web/src/components/agent-deploy-source.tsx
@@ -64,9 +64,12 @@ async function pollDeployUntilActive(
export function AgentDeploySource({
agentId,
autoFocusPicker = false,
+ recoveryOnly = false,
}: {
agentId: string
autoFocusPicker?: boolean
+ /** Flue sources are immutable-profile imports; show only durable recovery. */
+ recoveryOnly?: boolean
}) {
const navigate = useNavigate()
const queryClient = useQueryClient()
@@ -86,6 +89,7 @@ export function AgentDeploySource({
const { data: app, isLoading: appLoading } = useQuery({
queryKey: ['deploy-app'],
queryFn: getDeployApp,
+ enabled: !recoveryOnly,
// The App is installed in another tab; refetch whenever the user returns so the
// card flips to the repo picker immediately (staleTime would otherwise hide it).
refetchOnWindowFocus: 'always',
@@ -225,6 +229,15 @@ export function AgentDeploySource({
repoOptions.unshift({ value: source.full_name, label: source.full_name })
}
+ if (
+ recoveryOnly &&
+ !unlinkedImport &&
+ !srcError &&
+ source?.status !== 'source_profile_changed'
+ ) {
+ return null
+ }
+
return (
<Panel className="overflow-hidden">
<PanelContent className="space-y-3">
diff --git a/web/src/components/source-profile-changed-recovery.test.ts b/web/src/components/source-profile-changed-recovery.test.ts
index 1d8c6225..3f61cb35 100644
--- a/web/src/components/source-profile-changed-recovery.test.ts
+++ b/web/src/components/source-profile-changed-recovery.test.ts
@@ -1,4 +1,7 @@
+import { createElement } from 'react'
+import { renderToStaticMarkup } from 'react-dom/server'
import { describe, expect, it } from 'vitest'
+import { SourceProfileChangedRecovery } from '@/components/source-profile-changed-recovery'
import { sourceChangesUrl } from '@/lib/source-profile-recovery'
describe('source profile change recovery', () => {
@@ -24,4 +27,35 @@ describe('source profile change recovery', () => {
}),
).toBe('https://github.com/example/support')
})
+
+ it('renders the durable restore-or-unlink contract', () => {
+ const html = renderToStaticMarkup(
+ createElement(SourceProfileChangedRecovery, {
+ source: {
+ agent_id: 'agt_test',
+ repo_id: 'repo_0123456789abcdef01234567',
+ path: 'agents/support',
+ production_ref: 'main',
+ status: 'source_profile_changed',
+ latest_seen_sha: 'a'.repeat(40),
+ active_deployed_sha: 'b'.repeat(40),
+ full_name: 'example/support',
+ source_profile: 'flue-app-v1',
+ source_profile_version: 1,
+ review_fingerprint: `sha256:${'c'.repeat(64)}`,
+ },
+ pending: false,
+ onUnlink: () => {},
+ }),
+ )
+
+ expect(html).toContain(
+ 'This repository no longer matches the agent type it was imported as',
+ )
+ expect(html).toContain(
+ 'its current active revision and sessions remain available.',
+ )
+ expect(html).toContain('View source changes')
+ expect(html).toContain('Unlink source')
+ })
})
diff --git a/web/src/lib/deployment-slack-cta.test.ts b/web/src/lib/deployment-slack-cta.test.ts
index e8c0cc8e..3e960cac 100644
--- a/web/src/lib/deployment-slack-cta.test.ts
+++ b/web/src/lib/deployment-slack-cta.test.ts
@@ -64,7 +64,11 @@ describe('deployment and managed Slack composition', () => {
deploymentState: 'ready',
deploymentTerminal: true,
}),
- ).toMatchObject({ action: 'connect', label: 'Connect Slack' })
+ ).toMatchObject({
+ action: 'connect',
+ label: 'Connect Slack',
+ announcement: 'Connect Slack to use this ready agent.',
+ })
})
it('makes deployment recovery primary after failure', () => {
diff --git a/web/src/lib/deployment-slack-cta.ts b/web/src/lib/deployment-slack-cta.ts
index b1e1f2fc..c446d9dc 100644
--- a/web/src/lib/deployment-slack-cta.ts
+++ b/web/src/lib/deployment-slack-cta.ts
@@ -125,6 +125,9 @@ export function deploymentSlackPresentation(input: {
label: 'Connect Slack',
disclosure: true,
status: null,
- announcement: 'Connect Slack while the deployment continues.',
+ announcement:
+ stage === 'ready'
+ ? 'Connect Slack to use this ready agent.'
+ : 'Connect Slack while the deployment continues.',
}
}
diff --git a/web/src/lib/repository-onboarding.test.ts b/web/src/lib/repository-onboarding.test.ts
index bdd77a72..95ec722e 100644
--- a/web/src/lib/repository-onboarding.test.ts
+++ b/web/src/lib/repository-onboarding.test.ts
@@ -16,7 +16,7 @@ const common = {
production_ref: 'main',
sha: 'a'.repeat(40),
profile: null,
- review_fingerprint: 'sha256:review',
+ review_fingerprint: `sha256:${'b'.repeat(64)}`,
candidate_roots: [],
candidate_roots_truncated: false,
} satisfies Omit<RepositorySourceInspection, 'interpretation' | 'profile'> & {
diff --git a/web/src/pages/AgentDetail.tsx b/web/src/pages/AgentDetail.tsx
index a7022d13..5a96e3da 100644
--- a/web/src/pages/AgentDetail.tsx
+++ b/web/src/pages/AgentDetail.tsx
@@ -48,6 +48,7 @@ import {
providerForModel,
withModelGroups,
} from '@/lib/runtimes'
+import { cn } from '@/lib/utils'
const DOCS = 'https://docs.opencomputer.dev/agent-sessions'
@@ -545,9 +546,10 @@ export default function AgentDetail() {
</div>
{/* Right rail: connect-or-status for the agent's source + Slack. */}
<div className="space-y-4">
- {agent.runtime !== 'flue' ? (
- <AgentDeploySource agentId={agent.id} />
- ) : null}
+ <AgentDeploySource
+ agentId={agent.id}
+ recoveryOnly={agent.runtime === 'flue'}
+ />
<SlackConnect
agentId={agent.id}
agentName={agent.name}
@@ -765,25 +767,35 @@ function TabLink({
)
}
-function SourceChip({
+export function SourceChip({
source,
}: {
source: {
full_name?: string | null
path: string
production_ref: string
+ status?: string
} | null
}) {
if (!source) {
return null
}
const label = source.full_name ?? (source.path || 'repo')
+ const needsAttention = source.status === 'source_profile_changed'
return (
- <span className="inline-flex items-center gap-1">
+ <span
+ className={cn(
+ 'inline-flex items-center gap-1',
+ needsAttention && 'text-status-error',
+ )}
+ >
<GitBranch className="size-3" />
<span className="font-mono">
{label}@{source.production_ref}
</span>
+ {needsAttention ? (
+ <span className="font-medium">· Source needs attention</span>
+ ) : null}
</span>
)
}
diff --git a/web/src/pages/Agents.tsx b/web/src/pages/Agents.tsx
index f5e065b7..97bddbdd 100644
--- a/web/src/pages/Agents.tsx
+++ b/web/src/pages/Agents.tsx
@@ -139,7 +139,7 @@ export default function Agents() {
<EmptyState
icon={Bot}
title="No agents yet"
- description="Define an agent once, then start durable sessions from it."
+ description="Import an agent from a repository, or configure one manually."
action={
<Button size="sm" onClick={openCreate} {...createIntentProps}>
<Plus className="size-4" />
diff --git a/web/src/pages/agent-detail-source-chip.test.ts b/web/src/pages/agent-detail-source-chip.test.ts
new file mode 100644
index 00000000..e4f37b7b
--- /dev/null
+++ b/web/src/pages/agent-detail-source-chip.test.ts
@@ -0,0 +1,23 @@
+import { createElement } from 'react'
+import { renderToStaticMarkup } from 'react-dom/server'
+import { describe, expect, it } from 'vitest'
+import { SourceChip } from '@/pages/AgentDetail'
+
+describe('agent source status', () => {
+ it('makes a changed Flue source visible from the normal overview header', () => {
+ const html = renderToStaticMarkup(
+ createElement(SourceChip, {
+ source: {
+ full_name: 'example/support',
+ path: 'agents/support',
+ production_ref: 'main',
+ status: 'source_profile_changed',
+ },
+ }),
+ )
+
+ expect(html).toContain('example/support@main')
+ expect(html).toContain('Source needs attention')
+ expect(html).toContain('text-status-error')
+ })
+})