Skip to content

Applies to Cowork 0.1.45 · For everyone who uses Cowork

Service Conversations ​

Not yet released

A background task can hand a batch of files to an AI conversation, which reads them and acts with the tools the Extension declared. The conversation shows in Cowork like any other, so the person can follow it.

dozin.agent ​

FieldTypeRequiredDescription
briefstringYesA .md file in the package: the conversation's instructions
model{ id, effort? }NoModel to use; effort is max, xhigh, high, medium or low
toolsstring[]NoBusiness tools the conversation may use, up to 8. Cowork has none to offer yet, so leave it out
secretstringNoAn env from dozin.secrets those tools use

ctx.agent.handoff(input) Not yet released ​

NameTypeRequiredDescription
input.titlestringYesConversation title; longer than 120 characters is cut
input.filesstring[]Yes1–50 files inside dataDir, relative or absolute paths
input.summarystringNoWhat the batch is; longer than 4000 characters is cut

Returns ​

Promise<HandoffResult>, resolved when the conversation has ended.

FieldTypeDescription
status'completed' | 'failed' | 'stopped' | 'timeout' | 'cancelled' | 'model_unavailable'How it ended
submittednumberItems the conversation submitted. Always 0 in Cowork for now: it has no business tools to submit with
failednumberItems that failed. Always 0 in Cowork for now
sessionIdstringThe conversation, when one was opened
errorstringWhat went wrong

Errors ​

The promise rejects with an error whose code is:

codeMeaning
AGENT_NOT_DECLAREDNo dozin.agent in package.json
BAD_REQUESTMissing title, or files empty or over 50
FILE_NOT_FOUNDA file does not exist, is a folder, or the data folder does not exist
FILE_OUTSIDE_DATAA file is outside dataDir, or is a link
AGENT_BUSYOne conversation is running and one is waiting already
NOT_AVAILABLEService conversations are not available in this Cowork
RUN_ENDEDThe run that made the call has ended

One conversation runs at a time per task and one more may wait; the rest are refused.

Example ​

js
await ctx.writeJson('batches/0001.json', changedPatients);
const result = await ctx.agent.handoff({ title: 'Patients changed', files: ['batches/0001.json'], summary: '3 patients' });
ctx.status(`Handoff ${result.status}`);

For Micromeet Cowork 0.1.41 · build 261111110020