# CompanyOS fixes for Task runs, Product Sources and accepted work

> Agno's CompanyOS lets a durable queue ticket finish when its Task result write fails, flags which Product Sources an agent can read, and tells the executor of an accepted Task that it is running the work.

- Published: 2026-10-23
- Author: Yash Pratap Solanky
- Categories: Changelog
- Canonical: https://www.agno.com/blog/companyos-fixes-for-task-runs-product-sources-and-accepted-work
- Markdown: https://www.agno.com/blog/companyos-fixes-for-task-runs-product-sources-and-accepted-work.md

Agno's durable queue, `QueueConfig(durable=True)`, writes a [CompanyOS](https://www.agno.com/blog/introducing-companyos) Task's result before it finishes the run's ticket, and in earlier releases a Company database that kept failing left that ticket in `running` and made the sweep raise. Two smaller fixes in this release change what agents see about Sources and accepted Tasks.

## Task results stay off the queue's critical path

The worker now checks the run row when the Task write raises. If the row is COMPLETED, ERROR or CANCELLED and the Task records this run as its reservation, the worker logs the error and finishes the ticket, and Company recovery rebuilds the Task result later. The sweep catches each job's failure on its own, so one broken Company job leaves the rest of the batch and the next claims running. A `PermissionError` from the executor's run check now fails the ticket on its first attempt. A same-attempt `POST /company/tasks/{id}/runs` also reconciles a finished run without `AgentOS(scheduler=True)`.

We ran the release's own queue fixture on both releases: a SQLite Company database, a queue on embedded Postgres, the tests' `OfflineModel` stand-in, and `complete_task_run` patched to raise.

```text
# Before (real output)
Task write fails, after the sweep -> ticket: running
  sweep raised RuntimeError: Company database unavailable
unrelated team run after one poll tick: queued
revoked run permission -> ticket: queued, attempt 1 of 2

# Now (real output)
Task write fails, after the sweep -> ticket: completed
unrelated team run after one poll tick: completed
revoked run permission -> ticket: failed, attempt 1 of 2
  error: permanent: Run permission was revoked
```

## Sources say whether an agent can read them

`CompanyTools.list_product_sources` and its async twin add `readable` and `checkout_supported` to each row. Company Manager used to see a remote Git URL among its readers and call `read_product_source`, which rejects Git URLs. Its instructions now send it to readable Sources and to the Product's local repository Source for code.

```text
# Before (real output)
{'type': 'git', 'reference': 'https://github.com/agno-agi/agno'}
{'type': 'website', 'reference': 'https://docs.agno.com'}
{'type': 'git', 'reference': '/var/folders/.../tmp3xhp0i01'}

# Now (real output)
{'type': 'git', 'reference': '/var/folders/.../tmpp8mqtm5l', 'readable': True, 'checkout_supported': False}
{'type': 'website', 'reference': 'https://docs.agno.com', 'readable': True, 'checkout_supported': False}
{'type': 'git', 'reference': 'https://github.com/agno-agi/agno', 'readable': False, 'checkout_supported': True}
```

## Accepted Tasks run with an execution stage

The executor input built by `POST /company/tasks/{id}/runs` carries an `execution_context` next to `brief`, `wiki` and `evidence`. Company Manager also keeps a Routine's proposal-only restriction out of the briefs it writes for future Tasks.

```json
"execution_context": {
  "stage": "accepted_task_execution",
  "task_id": "1afb4e5b-121b-4ca3-83d9-99a37f95105a",
  "instructions": "Execute this accepted Task and return its deliverable with verification evidence. This is execution, not a request to acknowledge or propose the Task. Preserve the brief's scope and restrictions; acceptance grants no additional permissions. If instructions conflict or the work cannot be completed within those bounds, report the precise blocker and what remains undone."
}
```

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/30_company/06_execute_tasks.py), and learn more about the [durable queue](https://docs.agno.com/agent-os/background-execution/durable-queue) in the documentation.
