[{"data":1,"prerenderedAt":454},["ShallowReactive",2],{"docs-page:\u002Fdocs\u002Fchats-and-turns":3,"docs-navigation-links":422},{"id":4,"title":5,"body":6,"description":414,"extension":415,"meta":416,"navigation":417,"path":418,"seo":419,"stem":420,"__hash__":421},"docs\u002Fdocs\u002Fchats-and-turns.md","Chats and turns",{"type":7,"value":8,"toc":405},"minimark",[9,14,18,40,43,47,50,70,73,77,85,217,220,224,227,272,275,279,286,346,349,371,374,378,385,391,395,401],[10,11,13],"h2",{"id":12},"chat","Chat",[15,16,17],"p",{},"A chat is a durable conversation with one coding-agent configuration. It owns:",[19,20,21,25,28,31,34,37],"ul",{},[22,23,24],"li",{},"harness and model;",[22,26,27],{},"system prompt;",[22,29,30],{},"MCP server configuration;",[22,32,33],{},"CPU, memory, disk, and sandbox snapshot;",[22,35,36],{},"the sandbox identity;",[22,38,39],{},"an ordered history of turns.",[15,41,42],{},"The sandbox is stopped after a turn finishes and resumed for the next turn.\nThis ends active compute while preserving the working environment.",[10,44,46],{"id":45},"turn","Turn",[15,48,49],{},"A turn is one prompt executed inside a chat. It owns:",[19,51,52,55,58,61,64,67],{},[22,53,54],{},"the input prompt;",[22,56,57],{},"lifecycle and agent events;",[22,59,60],{},"status, output, and error;",[22,62,63],{},"per-turn input files and repositories;",[22,65,66],{},"output artifacts;",[22,68,69],{},"billable sandbox duration and resource size.",[15,71,72],{},"Turn identifiers are returned as soon as a run is accepted.",[10,74,76],{"id":75},"creating-a-chat","Creating a chat",[15,78,79,80,84],{},"Omit ",[81,82,83],"code",{},"chat_id"," and provide the initial configuration:",[86,87,92],"pre",{"className":88,"code":89,"language":90,"meta":91,"style":91},"language-json shiki shiki-themes github-dark","{\n  \"prompt\": \"Inspect the repository and fix the failing tests.\",\n  \"harness\": \"claude\",\n  \"model\": \"claude-opus-4-8\",\n  \"provider_api_key\": \"sk-ant-...\",\n  \"system_prompt\": \"Prefer small, well-tested changes.\",\n  \"instance\": {\n    \"cpu\": 4,\n    \"memory\": 8\n  }\n}\n","json","",[81,93,94,103,120,133,146,159,172,181,194,205,211],{"__ignoreMap":91},[95,96,99],"span",{"class":97,"line":98},"line",1,[95,100,102],{"class":101},"s95oV","{\n",[95,104,106,110,113,117],{"class":97,"line":105},2,[95,107,109],{"class":108},"sDLfK","  \"prompt\"",[95,111,112],{"class":101},": ",[95,114,116],{"class":115},"sU2Wk","\"Inspect the repository and fix the failing tests.\"",[95,118,119],{"class":101},",\n",[95,121,123,126,128,131],{"class":97,"line":122},3,[95,124,125],{"class":108},"  \"harness\"",[95,127,112],{"class":101},[95,129,130],{"class":115},"\"claude\"",[95,132,119],{"class":101},[95,134,136,139,141,144],{"class":97,"line":135},4,[95,137,138],{"class":108},"  \"model\"",[95,140,112],{"class":101},[95,142,143],{"class":115},"\"claude-opus-4-8\"",[95,145,119],{"class":101},[95,147,149,152,154,157],{"class":97,"line":148},5,[95,150,151],{"class":108},"  \"provider_api_key\"",[95,153,112],{"class":101},[95,155,156],{"class":115},"\"sk-ant-...\"",[95,158,119],{"class":101},[95,160,162,165,167,170],{"class":97,"line":161},6,[95,163,164],{"class":108},"  \"system_prompt\"",[95,166,112],{"class":101},[95,168,169],{"class":115},"\"Prefer small, well-tested changes.\"",[95,171,119],{"class":101},[95,173,175,178],{"class":97,"line":174},7,[95,176,177],{"class":108},"  \"instance\"",[95,179,180],{"class":101},": {\n",[95,182,184,187,189,192],{"class":97,"line":183},8,[95,185,186],{"class":108},"    \"cpu\"",[95,188,112],{"class":101},[95,190,191],{"class":108},"4",[95,193,119],{"class":101},[95,195,197,200,202],{"class":97,"line":196},9,[95,198,199],{"class":108},"    \"memory\"",[95,201,112],{"class":101},[95,203,204],{"class":108},"8\n",[95,206,208],{"class":97,"line":207},10,[95,209,210],{"class":101},"  }\n",[95,212,214],{"class":97,"line":213},11,[95,215,216],{"class":101},"}\n",[15,218,219],{},"Epho creates the chat and its first processing turn in one transaction.",[10,221,223],{"id":222},"adding-a-turn","Adding a turn",[15,225,226],{},"Resume a chat by sending its identifier:",[86,228,230],{"className":88,"code":229,"language":90,"meta":91,"style":91},"{\n  \"chat_id\": \"01K...\",\n  \"prompt\": \"Now document the behavior.\",\n  \"provider_api_key\": \"sk-ant-...\"\n}\n",[81,231,232,236,248,259,268],{"__ignoreMap":91},[95,233,234],{"class":97,"line":98},[95,235,102],{"class":101},[95,237,238,241,243,246],{"class":97,"line":105},[95,239,240],{"class":108},"  \"chat_id\"",[95,242,112],{"class":101},[95,244,245],{"class":115},"\"01K...\"",[95,247,119],{"class":101},[95,249,250,252,254,257],{"class":97,"line":122},[95,251,109],{"class":108},[95,253,112],{"class":101},[95,255,256],{"class":115},"\"Now document the behavior.\"",[95,258,119],{"class":101},[95,260,261,263,265],{"class":97,"line":135},[95,262,151],{"class":108},[95,264,112],{"class":101},[95,266,267],{"class":115},"\"sk-ant-...\"\n",[95,269,270],{"class":97,"line":148},[95,271,216],{"class":101},[15,273,274],{},"The prior chat configuration is inherited. The new request does not need to\nrepeat the harness or model.",[10,276,278],{"id":277},"turn-lifecycle","Turn lifecycle",[15,280,281,282,285],{},"A turn begins as ",[81,283,284],{},"processing",". Lifecycle status events make infrastructure\nprogress visible before the harness produces output:",[287,288,289,302],"table",{},[290,291,292],"thead",{},[293,294,295,299],"tr",{},[296,297,298],"th",{},"Phase",[296,300,301],{},"Meaning",[303,304,305,316,326,336],"tbody",{},[293,306,307,313],{},[308,309,310],"td",{},[81,311,312],{},"queued",[308,314,315],{},"Waiting for a team concurrency slot",[293,317,318,323],{},[308,319,320],{},[81,321,322],{},"provisioning",[308,324,325],{},"Creating a sandbox",[293,327,328,333],{},[308,329,330],{},[81,331,332],{},"resuming",[308,334,335],{},"Starting the chat's existing sandbox",[293,337,338,343],{},[308,339,340],{},[81,341,342],{},"starting",[308,344,345],{},"Launching the selected harness",[15,347,348],{},"Terminal statuses are:",[19,350,351,356,361,366],{},[22,352,353],{},[81,354,355],{},"completed",[22,357,358],{},[81,359,360],{},"failed",[22,362,363],{},[81,364,365],{},"timed_out",[22,367,368],{},[81,369,370],{},"canceled",[15,372,373],{},"A terminal turn cannot move back into processing.",[10,375,377],{"id":376},"concurrency-rules","Concurrency rules",[15,379,380,381,384],{},"Only one turn may be in progress inside a particular chat. Starting another\nturn in that chat before the current one settles returns ",[81,382,383],{},"409 Conflict",".",[15,386,387,388,390],{},"Teams can run multiple chats concurrently. The default team cap is five active\nturns; work above the cap stays queued and emits the ",[81,389,312],{}," phase.",[10,392,394],{"id":393},"isolation","Isolation",[15,396,397,398,384],{},"Every API key is team-scoped. Epho resolves a chat through the authenticated\nteam before resolving its turns. A missing identifier and an identifier owned\nby another team both return ",[81,399,400],{},"404",[402,403,404],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":91,"searchDepth":105,"depth":105,"links":406},[407,408,409,410,411,412,413],{"id":12,"depth":105,"text":13},{"id":45,"depth":105,"text":46},{"id":75,"depth":105,"text":76},{"id":222,"depth":105,"text":223},{"id":277,"depth":105,"text":278},{"id":376,"depth":105,"text":377},{"id":393,"depth":105,"text":394},"Understand epho's durable conversation and single-run primitives.","md",{},true,"\u002Fdocs\u002Fchats-and-turns",{"title":5,"description":414},"docs\u002Fchats-and-turns","3-kYChfqXXDRIA1ETyqwD9LZfsfoZxgozu4P0jAFEW8",[423,426,429,430,433,436,439,442,445,448,451],{"path":424,"title":425},"\u002Fdocs","Overview",{"path":427,"title":428},"\u002Fdocs\u002Fauthentication","Authentication",{"path":418,"title":5},{"path":431,"title":432},"\u002Fdocs\u002Ferrors","Errors and statuses",{"path":434,"title":435},"\u002Fdocs\u002Ffiles-and-repositories","Files and repositories",{"path":437,"title":438},"\u002Fdocs\u002Fharnesses-and-models","Harnesses and models",{"path":440,"title":441},"\u002Fdocs\u002Fmcp-and-environment","MCP and environment",{"path":443,"title":444},"\u002Fdocs\u002Fquickstart","Quickstart",{"path":446,"title":447},"\u002Fdocs\u002Fresources-and-billing","Resources and billing",{"path":449,"title":450},"\u002Fdocs\u002Fresuming-chats","Resuming chats",{"path":452,"title":453},"\u002Fdocs\u002Frunning-agents","Running agents",1785310516453]