[{"data":1,"prerenderedAt":409,"buildId":410},["ShallowReactive",2],{"docs:\u002Fguide\u002Fagents":3},{"page":4,"section":16,"document":17,"credits":10,"prev":405,"next":10},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"agents","\u002Fguide\u002Fagents","guide\u002Fagents.md","For agents","What a coding agent runs, reads and decides when fleetjobs queues its builds and tests, with a prompt to paste into AGENTS.md.",null,[],"i-lucide-bot","article",true,8,"guide",{"nodes":18,"toc":399},[19,28,36,100,107,113,193,203,209,350,353,359,385],[20,21,22,23,27],"p",{},"An agent runs every build and test through ",[24,25,26],"code",{},"heavy",", and fleetjobs picks the machine. The agent reads an exit code and never chooses a host.",[29,30,35],"h2",{"id":31,"anchor":32},"paste-this-into-agentsmd",{"label":33,"icon":34},"Section titled \"Paste this into AGENTS.md\"","#","Paste this into AGENTS.md",[37,38,42],"pre",{"language":39,"filename":40,"class":41,"wrap":14},"md","AGENTS.md","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,43,45,54,55,54,57],{"class":44},"language-md",[46,47,50],"span",{"class":48,"style":49},"line","display: inline",[46,51,53],{"style":52},"color:#0550AE;--shiki-light-font-weight:bold;--shiki-dark:#79C0FF;--shiki-dark-font-weight:bold","## Builds and tests","\n",[46,56],{"class":48,"style":49},[46,58,59,63,67,70,73,76,79,82,85,88,91,94,97],{"class":48,"style":49},[46,60,62],{"style":61},"color:#1F2328;--shiki-dark:#E6EDF3","Run builds, tests, typechecks and lint through ",[46,64,66],{"style":65},"color:#0550AE;--shiki-dark:#79C0FF","`heavy \u003Ccmd>`",[46,68,69],{"style":61},", for example ",[46,71,72],{"style":65},"`heavy pnpm test`",[46,74,75],{"style":61},". Use ",[46,77,78],{"style":65},"`heavy --light \u003Ccmd>`",[46,80,81],{"style":61}," for quick commands. ",[46,83,84],{"style":65},"`heavy`",[46,86,87],{"style":61}," returns the command's exit code. If your shell may time out, run ",[46,89,90],{"style":65},"`heavy submit \u003Ccmd>`",[46,92,93],{"style":61},", then ",[46,95,96],{"style":65},"`heavy wait \u003Cid>`",[46,98,99],{"style":61},". Do not run the same command twice at once.",[20,101,102,103,106],{},"The package ships the same instructions as a skill, at ",[24,104,105],{},"skills\u002Ffleetjobs\u002FSKILL.md",". Copy it into the folder your agent reads skills from.",[29,108,112],{"id":109,"anchor":110},"what-to-run",{"label":111,"icon":34},"Section titled \"What to run\"","What to run",[114,115,116,129],"table",{},[117,118,119],"thead",{},[120,121,122,126],"tr",{},[123,124,125],"th",{},"Goal",[123,127,128],{},"Command",[130,131,132,143,153,163,173,183],"tbody",{},[120,133,134,138],{},[135,136,137],"td",{},"Run and wait",[135,139,140],{},[24,141,142],{},"heavy pnpm test",[120,144,145,148],{},[135,146,147],{},"Run a quick command",[135,149,150],{},[24,151,152],{},"heavy --light pnpm lint",[120,154,155,158],{},[135,156,157],{},"Queue and carry on",[135,159,160],{},[24,161,162],{},"heavy submit pnpm build",[120,164,165,168],{},[135,166,167],{},"Wait for it later",[135,169,170],{},[24,171,172],{},"heavy wait \u003Cid>",[120,174,175,178],{},[135,176,177],{},"See the queue",[135,179,180],{},[24,181,182],{},"heavy status --json",[120,184,185,188],{},[135,186,187],{},"Stop a job",[135,189,190],{},[24,191,192],{},"heavy cancel \u003Cid>",[20,194,195,196,198,199,202],{},"Output of the job goes to stdout and stderr as it would without ",[24,197,26],{},". Heavy's own lines, such as why a job waits, go to stderr. ",[24,200,201],{},"heavy submit"," prints only the job id on stdout. Stdin is not passed to the job.",[29,204,208],{"id":205,"anchor":206},"what-the-exit-code-means",{"label":207,"icon":34},"Section titled \"What the exit code means\"","What the exit code means",[114,210,211,224],{},[117,212,213],{},[120,214,215,218,221],{},[123,216,217],{},"Code",[123,219,220],{},"Meaning",[123,222,223],{},"What to do",[130,225,226,239,252,269,290,303,319,332],{},[120,227,228,233,236],{},[135,229,230],{},[24,231,232],{},"0",[135,234,235],{},"The command passed",[135,237,238],{},"Go on",[120,240,241,246,249],{},[135,242,243],{},[24,244,245],{},"1",[135,247,248],{},"A heavy command failed, such as an unknown job id",[135,250,251],{},"Read the message",[120,253,254,259,262],{},[135,255,256],{},[24,257,258],{},"2",[135,260,261],{},"The invocation is wrong",[135,263,264,265,268],{},"Read the ",[24,266,267],{},"fix:"," line. The same call gives the same result",[120,270,271,276,284],{},[135,272,273],{},[24,274,275],{},"64",[135,277,278,280,281],{},[24,279,26],{}," refuses the command, such as ",[24,282,283],{},"pnpm store prune",[135,285,286,287,289],{},"Do not run it through ",[24,288,26],{},". The disk timer prunes the stores",[120,291,292,297,300],{},[135,293,294],{},[24,295,296],{},"75",[135,298,299],{},"Nobody waited for the job, so it left the queue",[135,301,302],{},"Run it again",[120,304,305,310,316],{},[135,306,307],{},[24,308,309],{},"124",[135,311,312,313],{},"The job passed its time limit, ",[24,314,315],{},"HEAVY_MAX",[135,317,318],{},"Find out why it hangs, or raise the limit once",[120,320,321,326,329],{},[135,322,323],{},[24,324,325],{},"130",[135,327,328],{},"The job was cancelled",[135,330,331],{},"None",[120,333,334,339,342],{},[135,335,336],{},[24,337,338],{},"137",[135,340,341],{},"The kernel killed the job for memory twice",[135,343,344,345],{},"The job is in the ",[346,347,349],"a",{"href":348},"\u002Fguide\u002Fnight","night queue",[20,351,352],{},"Any other code is the command's own, whether it ran here or on a host.",[29,354,358],{"id":355,"anchor":356},"decisions-that-belong-to-fleetjobs",{"label":357,"icon":34},"Section titled \"Decisions that belong to fleetjobs\"","Decisions that belong to fleetjobs",[360,361,362,374,377],"ul",{},[363,364,365,366,369,370,373],"li",{},"Where the job runs. Do not set ",[24,367,368],{},"HEAVY_LOCAL"," or ",[24,371,372],{},"HEAVY_REMOTE"," unless a task needs the job on this machine or on a host.",[363,375,376],{},"Whether to run a job twice. A second identical call from the same folder follows the first job, and says so. Files changed after the first started are not in its result.",[363,378,379,380,384],{},"Whether to believe a remote failure. See ",[346,381,383],{"href":382},"\u002Fguide\u002Ftrust","Trust",".",[20,386,387,388,391,392,394,395,384],{},"A job survives its client. If your tool call times out, the job is still running: ",[24,389,390],{},"heavy status"," shows it and ",[24,393,172],{}," returns its exit code. In a program, use ",[346,396,398],{"href":397},"\u002Freference\u002Fapi","the library",[400,402,403,404],{"id":31,"depth":401,"text":35},2,{"id":109,"depth":401,"text":112},{"id":205,"depth":401,"text":208},{"id":355,"depth":401,"text":358},{"path":406,"title":407,"description":408},"\u002Fguide\u002Fmigrating","Migrating from the bash heavy","What changes for agents, scripts and config when fleetjobs replaces the bash heavy script, and how to compare the two on your own logs.",1796530822202,"9e7c308e-a25b-413c-bd8b-9a1122ddc1d4"]