[{"data":1,"prerenderedAt":470},["ShallowReactive",2],{"docs-page:\u002Fdocs\u002Frunning-agents":3,"docs-navigation-links":438},{"id":4,"title":5,"body":6,"description":430,"extension":431,"meta":432,"navigation":433,"path":434,"seo":435,"stem":436,"__hash__":437},"docs\u002Fdocs\u002Frunning-agents.md","Running agents",{"type":7,"value":8,"toc":423},"minimark",[9,13,18,29,32,89,99,102,109,198,205,209,219,254,258,261,303,306,325,329,332,338,344,350,360,364,409,419],[10,11,12],"p",{},"Epho provides two submission modes. They differ only in how the client waits;\nboth create the same chat and turn records and use the same worker-backed\nlaunch process.",[14,15,17],"h2",{"id":16},"synchronous-streaming","Synchronous streaming",[10,19,20,24,25,28],{},[21,22,23],"code",{},"POST \u002Fapi\u002Fv1\u002Fchat"," returns ",[21,26,27],{},"text\u002Fevent-stream"," and keeps the request open while\nthe turn runs.",[10,30,31],{},"Frame types:",[33,34,35,48],"table",{},[36,37,38],"thead",{},[39,40,41,45],"tr",{},[42,43,44],"th",{},"Type",[42,46,47],{},"Purpose",[49,50,51,69,79],"tbody",{},[39,52,53,59],{},[54,55,56],"td",{},[21,57,58],{},"chat",[54,60,61,62,65,66],{},"Sent first with ",[21,63,64],{},"chat_id"," and ",[21,67,68],{},"turn_id",[39,70,71,76],{},[54,72,73],{},[21,74,75],{},"event",[54,77,78],{},"Wraps one persisted lifecycle or agent event",[39,80,81,86],{},[54,82,83],{},[21,84,85],{},"done",[54,87,88],{},"Sent last with status, output, error, and artifacts",[90,91,97],"pre",{"className":92,"code":94,"language":95,"meta":96},[93],"language-text","data: {\"type\":\"chat\",\"chat_id\":\"01K...\",\"turn_id\":\"01K...\"}\n\ndata: {\"type\":\"event\",\"event\":{\"type\":\"status\",\"phase\":\"starting\",\"message\":\"Starting the agent…\"}}\n\ndata: {\"type\":\"done\",\"status\":\"completed\",\"output\":\"Done.\",\"error\":null,\"artifacts\":[]}\n","text","",[21,98,94],{"__ignoreMap":96},[10,100,101],{},"Epho also emits SSE keepalive comments during quiet periods so intermediaries\ndo not close the connection.",[10,103,104,105,108],{},"Set ",[21,106,107],{},"cancel_on_disconnect"," to stop the turn if this streaming client disappears:",[90,110,114],{"className":111,"code":112,"language":113,"meta":96,"style":96},"language-json shiki shiki-themes github-dark","{\n  \"prompt\": \"Run the full integration suite.\",\n  \"harness\": \"codex\",\n  \"model\": \"gpt-5.5\",\n  \"provider_api_key\": \"sk-proj-...\",\n  \"cancel_on_disconnect\": true\n}\n","json",[21,115,116,125,142,155,168,181,192],{"__ignoreMap":96},[117,118,121],"span",{"class":119,"line":120},"line",1,[117,122,124],{"class":123},"s95oV","{\n",[117,126,128,132,135,139],{"class":119,"line":127},2,[117,129,131],{"class":130},"sDLfK","  \"prompt\"",[117,133,134],{"class":123},": ",[117,136,138],{"class":137},"sU2Wk","\"Run the full integration suite.\"",[117,140,141],{"class":123},",\n",[117,143,145,148,150,153],{"class":119,"line":144},3,[117,146,147],{"class":130},"  \"harness\"",[117,149,134],{"class":123},[117,151,152],{"class":137},"\"codex\"",[117,154,141],{"class":123},[117,156,158,161,163,166],{"class":119,"line":157},4,[117,159,160],{"class":130},"  \"model\"",[117,162,134],{"class":123},[117,164,165],{"class":137},"\"gpt-5.5\"",[117,167,141],{"class":123},[117,169,171,174,176,179],{"class":119,"line":170},5,[117,172,173],{"class":130},"  \"provider_api_key\"",[117,175,134],{"class":123},[117,177,178],{"class":137},"\"sk-proj-...\"",[117,180,141],{"class":123},[117,182,184,187,189],{"class":119,"line":183},6,[117,185,186],{"class":130},"  \"cancel_on_disconnect\"",[117,188,134],{"class":123},[117,190,191],{"class":130},"true\n",[117,193,195],{"class":119,"line":194},7,[117,196,197],{"class":123},"}\n",[10,199,200,201,204],{},"It defaults to ",[21,202,203],{},"false",", allowing the worker to finish and persist the result\nafter a dropped connection.",[14,206,208],{"id":207},"asynchronous-execution","Asynchronous execution",[10,210,211,214,215,218],{},[21,212,213],{},"POST \u002Fapi\u002Fv1\u002Fchat\u002Fasync"," queues the turn and returns ",[21,216,217],{},"202"," with its identifiers.\nUse this mode for background jobs, automation, and any caller that should not\nhold an HTTP connection.",[90,220,222],{"className":111,"code":221,"language":113,"meta":96,"style":96},"{\n  \"chat_id\": \"01K...\",\n  \"turn_id\": \"01K...\"\n}\n",[21,223,224,228,240,250],{"__ignoreMap":96},[117,225,226],{"class":119,"line":120},[117,227,124],{"class":123},[117,229,230,233,235,238],{"class":119,"line":127},[117,231,232],{"class":130},"  \"chat_id\"",[117,234,134],{"class":123},[117,236,237],{"class":137},"\"01K...\"",[117,239,141],{"class":123},[117,241,242,245,247],{"class":119,"line":144},[117,243,244],{"class":130},"  \"turn_id\"",[117,246,134],{"class":123},[117,248,249],{"class":137},"\"01K...\"\n",[117,251,252],{"class":119,"line":157},[117,253,197],{"class":123},[14,255,257],{"id":256},"reconnectable-streaming","Reconnectable streaming",[10,259,260],{},"Subscribe after an asynchronous submission—or reconnect after losing a stream:",[90,262,266],{"className":263,"code":264,"language":265,"meta":96,"style":96},"language-bash shiki shiki-themes github-dark","curl -N https:\u002F\u002Fapp.epho.io\u002Fapi\u002Fv1\u002Fchat\u002F$CHAT_ID\u002Fevents\u002Fsubscribe \\\n  -H \"Authorization: Bearer $EPHO_API_KEY\"\n","bash",[21,267,268,289],{"__ignoreMap":96},[117,269,270,274,277,280,283,286],{"class":119,"line":120},[117,271,273],{"class":272},"svObZ","curl",[117,275,276],{"class":130}," -N",[117,278,279],{"class":137}," https:\u002F\u002Fapp.epho.io\u002Fapi\u002Fv1\u002Fchat\u002F",[117,281,282],{"class":123},"$CHAT_ID",[117,284,285],{"class":137},"\u002Fevents\u002Fsubscribe",[117,287,288],{"class":130}," \\\n",[117,290,291,294,297,300],{"class":119,"line":127},[117,292,293],{"class":130},"  -H",[117,295,296],{"class":137}," \"Authorization: Bearer ",[117,298,299],{"class":123},"$EPHO_API_KEY",[117,301,302],{"class":137},"\"\n",[10,304,305],{},"The subscription:",[307,308,309,313,316,319],"ol",{},[310,311,312],"li",{},"emits the chat and latest turn identifiers;",[310,314,315],{},"replays persisted events from earlier turns;",[310,317,318],{},"live-tails the newest turn;",[310,320,321,322,324],{},"closes with a ",[21,323,85],{}," frame.",[14,326,328],{"id":327},"reading-persisted-state","Reading persisted state",[10,330,331],{},"Use the chat-level endpoints to read the whole conversation:",[90,333,336],{"className":334,"code":335,"language":95,"meta":96},[93],"GET \u002Fapi\u002Fv1\u002Fchat\u002F{chat_id}\u002Fevents\nGET \u002Fapi\u002Fv1\u002Fchat\u002F{chat_id}\u002Fresponse\n",[21,337,335],{"__ignoreMap":96},[10,339,340,341,343],{},"Use the turn-level endpoints when your application already has a ",[21,342,68],{},":",[90,345,348],{"className":346,"code":347,"language":95,"meta":96},[93],"GET \u002Fapi\u002Fv1\u002Fchat\u002F{chat_id}\u002Fturns\u002F{turn_id}\u002Fevents\nGET \u002Fapi\u002Fv1\u002Fchat\u002F{chat_id}\u002Fturns\u002F{turn_id}\u002Fresponse\n",[21,349,347],{"__ignoreMap":96},[10,351,352,353,65,356,359],{},"An in-flight response has ",[21,354,355],{},"status: \"processing\"",[21,357,358],{},"output: null",".",[14,361,363],{"id":362},"stopping-a-run","Stopping a run",[90,365,367],{"className":263,"code":366,"language":265,"meta":96,"style":96},"curl -X POST \\\n  https:\u002F\u002Fapp.epho.io\u002Fapi\u002Fv1\u002Fchat\u002F$CHAT_ID\u002Fturns\u002F$TURN_ID\u002Fstop \\\n  -H \"Authorization: Bearer $EPHO_API_KEY\"\n",[21,368,369,381,399],{"__ignoreMap":96},[117,370,371,373,376,379],{"class":119,"line":120},[117,372,273],{"class":272},[117,374,375],{"class":130}," -X",[117,377,378],{"class":137}," POST",[117,380,288],{"class":130},[117,382,383,386,388,391,394,397],{"class":119,"line":127},[117,384,385],{"class":137},"  https:\u002F\u002Fapp.epho.io\u002Fapi\u002Fv1\u002Fchat\u002F",[117,387,282],{"class":123},[117,389,390],{"class":137},"\u002Fturns\u002F",[117,392,393],{"class":123},"$TURN_ID",[117,395,396],{"class":137},"\u002Fstop",[117,398,288],{"class":130},[117,400,401,403,405,407],{"class":119,"line":144},[117,402,293],{"class":130},[117,404,296],{"class":137},[117,406,299],{"class":123},[117,408,302],{"class":137},[10,410,411,412,414,415,418],{},"The endpoint returns ",[21,413,217],{}," immediately. The worker marks the turn ",[21,416,417],{},"canceled","\nand tears down its sandbox.",[420,421,422],"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);}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}",{"title":96,"searchDepth":127,"depth":127,"links":424},[425,426,427,428,429],{"id":16,"depth":127,"text":17},{"id":207,"depth":127,"text":208},{"id":256,"depth":127,"text":257},{"id":327,"depth":127,"text":328},{"id":362,"depth":127,"text":363},"Choose streaming or asynchronous execution and consume events and results.","md",{},true,"\u002Fdocs\u002Frunning-agents",{"title":5,"description":430},"docs\u002Frunning-agents","EMUjHORnPC83HYd5Z3lzbbPTaA301Tz-lKEUcX3dYms",[439,442,445,448,451,454,457,460,463,466,469],{"path":440,"title":441},"\u002Fdocs","Overview",{"path":443,"title":444},"\u002Fdocs\u002Fauthentication","Authentication",{"path":446,"title":447},"\u002Fdocs\u002Fchats-and-turns","Chats and turns",{"path":449,"title":450},"\u002Fdocs\u002Ferrors","Errors and statuses",{"path":452,"title":453},"\u002Fdocs\u002Ffiles-and-repositories","Files and repositories",{"path":455,"title":456},"\u002Fdocs\u002Fharnesses-and-models","Harnesses and models",{"path":458,"title":459},"\u002Fdocs\u002Fmcp-and-environment","MCP and environment",{"path":461,"title":462},"\u002Fdocs\u002Fquickstart","Quickstart",{"path":464,"title":465},"\u002Fdocs\u002Fresources-and-billing","Resources and billing",{"path":467,"title":468},"\u002Fdocs\u002Fresuming-chats","Resuming chats",{"path":434,"title":5},1785310516453]