Using Alara Code
Run history and costs
Every run, who started it, how it ended, and what the agent's work cost.
Every time someone starts a step, Alara Code records a run: which step it was, who started it, which agent did the work, how it ended and how long it took. You can read those records per project in the Run History tab, or across all your projects on the Run history page. This page also explains how Alara Code accounts for what the agent's work cost, and where that shows up.
Two places to see runs
| Where | How to open it | What it lists |
|---|---|---|
| Run History tab | Open a project, then choose Run History in the project's sections | The last 20 runs of that project, newest first |
| Run history page | Run history in the main sidebar (the /runs page) | Up to 100 of the most recent runs across every project you can see, newest first |
Both lists read the same run records. They differ in scope and in how much detail each row carries.
The project's Run History tab
The tab is headed Run history with the line "The last 20 command runs for this project, newest first." Each row has four columns:
| Column | What it shows |
|---|---|
| Command | The step, written as a command, such as /scope or /srs. Underneath, a subtitle says who started it and which agent ran it, for example "by Dana Lee · on SDLC writer". Either half is left out when it is not known. |
| Status | A badge with the run's status (see Run statuses below). A failed run also shows its error message under the badge. |
| Started | The date and time the run began, for example "Sep 28, 02:15 PM". |
| Duration | How long the run took, as 4m 12s or 38s. |
When the project has no runs yet, the tab shows No runs yet with "Run a step in SDLC Studio to see history here."
The tab refreshes itself: every 5 seconds while a step is running on the project, and every 30 seconds otherwise. The duration of a run that is still going is measured up to the last refresh, so it moves forward in steps rather than ticking every second.
The Run history page
The page is headed Run history, "Every pipeline command run across your projects." At the top are four counters:
| Counter | What it counts |
|---|---|
| Total runs | Every run in the list |
| Running | Runs with the running status. While any are running, the counter shows a pulsing Live hint. |
| Completed | Runs with the complete status |
| Errors | Runs that ended error or aborted |
A run waiting for review (pending_review) is counted in Total runs only.
Below the counters is a table with Command, Project, Status, Started and Duration. Click a row (or focus it and press Enter or Space) to open that run's project. This table does not show who started a run, which agent ran it, or the error text — open the project's Run History tab for those.
When none of your projects has a run yet, the page shows No runs yet with "Run a command from any project to see history here."
Run statuses
A run has one of five statuses. The badge shows the status name as recorded.
| Status | Meaning |
|---|---|
running | The step is in progress. The badge carries a pulsing dot. |
pending_review | The step finished and produced a new draft that is waiting for a human to approve it or request changes. |
complete | The step finished and, for a step with an approval gate, its draft was approved. Steps without a gate go straight here when they finish. |
error | The step failed. The error message is shown under the badge in the project's tab. |
aborted | The step was stopped, either by someone pressing stop or because it ran past the time limit for a single run. |
A few details that explain what you see:
- Approval changes the run's status. RFP, Scope, SRS, SDS, STS and Proposal have an approval gate. When one of those finishes with a new draft, its run shows
pending_review; approving the draft turns the same runcomplete. See Review, approve, request changes. - A completed run can go back to review. An approval belongs to one exact version of a document. When a gated step is run again and produces a new version, that step's approval no longer holds, and its earlier
completeruns are switched back topending_reviewso the history matches what still needs approving. Later steps keep their approvals; they are only marked as built on an older input ("re-run, upstream changed" in the composer). See How the pipeline works. - A re-run that changes nothing is an error. If a gated step runs again and produces exactly the document that was already approved, there is nothing new to review. The run ends
errorwith a message saying it did not produce a new version. - Request changes is a run too. When you request changes on a draft, the revision is recorded as a run of that step and lands in
pending_reviewagain. - Chat messages are not runs. Talking to the agent in the project chat does not add rows to Run History.
Who started a run
Anyone who can open a project and holds the run permission can start its steps, so several people may drive one project. The subtitle under each command in the project's tab says by whom: the name of the person who started the run, or their email address when no name is set.
The on part names the Alara agent that did the work. The name is captured when the run starts, so if the project is later bound to a different agent, older rows still show the agent that actually ran them. See Set up the project agent.
Anyone who can see the project can stop a running step, not only the person who started it, provided they hold the stop permission. See Members and permissions.
Durations
Duration is the time from the run's start to its end, shown in whole minutes and seconds (12m 5s) or seconds alone under a minute (42s). A run that has not ended yet is measured up to now (on the Run history page) or up to the last refresh (in the project's tab).
The duration covers the whole run: every call to the agent, and every correction round when a draft fails the document checks. Time spent waiting for your approval afterwards is not part of it.
Errors in the history
A run that ends error stores a message, and the project's Run History tab shows it under the status badge. Common messages:
| Message | What happened | What to do |
|---|---|---|
Starts with AGENT_REPLY_TIMEOUT | The agent did not answer in time. | Check the agent in Alara (its skills and model limits), then run the step again. |
Starts with AGENT_CALL_FAILED | The agent's call failed on Alara's side. | Check the agent's model in Alara, then run the step again. |
Starts with AGENT_INVALID_REPLY | The agent's reply could not be used. | Run the step again; if it keeps failing, check the agent's skill files. |
| "Command /step finished but did not produce a new version …" | A re-run produced the same document that was already approved. | Nothing to review. Change the inputs, or request changes on the draft, if you want a different version. |
| "Command /step finished but did not produce the expected artifact …" | The step ended without writing its document. | Run the step again and read the run output. |
| "Command /tasks did not produce a ticket manifest …" | The Tasks step stopped at a precondition. | Follow the message: usually re-run SDS, then Tasks. |
bridge-restart-sweep | The service restarted while the run was in progress, so the run could not finish. | Run the step again. |
stale-lock: cleared on next acquire | A run held the project for more than 30 minutes without finishing, and the next step started on the project cleared it. | Run the step again. |
Other messages are the underlying technical error. The full catalogue of error codes, with causes and fixes, is in Troubleshooting. While a step is running, the live run panel in SDLC Studio gives more detail than the history does; see Run the pipeline.
A run that was stopped (aborted) shows no message in the tab, whether someone pressed stop or the run hit the time limit.
Who can see run history
Run records follow the project's visibility: you only see runs of projects you can see, within your current organization. Organization admins see every project in the organization; everyone else sees the projects they created and the projects shared with a team they belong to. See Members and permissions.
| What | Permission needed |
|---|---|
| The project's Run History tab | Read on the Projects module |
| The Run history page | Read on the Run module |
Deleting a project removes its run history along with its documents, artifacts and board.
Costs
Alara Code keeps a cost ledger per project. Each entry records the tokens a piece of AI work used and what it cost in US dollars.
What an entry records
One entry is written per model used in a unit of work. Each carries:
- the project, the organization, the person who started the work, and the step (for pipeline work) or other source;
- a link back to the run it belongs to;
- the model name;
- four token counts: input, output, cache read and cache write;
- the cost in US dollars, to six decimal places.
How cost is counted
Cost is computed from a pricing table that holds, for each provider and model, a price per million tokens for each of the four token kinds. The entry's cost is:
cost = (input x input rate + output x output rate
+ cache read x cache read rate + cache write x cache write rate) / 1,000,000
- The model is first resolved to the real model that served the request, so the right price applies.
- When no price is listed for that model, the cost the provider itself reported is used instead, so spend is never dropped.
- When usage arrives without a per-model breakdown, it is recorded against the model name
<unknown>. - A stopped or failed run is still costed for what it used before it ended.
- Writing a cost entry never fails a run. If an entry cannot be written, the run carries on and the spend is simply not recorded.
The breakdown
For a project, the ledger is summed three ways:
| View | What it contains |
|---|---|
| Total | All token counts and the dollar total for the project |
| By step | One row per pipeline step, in pipeline order: tokens, cost, how many distinct runs contributed, and when the last one was recorded. Steps with no cost entries do not appear. |
| By model | One row per model: input tokens, output tokens and cost, most expensive first |
Where costs appear
On the Projects dashboard, a project card shows a cost strip when the project has recorded spend above zero: the input and output token counts (for example "120K in · 34K out") and the dollar total (for example "$1.42"). Projects with no recorded spend show no strip.
The per-step and per-model breakdown is available from the API (below). There is no Cost tab in a project's sections.
Under the hood
| Endpoint | Returns | Permission |
|---|---|---|
GET /api/projects/:id/run-history | { runs: [...] }, the project's last 20 runs: id, command, status, startedAt, endedAt, errorMessage, agentName, startedByName | Projects, read |
GET /api/runs | Up to 100 runs across the projects you can see, each with projectName. Optional teamId narrows it to one team's projects. | Run, read |
GET /api/runs/:runId/output | A snapshot of one run: its status, the buffered output while it is still held, and its artifacts. For clients that cannot follow the live stream. | Run, read |
GET /api/projects/:id/cost | { total, byCommand, byModel } as described in The breakdown above | Projects, read |
Runs live in the run_log table and cost entries in cost_entry, with prices in model_pricing; every read is scoped to your organization and to the projects you can see. See Data model, API reference and Run lifecycle and streaming.