Troubleshooting
Where to look
| Question | Place |
|---|---|
| Is the factory taking work? | tehas status |
| Is there room for another cycle? | The slice line of tehas status; ~/tehas/live/dispatch.json |
| What did the dispatcher decide? | tehas dispatch --dry-run, ~/tehas/logs/dispatch.log |
| What did a cycle's runner print? | ~/tehas/logs/dispatch-work-<issue>.log |
| What did the driver say? | The runner's NDJSON progress, ~/tehas/logs/work-<issue>-<time>.jsonl, and its result beside it, .jsonl.result.json |
| Where is the cycle now? | While it runs, its step on the dashboard, from ~/tehas/live/cycles/<issue>.json, which the state store publishes from the cycle's heartbeats; once it ended, jq . ~/tehas/state/cycles/<issue>.result.json. The workspace of a cycle that left a pull request is removed; one that stopped is kept, and a retry moves it to tehas-<issue>.before-retry. A start that parked before the container ran puts the stopped workspace back at tehas-<issue> in place of its own clone, so a retry refused early loses nothing; when there was none to put back, it keeps the clone it made. |
| What did one agent do? | Transcripts under ~/.pi/agent/ensemble-runs/issue-<issue>/<date>/ |
| Is a cycle running? | systemctl --user status 'tehas-cycle@*', or docker ps --filter name=tehas-work |
| What did the previews do? | ~/tehas/logs/preview.log, and ~/tehas/logs/preview-<pr>.log for one build |
| What did the cleaner do? | ~/tehas/logs/clean.log; journalctl --user -u tehas-clean for a run that wrote nothing there |
| What state is a preview in? | jq . ~/tehas/preview/<pr>/state.json, or "Previews" on the dashboard |
The driver's notices, one per line:
jq -r 'select(.type=="extension_ui_request" and .method=="notify") | .message' \
~/tehas/logs/work-<issue>-*.jsonl
A cycle ran for hours and you cannot tell what its agents were doing
A child of a cycle that runs a long time is reported by pi-rukas on the cycle's stream, so the stream of a stuck cycle says what the child was doing without the console, which is written inside the container and is swept with the workspace.
jq -c 'select(.kind == "dispatch-slow")' ~/tehas/logs/work-<issue>-<time>.jsonl
One line per child that crossed the bound pi-rukas watches, with its step, its role, how long it had run, and how many turns and tokens it had spent. When pi-rukas has learned to see a repeated tool call, the same line names the command that repeated, how many times it ran and how many identical results came back; a child whose calls differ is left alone, so a line with those fields means the child was going over the same ground, not working slowly.
| What the line says | What it means |
|---|---|
turns and tokens grow, no repeated command |
Slow work. The child is doing something each turn; give it room, or split the issue |
command, count and identicalResultCount name one probe that answered the same thing 24 times |
A child spinning. It has the evidence it needs and has not stopped; bound it, or tell it to report |
| No such line at all | No child crossed the bound. The time went on the driver's own steps, or on children that each finished inside it |
The stream is kept for seven days; after that the cleaner removes it.
A command stops with tehas: ... is not set or is not valid
Exit 78. The instance settings are missing or malformed and the command did nothing. The line names the setting and the file. Fix it there, then check:
cd ~/tehas/platform && ./install.sh --check
no instance.env in <dir>: the instance directory is not where the host looks. Seecat ~/.config/tehas/instance-dirand The host.the default branch of ... is unknown: the product checkout has noorigin/HEAD. Run./install.sh, which sets it, or setTEHAS_BRANCHininstance.env.- A setting you exported in the shell is ignored:
instance.envwins, and a setting it does not assign is dropped. GH_TOKEN is no longer used: the factory acts as a GitHub App.(alsoGH_CYCLE_TOKENandTEHAS_CYCLE_LOGIN): take the line out of~/.config/tehas/envorinstance.env, then runtehas setup --new-appor give--app-idand--app-key-file. See A GitHub App for a factory.TEHAS_GITHUB_APP_ID is not set: the instance names no app. Runtehas setup --new-app, or give--app-idand--app-key-file.- A command says the app is not installed on
TEHAS_REPO: open the install link it prints and choose the repository. tehas work: no cycle token from the app, not starting a cycle: with a GitHub App, the app could not make the cycle's token forTEHAS_REPO. The line before it says why. Check the app withtehasbot github-token --cycle --check: the app must be installed on the product repository with Contents, Pull requests and Issues write.
The dispatcher fails the same way under systemd; the line is then in
~/tehas/logs/dispatch.log.
Nothing happens after I label an issue
Run tehas dispatch --dry-run and read what it prints.
-
paused: issue #N carries tehas:pause: the control issue holds the pause label. Only an account named inTEHAS_ALLOWED_LABELERScan lift it: apply the label and take it off again, or runtehas resumeon the host. -
paused: the flag tehas pause wrote at <time> holds this host: this host is paused bytehas pause.tehas resumelifts it. -
paused: tehas:pause was taken off #N by 'x', who may not authorise work here: an account outsideTEHAS_ALLOWED_LABELERSremoved the label, and removing a pause is work an allowed account authorises. An allowed account appliestehas:pauseand takes it off again. -
paused: tehas:pause is not on #N, but its last tehas:pause event only applied it: nothing has taken the pause off: the label left the control issue without any account taking it off, which is what deleting or renaming the label itself looks like. No account was asked to lift the pause, so the factory stays paused. An allowed account appliestehas:pauseand takes it off again, andtehas labelsputs a deleted label back. -
WARN: ~/tehas/state/pause.json is not a pause flag: taking it as paused: the flag file is damaged, a link, or over 1 MiB, and a switch that cannot be read is taken as closed.tehas resumeremoves it;tehas pausewrites one that can be read. -
holding: N cycles are running (limit N): the ceiling is reached. Wait for a cycle to end, or raiseTEHAS_MAX_CYCLES. -
holding: tehas.slice has no room for another cycle (X GiB of Y GiB promised, each cycle is given R): the containers in the slice are promised, or use, so much that one more reserve does not fit. Every container counts: cycles, dev sessions, planning turns, the indexer. Wait for one to end. If one container holds far more than its reserve, that is the one to look at:systemd-cgtop /tehas.sliceshows them. A lowerTEHAS_CYCLE_RESERVEfits more cycles and promises each one less. -
holding: tehas.slice holds as many containers as their ceilings fit (4 of Nm):TEHAS_SLICE_CONTAINERScontainers are in the slice, each may grow to that share of it. Every container counts: cycles, dev sessions, planning turns, the indexer. Wait for one to end. -
holding: tehas.slice is under memory pressure (full avg60 N): every process in the slice waited for memory for more than a tenth of the last minute, and more than half of the slice is promised. Cycles start again when it falls to 10 or under, or when half or less is promised. -
holding: the slice's use could not be read: <file> ...: a file under/sys/fs/cgroup/tehas.sliceis missing or unreadable; the line names it and what was missing in it. See "The dispatcher holds on the slice" below. -
Any other
holding:line that names the slice, Docker,systemctlorTEHAS_CYCLE_RESERVE: the slice cannot be used. See "The dispatcher holds on the slice" below. -
holding: <n> GiB free on the disk, under TEHAS_CYCLE_MIN_FREE=<value>: no cycle starts: less thanTEHAS_CYCLE_MIN_FREEis free on the file system of~/tehasor on the one Docker keeps its images on. Make room, or set the bound lower. Running cycles and planning turns go on. -
holding: the free disk space could not be read: no cycle starts:df, or thedfof the directory Docker names for its images, gave no figure. The hold is the same as a full disk's, so a host whosedfor Docker is broken starts nothing either. Rundf -Pk ~/tehas,docker info --format '{{.DockerRootDir}}'anddf -Pkof that directory as the tehas user: the one that answers nothing is the one to fix. -
holding: N issues await merge (limit N): review and merge, or raiseTEHAS_MAX_AWAITING. -
holding: N issues await merge and M cycles are running (limit N): running cycles count towardsTEHAS_MAX_AWAITINGwith the issues that await merge. Wait, or raise the limit. -
skip #N: tehas:ready was applied by ..., thenclear #N: tehas:ready off, applied by ...: the label came from an account that is not allowed. The dispatcher took it off and said so on the issue. To ask for a cycle, an allowed account appliestehas:ready. The same two lines nametehas:planwhen that label came from such an account. With only theskipline, the poll was a dry run or the label change failed (WARN: label change on #N failed), and the next poll tries again. -
skip #N: tehas:ready from the bot starts nothing: ...: a plan with no open points was to start, and something changed since it was written. The line says what. The dispatcher took the label off and said so on the issue. Read the plan, and an allowed account appliestehas:ready. -
planning #N asks: ...: a plan with no open points did not start on its own. The line says why, and the session asks as it does for any plan. See A plan with no open points. -
skip #N: pull request <url> is open and closes it: the work is in that pull request already, whether GitHub links the two or the pull request's own description saysCloses #Ninto a branch other than the default one. The dispatcher tooktehas:readyoff and said so on the issue. Merge or close the pull request, then applytehas:readyif work is still needed. -
wait #N: not in the start order (--only): the start order was set with--onlyand does not name this ready issue, so it waits. Add it withtehas order set, or clear the order withtehas order clear. See tehas order. -
order expired at <time>: ready issues start lowest number first: the start order ran past its expiry, so the poll treats it as no order. Set a new one, or clear it to stop the line. -
WARN: the start order could not be read from the state store: ready issues start lowest number first: the poll treats it as no order. Set it again withtehas order set, or clear it, and runtehas state checkif it keeps coming back. -
TEHAS_PRIORITY_FIELD is no longer read: tehas order sets the order ready issues start in, so take the line out(the same forTEHAS_LOW_GATEandTEHAS_LOW_GATE_WAIT): every command stops with 78 while the instance sets one of them to a value. Take the line out. A blank value is ignored. -
TEHAS_OVERLAP_HOLD is no longer read: a host holds an issue out of the start order with tehas order set --only, so take the line out: every command stops with 78 while the instance sets it to a value. Take the line out, and keep two issues apart withtehas order set --onlyinstead. A blank value or0, the old default, is ignored. -
TEHAS_IMPROVE_REPO is no longer read: the improvement loop is removed, so take the line out(the same forTEHAS_IMPROVE_RUKAS_REPO,TEHAS_IMPROVE_RUKAS_SKIPandTEHAS_IMPROVE_MAX_OPEN): every command stops with 78 while the instance sets one of them to a value. Take the line out. A blank value, andTEHAS_IMPROVE_RUKAS_SKIP=0, are ignored. -
TEHAS_CYCLE_REPORT is no longer read: the cycle's report has one form, so take the line out: every command stops with 78 while the instance sets it to a value,rusttoo. Take the line out. A blank value is ignored. -
TEHAS_EASY_MERGE is no longer read: the easy merge is removed and every refresh is the full refresh cycle, so take the line out: every command stops with 78 while the instance sets it to 1 or any value but 0. Take the line out. A blank value andTEHAS_EASY_MERGE=0are ignored. -
<NAME> is no longer read: tehas 1.0 renamed it <NEW> (...), so rename the lineor<NAME> is no longer read: <why>, so take the line out: a setting tehas 1.0 renamed or removed, a row ofapi/renames-1.0.tsv, is still ininstance.envor~/.config/tehas/env. Every command stops with 78 until the line is renamed or taken out. The refusal andtehas update --checklist every such line at once (see tehas update). -
ERROR: TEHAS_ISSUE_TYPES maps improvement to ...(the poll) or... maps prototype to ...(the Protolab's log): the owner of the repository has no issue type of that name. Nothing was written. Add the type in the organisation's settings, spell it as the organisation does, or leave the kind out of the setting for its label. See Kinds as issue types. -
#N: the issue type Prototype was set by ...: withTEHAS_ISSUE_TYPES, the newest change to the ticket's type came from an account outsideTEHAS_ALLOWED_LABELERS, or the Protolab could not see who made it. Set the type again from an allowed account. -
holding: <n> of <free> free slots start: ...: some cycles started, fewer than there are free slots and issues waiting. The rest of the line is the one limit that cut it: issues awaiting merge (TEHAS_MAX_AWAITING), or the slice's room. It is said on every such poll. See Limits that hold work back. -
holding: main is red at <sha>: the checkTEHAS_BRANCH_CHECKnames failed on the head commit of the branch. No cycle, retry or refresh starts; running cycles and planning turns go on. Fix the branch: once the check passes on a new head, or is run again and passes, the next poll starts cycles and logsreleased: cycles may start again. -
the check <name> on main could not be read: cycles start,main has no check named <name> on its head commit: cycles startorthe check <name> on main at <sha> has not finished: cycles start: the poll could not tell whether the branch is red, so it did not hold. Said once each time it changes. A name that is never found is a wrongTEHAS_BRANCH_CHECK, or a product repository that runs no such check. -
stop #N: its issue is closedorstop #N: its pull request <url> is merged: the cycle's work was done, so the poll stopped it and gave its slot to the next issue. Nothing more is needed. -
ignore #N: tehas:finish was applied by '<who>', not an allowed account: someone outsideTEHAS_ALLOWED_LABELERSasked for the finish of a stopped cycle. The label stays and nothing runs. An allowed account takes it off, writes the marked comment and appliestehas:finishagain. See Finishing a stopped cycle. -
wait #N: tehas:finish waits: <why>: the issue's label events, its comments or its approval could not be read. The label stays and the next poll tries again. If the line keeps coming, the rest of it says what could not be read. See Finishing a stopped cycle. -
finish #N: refused, asked by <who>: <why>, with(<label|millwright>)after the name when the command itself refused: a rule of the ask was not met, ortehas-cycle finishrefused. The label came off and the bot replied withresult=refusedand the one line of why. Fix what it names, then ask again. See Finishing a stopped cycle. -
finish #N: opened <url>, asked by <who> (<label|millwright>): <reason>: the finish opened its draft pull request, and the bot replied with its address. Review it as any other pull request.The finish step runs only on a poll that is not paused, not a dry run and did not fail, and takes at most three asks a poll; the rest wait for the next one.
-
holding: no resources: the model endpoint ...: the model endpoint does not answer, refused the request with an HTTP code (401 for a wrong or missing token, 429 for a rate limit), could not be asked because curl could not be run, offers no models, or does not offer the configured model, and neither does its backup wheremodels.jsonnames one. Nothing starts, no cycle, no planning turn and no retry. The issues stay queued and are taken as soon as the endpoint answers. See "The model endpoint does not answer" below. -
hold #N: its text links an attachment and TEHAS_WORK_IMAGES is 1, but <model> does not declare image input in models.json: the instance gives a cycle images and itsmodels.jsondoes not list"image"in the model'sinput. Only issues that link an attachment wait; the rest start. Add"image", or setTEHAS_WORK_IMAGES=off, and runinstall.sh. -
hold #N: ... but <model> does not answer an image: the model endpoint refused a request with a one-pixel image, or took more than 30 seconds. The model runs without its vision part, or the backend is busy. The request is sent only for an issue that links an attachment and could start now, at most once a poll. -
hold #N: ... but the pi-rukas in the sandbox image <commit> does not read them: the sandbox image says, by the label its build wrote, that its pi-rukas has no reader for the manifest tehas writes beside the images. Only issues that link an attachment wait, and the model is not asked. Runtehas update, which rebuilds onto upstream's newest release, which has the reader, or setTEHAS_WORK_IMAGES=offand runinstall.sh. An image put back from before 2026-10-14 is what starts the hold: see Rolling back pi-rukas. -
hold #N: its text says <the words> and links no attachment, so the cycle would be given none; attach the file or write out what it shows, before applying tehas:ready: the issue was written around a file nobody attached. Its text saysSCREENSHOT GOES HERE,IMAGE_GOES_HERE,the image goes hereor the like, and no text of the issue links a file at all. The dispatcher started no container: the cycle would have been given no image and no word of the gap, and would have parked after a full explore with the park looking like a problem with the issue's premise. Nothing on the issue changed and no label was touched, so the queue is as it was. Attach the file, or write out in words what it shows and remove the line, and the next poll starts the cycle.TEHAS_WORK_IMAGESmakes no difference: with the setting off the instance gives a cycle no attachments at all, which is the same gap. The words of prose are no reason to hold: "the value goes here in the code" starts as any other issue does, because the name of a file is what stands beforegoes here. See Attachments. -
nothing to do: the issue is closed, or does not carrytehas:ready. -
wait #N: its cycle is still running:tehas:readywas applied while the issue's cycle runs. A fresh cycle starts when that one has ended. -
would park #N: it is marked tehas:running and no cycle holds its lock(park #Nin the log of a real poll): the cycle of that issue ended without a report, or never started. The next real poll gives the issueneeds-human-attention. Read~/tehas/logs/dispatch-work-N.log. -
park #N: it is marked tehas:planning and no planning session is open on it: the issue carriestehas:planningbut no session is on record, because the poll that marked it took its turn back. The issue getsneeds-human-attention. Applytehas:planto plan it. -
WARN: the cycle for #N holds its lock but has not been heard from since <time>, more than 1200s: stopping [email protected]: the cycle's live file has not been written for 20 minutes, so the poll asked its unit to stop. Read~/tehas/logs/dispatch-work-N.logand the end of the cycle's~/tehas/logs/work-N-*.jsonlfor where it hung.WARN: could not stop [email protected] (exit <code>)after it means the stop did not go through: the poll asks again, at most once every 10 minutes, and after 6 asks it says the episode needs a person. Either way the unit's ownTimeoutStopSec(300s) is what ends a unit that ignores the stop job. To stop it now:tehas stop N, which clears what the cycle left on the host as well, orsystemctl --user stop [email protected]on its own, and readjournalctl --user -u tehas-cycle@N. -
WARN: the cycle for #N holds its lock but has not been heard from since <time>, more than 1200s, but the state store could not record it (<word>), so the poll asks nothing this time: the poll keeps each stuck cycle's asks in the state store, and the store was busy or did not answer in time. That passes on its own: a later poll asks. A store that cannot be used ends the poll withERROR: the state store cannot be used: ...instead; look at it withtehas state check. Meanwhile, stop the cycle withtehas stop N. -
WARN: the cycle for #N holds its lock but has not been heard from since <time>, more than 1200s, and the state store has no open record of it, so the poll does not stop it: the unit holds its lock before its record starts or after it ended, for example while it reports. A line on one poll can be a cycle starting. When every poll says it, the unit is stuck and holds a slot: stop it withtehas stop Nand readjournalctl --user -u tehas-cycle@N. -
N cycles running, room for M more, thenwould run a cycle for #N ...: the issues the next poll starts. In the log you may also seethe code index stays as it is: a cycle is running on #N. That is no reason an issue waits. -
ERROR: systemd cannot load [email protected] (LoadState: ...): the poll cannot start units, so it changed no label. Runinstall.shon the host so its units step installs the cycle unit. Runtehas dispatchin the tehas user's own session, not in asudo -iushell, which has no user bus. -
ERROR: the state store is not installed (run install.sh): the poll, a cycle,tehas work,tehas stop,tehas historyandtehas exportneed~/tehas/libexec/storeand~/tehas/state/tehas.db, and stop at exit 78 before they ask GitHub anything. Runinstall.sh, which builds the store and makes the database. -
ERROR: the cycle for #N did not start: <why>: the unit did not put a new attempt on record withinTEHAS_CYCLE_START_WAITand holds no lock. The reason says which:its start exited <code>orits start did not end within 300s or could not be runis thesystemctl --user startitself;the store was still busy at the end of the <n>s waitorthe store could not say whether it started (<word>)is the state store, not the unit;it put no new attempt on recordis a unit that started and did not record its start. The same reason is in the comment on the issue. The approval is taken off the record, or the unit is stopped when the store keeps it, and the issue getsneeds-human-attention. Read~/tehas/logs/dispatch.logfor the cycle's own line:refuse #N: the state store refused the start(exit 77) is a unit started with no approval waiting, such as one started by hand withsystemctl;the state store did not take the start (busy)(exit 75) is a store that stayed busy, andthe state store took the start only after it timed out(exit 75) is a start the store recorded too late: it is ended as refused and nothing ran. -
skip #N: its approval of <time> started a cycle already: the label event this poll read started a cycle already. A newtehas:readyasks for another. -
ERROR: the state store could not list the running cycles (busy): the poll ended before it acted on any cycle, exit 1. The next poll asks again. -
another poll holds the dispatcher's lock: a poll is under way. Try again in a minute. A running cycle, a planning turn and an index run do not hold this lock. -
holding: the code index is refreshed first, as tehas-index.service, thenholding: the cycles wait for the code index: no cycle was running and the branch had moved, so the index is rebuilt before cycles start. It takes seconds to minutes; its end starts the poll that starts them. Seejournalctl --user -u tehas-indexand~/tehas/logs/dispatch-index.log. -
WARN: the dispatcher's lock has been held since <time>, more than Ns: a poll hangs, and no poll runs until it ends: logged once by the first poll that finds the lock held longer than half an hour. No sweep, start or planning turn runs meanwhile. Look for the hung process withsystemctl --user status tehas-dispatch.service; the unit stops a poll after an hour by itself.~/tehas/state/dispatch.takenholds when the lock was taken, in seconds since 1970. -
ERROR: gh ... failed: a GitHub call did not answer, or the control issue does not exist. The poll ends there on purpose: the pause switch, the limit and the labeller check are never decided on an answer that did not come. Afterfailed, the line names gh's own error when it is one of a fixed list (HTTP 502,rate limit,timed out,connection reset,no such host,unexpected EOF):ERROR: gh api graphql failed: HTTP 502. Nothing else of gh's error is logged, since an agent can write it. A 5xx was tried once more already, and the line ends(tried 2 times). When it repeats,tehas statusshows agithubline with the count of the last ten minutes; GitHub's status page is often green through these. -
ERROR: unreadable comments of #N(oredit record of #N,pull requests of #N,pull request #N): the poll holds no usable answer for that read and ends there, for the same reason. When a gh call is what failed, its line follows:ERROR: unreadable comments of #7: gh api graphql failed: HTTP 502. With nothing after the read, no gh call failed: the answer came without that issue or that field. -
ERROR: <repo> is now <other> on GitHub: the repository was renamed or moved. Until it is put right the factory floor shows an empty board. SetTEHAS_REPOto the new name, andTEHAS_REVIEW_REPOtoo if it named the same repository. Point the product checkout'soriginat it, move the checkout if its directory was named after the old one, and runinstall.sh. When the product is tehas itself, point the platform checkout'soriginat it as well, ortehas updatepulls from the old name. Previews follow the product checkout on their next run. The dispatcher checks this at every poll because GitHub answers a list call under the old name with an empty list, not an error. -
tehas: ... is a checkout of ..., not of ...orno product checkout at ...: the product checkout is missing or is a clone of another repository thanTEHAS_REPO. Nothing is polled until that is put right.
A cycle stops with Cannot fork in its log
The cycle's progress log has /bin/sh: 1: Cannot fork, or a transcript has
fork: retry: Resource temporarily unavailable or EAGAIN. The container was
at its --pids-limit. The comment that reports the cycle says how many starts
were refused, and the kernel log on the host has fork rejected by pids controller with the container's scope. Nothing the cycle ran after the first
refusal can be trusted, its gate included, and the handoff is often not posted.
Before v0.7.1 a cycle's container had no init, and every pass of the shell
tests left several hundred finished processes that were never collected. With
the init a pass peaks at under twenty. A cycle that still reaches the limit is
starting processes that stay alive: look at what is running in the container
(docker top tehas-work-<issue>) before raising the limit.
A cycle stops in its first step with provider-severed
The cycle's progress log (~/tehas/logs/work-<issue>-*.jsonl) shows retries
with cause=provider-severed and an agent's transcript an errorMessage starting with
429. The model endpoint listed the model but had no free slot for it. That
happens when another job is using the model, and also when the model has only
one slot: a cycle's driving session and its step agents call the model at the
same time, so a cycle needs at least two conversations served at once. The
dispatcher's check before a cycle only asks whether the model is listed, so it
cannot see either. Ask the endpoint directly, twice at the same moment:
curl -s http://<model host>/v1/chat/completions -H 'content-type: application/json' \
-d '{"model":"<model>","messages":[{"role":"user","content":"ready?"}],"max_tokens":5}'
When several cycles run, their agents all ask for the same model unless roles have their own. The six lens reviewers of one cycle alone call it at once. Give the busiest roles a model on other machines: see A model per role.
When it answers, apply tehas:ready to the issue again. Set PI_ENSEMBLE_DEBUG=1 in instance.env to get the
cause into the error stream in the first place.
If the dry run says it would run but nothing starts within a few minutes, the timer is not polling:
systemctl --user list-timers tehas-dispatch.timer
tail ~/tehas/logs/dispatch.log
systemctl --user enable --now tehas-dispatch.timer turns it on;
systemctl --user disable --now tehas-dispatch.timer turns polling off without
touching a running cycle.
A poll that fails does not stop the polling. tehas-dispatch.timer counts two
minutes from the last end of the poll's unit and from its last start, so a poll
that exits non-zero - a disk that filled, a GitHub call that failed - is
followed by the next poll two minutes later, or TEHAS_POLL_SECS seconds
later where that is set. What a failed poll cost is the
work it did not do, not the queue. Read ~/tehas/logs/dispatch.log for the
error and systemctl --user status tehas-dispatch.service for its exit status.
Every poll fails with ERROR: gh repo view failed
The dispatcher cannot reach the repository at all. Ask GitHub as the factory
does: . ~/tehas/env.sh; gh api repos/<owner>/<name> --jq .full_name.
Sorry. Your account was suspended(403): GitHub suspended the bot's user account. Everything it wrote is hidden until it is reinstated, and its token does nothing. Pause the factory (tehas pause), move it to a GitHub App, and take the old account off the repository. Cycles that were running keep their commits in~/tehas/work/<name>-<n>but could not push: applytehas:readyto them again once the factory runs.Bad credentials(401): the token in~/.config/tehas/envexpired or was revoked. With an app, runtehas github check: it says whether the key, the installation and the repository are right.- With an app,
the GitHub App's key is not readable: the key is not at~/.config/tehas/github-app.pem, or not readable by the tehas user.
The dispatcher holds on the slice
tehas status says warn and its slice line starts with holding:. No
cycle and no planning turn starts, no label changes and nothing is said on an
issue. The queue is kept and is taken up when the hold ends. The line is in
~/tehas/logs/dispatch.log once, not at every poll.
| The line says | What to do |
|---|---|
no slice file on this host (sudo ./bootstrap.sh slice) |
Root has not installed the slice. Run that command once. See Bootstrap a host. |
tehas.slice has no memory limit (sudo ./bootstrap.sh slice) |
The unit systemd has loaded is not the installed file. The same command reloads it. |
Docker runs containers with the ... cgroup driver on cgroup v..., tehas needs systemd on v2 |
Set "exec-opts": ["native.cgroupdriver=systemd"] in /etc/docker/daemon.json and restart Docker. A host on cgroup v1 cannot run tehas. |
systemctl gave no answer, docker gave no answer |
The command failed or was silent for ten seconds. Run systemctl show tehas.slice -p FragmentPath -p ActiveState -p MemoryMax and docker info by hand. |
... cgroup.controllers does not list cpu, memory and pids |
The host's cgroup tree lacks a controller. Read /sys/fs/cgroup/cgroup.controllers. |
TEHAS_CYCLE_RESERVE=... is more than a container may use here |
The reserve is above the slice's limit over TEHAS_SLICE_CONTAINERS. Set a lower TEHAS_CYCLE_RESERVE or TEHAS_SLICE_CONTAINERS in instance.env. The line names the host size the reserve needs. |
TEHAS_CYCLE_RESERVE=... is not a size |
The word is no Docker size (a count of bytes with a k, m or g, at least 6m). tehas_load refuses it in instance.env, and the dispatcher's own check says the same, so this line comes from console slice room run with the name exported in the shell or set outside the load. console slice room 0 prints that word in its fourth field, where a size is printed in bytes; the word is one field even when it holds a space, and nosize when the name is not set at all, so the reason and the note keep their places. A pressure figure too big to count is held as the slice stalling, not as the 0.00 of a slice that never stalled. Fix the word, not the slice: there is nothing in /sys/fs/cgroup/tehas.slice to read. |
the slice's use could not be read: ... |
The rest of the line names the file and what was missing: .../memory.pressure cannot be read or has no full avg60, .../memory.stat has no number for anon (or shmem, kernel, slab_reclaimable), .../memory.low cannot be read or is not a number. Read that file as the tehas user. A kernel booted with psi=0 has no memory.pressure: remove that option from the kernel command line. A kernel too old for the kernel line in memory.stat is read without it: kernel memory is then not counted. A slab_reclaimable line that is missing, as it is for a container that has just started, counts as 0: the slab counts as used, so that one container holds. If the directory is missing while systemd says the slice is active, look at systemctl status tehas.slice. A slice that is not active has no directory, and its cycles that have no container yet count at one reserve each. |
The slice line reads unknown: no poll has reported in 10 min when no poll
got as far as reading the slice in that time. That is so while the factory
is paused, while a planning turn takes longer than that, and when the timer
is not running. tehas dispatch --dry-run reads the slice afresh and prints
the same hold.
A hold, and its end, reach tehas status in the poll that finds them. The
numbers of a room for N cycles line can be one poll older than the age the
line gives for the health file: the health file is written at the start of a
poll, after a start, and when the reason for a hold changes.
The cycle parked (needs-human-attention)
Read the bot's comment on the issue first: it names the cap that fired, and pi-rukas's handoff follows in the same comment. The common ones:
| Reason | What it means | What to do |
|---|---|---|
| underspecified, needs clarification | The issue does not say enough | The factory refines it once on its own; after that, add acceptance criteria and relabel |
explore-bodies-empty |
gh could not read the issue |
Check the bot token: gh auth status |
| verify or smoke failure | The gates failed on the developer's change | Read the gate output in the handoff; often a real defect |
| protected paths | The patch touched .pi/, .github/, CODEOWNERS or agents.json |
By design. Make that change yourself, then tick a retry box on the park comment. The comment says so in place of pi-rukas's /work --restart --allow-protected, which a host cannot run |
| review round cap | The review kept finding problems | Read the review on the pull request |
| developer timeout | An agent ran out of time | Usually model endpoint capacity; retry later |
wall-clock, stall |
tehas ended the cycle: its time limit TEHAS_WORK_TIMEOUT, or no log moved for TEHAS_WORK_STALL |
Read the run log the comment names; see a cycle stops at a cap |
signal |
A TERM, INT or HUP came to tehas work (the unit was stopped, or the host shut down) and it stopped the container. The record's capReason names the signal and the step, and a run of the gate the stop cut short is closed in the stream by a verify-aborted line |
Retry once the host is back; nothing in the issue caused it |
container-killed |
The container ended with 137 and nobody here stopped it: the kernel killed it for memory, or something outside the cycle killed it. The record's capReason names the step in flight and how many processes in the container were killed for memory, and err.txt says the same |
Read the memory kills first: a cycle that keeps reaching this cap needs a larger share of the slice or fewer cycles at once. A pull request it had opened is named in the comment |
process-limit:<step> |
The container reached its --pids-limit and refused starts of a process, and the run named no other cap. The comment says how many were refused and the limit it reached |
Read the run log the comment names for what ran at that step. The limit follows the container's share of the slice: TEHAS_MAX_CYCLES and TEHAS_SLICE_CONTAINERS, both on the cycle's record |
runner-never-started |
The container ended before the driver wrote its first event: no step ran and the record would hold nothing but an exit status | Look for a host-side fault: the image, the slice, the model endpoint. See runner-never-started below |
the sandbox image cannot run it as this start asks |
The issue carries tehas:lean and the sandbox image cannot run work-lean as asked: its pi-rukas is older than v0.14.47, or lacks a flag, input or feature this start gives it, such as --continue-pr for a refresh. The comment names each one. tehas work stopped with exit 78: no container ran, nothing moved, classic did not run in its place. The start's approval is gone, so nothing starts it again on its own |
To keep it on lean, rebuild the sandbox image on a pi-rukas that supports what the comment names, then apply tehas:ready again. To run it on classic instead, which changes its driver, take tehas:lean off, then tick Retry (under TEHAS_DRIVER=lean, apply tehas:classic instead). A Retry ticked with the label still on waits for it to come off |
tehas gave `work-lean` what it never takes |
The issue carries tehas:lean, and tehas passed work-lean a flag it takes in no release, such as --restart. The comment names the flag. This is a fault in tehas, not in the issue or the sandbox image: no image and no label fixes it. tehas work stopped with exit 78 and nothing ran |
Update tehas to a release that fixes it, then retry. Taking tehas:lean off would only run the issue on classic, which is a change of driver and not a fix |
tehas work stopped it before its runner ran |
A step of tehas work failed before the driver started, and it exited 78. The comment names the driver and, where tehas work left word of it, the step: the product's install failed, with its exit status, a tool the sandbox image lacks, or the install timed out. Otherwise the run log the comment names says which step |
Read the run log. Fix what it names, then tick Retry |
docker refused --cpus <n>, it counts <m> CPUs |
The Docker daemon counts fewer CPUs than the host has: it was running when the host was given more, and it refuses a CPU quota above its count. tehas sizes the containers for Docker's count and logs its Docker daemon counts <m>, so this park means Docker gave no count tehas could read |
Restart the Docker daemon when no cycle runs (sudo systemctl restart docker), then tick Retry. See limits and concurrency |
lean found this issue not ready to build from |
A lean run read the issue's pi-spec v1 block and refused it (runner exit 11). The rules it failed follow in the comment |
Fix the block, or run pi-rukas's /plan to write it, then apply tehas:ready |
lean stopped on the repository's setup, not on this issue |
A lean run refused the issue for the repository's .pi/work.json (runner exit 11): it names no verify.test while the spec has a test criterion, or the file does not load. The issue's text is fine. Lean's reason follows in the comment |
A person adds verify.test to .pi/work.json or fixes the field it names; see the lean driver's settings. Then apply tehas:ready |
Lean left its pull request a draft |
A lean run handed back with a draft pull request: its gate did not clear the head it pushed. A draft never waits for a merge | Read the reason in the comment and the pull request before you retry |
Lean says its pull request is `<state>`, not `ready` |
A lean run handed back a pull request that its own result does not call ready: its gate never cleared the head it pushed, the pull request's checks were red twice (lean builds once more on the first red), or a manual or unrun command criterion holds it a draft. It does not wait for a merge |
Read lean's reason that follows in the comment, then fix the pull request by hand or retry from a clean start |
A lean park with no pull request (driver `lean` in the comment) |
Lean handed back before it opened one: it ran out of build rounds, a step ran out of its budget, the cycle's deadline came, or its gate stayed red. The comment carries lean's failure kind and reason | Read the reason; fix the spec block or the budgets in .pi/work.json, then retry from a clean start |
A tehas:ready that comes off with a comment that tehas:lean was applied or
taken off by another account is no park: the choice of driver was not an allowed account's.
The comment says `tehas:lean` was applied by `<login>`, an account that may not choose the driver in this factory.
Under TEHAS_DRIVER=lean the same holds for tehas:classic, and for a
tehas:lean that another account took off, and a comment
that the issue carries both tehas:lean and tehas:classic asks an allowed
account to take one of them off.
See choosing the driver.
The same happens to a new lean start whose issue has no pi-spec v1 block, or
one that is not the single block of valid JSON the driver reads: the poll takes
tehas:ready off and says once that its text holds no `pi-spec v1` block for the lean driver to read, and no cycle starts. Write that block, and
apply tehas:ready again. The block is the only text pi-rukas's lean driver
plans from, and its /plan writes one; Choosing the
driver says what the block must look like.
With TEHAS_SPEC_PIPE=on, a start whose issue has a Spec: line tehas cannot
read starts nothing either: the poll takes the label off and says once why,
for example its `Spec:` line is not a link and its sha256 or the link of its `Spec:` line is not a file attached on GitHub. Write the one line
Spec: <link of the attached file> sha256:<64 hex digits of its bytes>, or
take it out, and apply tehas:ready again.
A start with a Spec: line also fetches the file and checks that its bytes
have the sha256 the line names. When they do not, or GitHub refuses the link
with a 4xx, nothing starts and the poll says once why, for example the bytes of its spec are not the ones its `Spec:` line names: they have sha256 <hex>. The file attached is not the one the line was written for: attach
the spec, write its link and the sha256 of its bytes (sha256sum spec.md),
and apply tehas:ready again. A start from tehas start is not told on the
issue: the line is in ~/tehas/logs/dispatch.log, and the host's approval is
taken off the record, so run tehas start <n> again once the line is right.
An outage's retry or a refresh stopped this way is not tried again on its
own: apply tehas:ready. ERROR: the spec of #<n> could not be fetched (curl exited <n>), with HTTP <status> when GitHub answered, is a fetch
that failed on the way, a 5xx among them: nothing changed, the poll ends
with 1, and the next poll tries again.
The cycle fetches the spec once more as it starts and holds it to the same
pin. Tehas started no cycle: the bytes of its spec are not the ones approved means the file changed between the poll and the start; its spec could not be fetched (curl exited <n>) is a fetch that failed. Nothing ran:
apply tehas:ready again once the spec is right. tehas work: <image> does not support what this cycle is given followed by the feature issueSpec
means the sandbox image's pi-rukas does not read a spec: the start stops with
78 rather than run a cycle that would never see it. Rebuild the image on a
pi-rukas that lists issueSpec, or take the Spec: line out and approve the
issue again.
A cycle with a pinned spec that hands off with its pull request open parks,
rather than wait for a merge, when the pull request does not answer to that
spec. The park reason is spec-block, and the comment says Its pull request does not answer to the approved spec: and then one of:
its body has no spec block;its spec block names sha256 <got>, not <pinned>, the one approved;its spec block cannot be read: <why>, with the reason of the parser;the approval of this start could not be read, so its spec block could not be checked, when the state store did not answer.
Fix the block in the pull request's body so that it is one tehas
reads and names the approved sha256,
then retry. Or, when the issue should not be held to a spec, take the Spec:
line out of the issue and approve it again.
The caps this factory has posted are explained one by one in the next section.
An edit to AGENTS.md or CLAUDE.md stops nothing here, and its absence from
the row above is not an oversight: pi-rukas does not halt a cycle for a policy
edit. The edit ships and you see it in the diff, and the cycle is judged
against the doctrine at the commit it started from, so an edit of its own
changes nothing for that cycle. See Operating tehas.
A tick in the park comment starts nothing
A box counts only in the question this host has on record for the issue's current park, on the state store. The poll's log says which case it is:
skip #N: a box was ticked in a question this host has no record of: the comment is not that question. It may be the question of an earlier cycle (a start takes its question off the record), one atehas:plansession ortehas stoptook off, one whosetehas:questionlabel could not be added when it was posted, or a comment with a copied marker. The poll unticks it and comments that the factory is not waiting on it. Applytehas:readyto start a cycle.skip #N: its question on record could not be read (<word>): the state store was busy. Nothing was ticked or unticked; the next poll reads it again. A store that cannot be used stops the poll with exit 78 instead: see~/tehas/logs/dispatch.log.skip #N: the question on record does not belong to this issue: the comment's marker names another issue or kind. Nothing is changed.skip #N: its question is not among the last 100 comments; tehas:question is set and no comment carries the question, so the issue waits until its open points are answered or the label is taken off: the host has a question on record for this issue and the comments it read do not carry it. The hold is thetehas:questionlabel, not the order of the comments: the poll reads the last 100, so a new comment does not lift it and a comment that fell out of those 100 does not cause it. Answer the open points of the question in the bot's comment, or taketehas:questionoff and applytehas:readyto start afresh. The last is what a factory does when the account that posted the question is gone: see a GitHub App for a factory.WARN: could not record the park question of #N, its boxes will not workin the cycle's log: the question was posted while the store did not take it. Applytehas:ready.
tehas work refuses the driver
tehas work checks the driver before anything moves, and stops with these:
| What it says | Why | What to do |
|---|---|---|
tehas work: --driver takes lean or classic, not <word> (exit 64) |
--driver by hand was given another word. With no word at all it prints its usage, also exit 64 |
Run it again with --driver lean or --driver classic |
tehas work: the approval of #<N> names a driver this tehas does not know, not starting a cycle (exit 78) |
The start's approval record holds a driver other than lean or classic: it was written by a newer tehas, or by hand |
Update tehas, or apply tehas:ready again for a new approval |
tehas work: <image> does not support what this cycle is given, not starting a cycle: then (driver lean, work-lean; it does not run classic in its place) (exit 78) |
The sandbox image's pi-rukas cannot run work-lean as this start asks. The lines below name each flag, input or feature it lacks. A refresh (--continue-pr) is refused here when the image does not list it for work-lean. A line that ends (tehas passed it, and work-lean never takes it: a fault of tehas, not of the image) names a flag tehas should not have passed |
Rebuild the sandbox image on a newer pi-rukas, or take tehas:lean off to run it on classic, which changes its driver. For a refresh, start a fresh cycle instead. For a line that names a fault of tehas, update tehas. See the park table |
Classic never runs in lean's place.
A cycle stops at a cap
pi-rukas's handoff, in the bot's comment, has the heading "Cap hit", and its
line **Cap**: names the cap. Under "What this cap means" are pi-rukas's own
words for this stop, and under "Worktree state at handoff" whether the work is
on a branch and whether that branch was pushed.
Read the rest of the comment with three things in mind:
- Its paths are the ones inside the cycle's container. The workspace that is
~/tehas/work/tehasthere is~/tehas/work/tehas-<issue>on the host. - Its "Concrete recovery commands" are written for pi-rukas run by hand. On
the host a retry does what they do: tick a retry box in the bot's
comment, or apply
tehas:ready. Both start a fresh cycle from the first step, in a new workspace. Commits that were never pushed are kept intehas-<issue>.before-retryuntil the next retry. See step 5 of Operating. - The workspace was written by the cycle's container, its git settings and
hooks included. tehas runs no git in it on the host to read it: git there
would run what the cycle left in those settings. Read its files instead. The
one host command that works in it is tehas-cycle finish,
which cannot read the branch without git: every call it makes pins
core.hooksPathandcore.fsmonitoroff on its own command line, so a hook or a helper the cycle left runs for nobody.
A retry approves the issue text as it is then, so change the issue first when
the cap asks for it. A cap posted on a pull request came from the review
stage, after the pull request was opened. When that pull request is still open
at the end of the cycle, the issue gets needs-human-attention, and the
comment names the cap and the pull request. Only the cap awaiting-human-merge
gives tehas:awaiting-merge, and only when the review did not run out of
rounds with findings open.
The cap deadline means the cycle came to the deadline tehas gives it, a
quarter of TEHAS_WORK_TIMEOUT before the end, and started no new step. Its
branch and pull request are as the handoff says. Retry when the issue can be
done in the time, or split it.
Two caps are tehas's own, not pi-rukas's: wall-clock when the cycle reached
TEHAS_WORK_TIMEOUT, whether the runner stopped itself or tehas stopped it,
and stall when none of the cycle's logs changed for TEHAS_WORK_STALL
seconds and tehas stopped it. See wall-clock below. A stop
tehas made takes the place of a cap the runner named for the step it was
stopped in, and the record's capReason says so: tehas work stopped the container at the time limit of 21600s, step develop in flight; the runner had named the cap verify-failed:develop. Only a cap of an end the runner reached
before the stop, such as a handoff, is kept. Both say the step the cycle was
in, from the runner's progress where its result names none. A cycle stopped this way has usually done less
than its comment claims; read the run log named there before you retry, and
retry when the cause of the stall is gone.
The third cap tehas sets for itself is runner-never-started, for the
container that ended before the driver wrote its first event. See
runner-never-started below.
The fourth is signal: a TERM, INT or HUP came to tehas work and it
stopped the container, and the runner named no cap. The record's capReason
says SIGTERM came to tehas work and it stopped the container, step develop in flight. When the stop came while the driver's gate ran, the stream holds a
verify-started with no verify-completed; tehas work then adds a
verify-aborted line for it, with "by": "tehas" and the signal, and the
cycle's console.txt ends with a line that says so. A person's tehas stop
keeps its own reason and no cap.
A container that ended with 137 when tehas did not stop it goes on record with
the cap container-killed. The record's capReason says the container was killed with the exit status 137 and tehas did not stop it, step lens-fix in flight; 4 processes in it were killed for memory. This is not a stop of
tehas's own: the comment says Its cause is recorded as the cap container-killed.
These are the caps the factory posted on its own issues from 10 to 14 October 2026, most frequent first.
verify-failed:develop
After the develop step, the driver ran the checks itself, and they did not back the developer's claim that the work is done. The lines under "What this cap means" say which check. Four kinds were seen, and the last of them has two forms:
touched out-of-scope path <file> - declared fence violated (issue-fenced). The plan marked that file as out of scope for the work, and the developer changed it anyway. On this factory the files were tests (test/*_test.sh), manual pages (host/docs/*.md), the front page's style sheets (host/fun/*.css), and in one cycle scripts as well. Tests and manual pages are what the repository's rules require a change to touch, so the plan's fence and the rules disagree (tehas-app/tehas#159, trail-openers/pi-rukas#1250). Name in the issue every file the change will touch, the test file and the manual page included, as step 1 of Operating says.verify command ... failed on the CONSOLIDATED tree, orexceeded its 10-min timeout. The product's gate failed on the change, or ran past its time. The gate's output follows in the comment. Often a real defect. If the failure is in code the cycle did not touch, see "The verify gate fails on code the cycle did not touch" below. When the failing line is a shellcheck note, the severity the lint runs at and the one suppression it accepts are underscripts/test.shin Tools.- The fix pass after the adversarial review did not clear: it changed
nothing, or it removed lines it should not have. When the cap is
fix-pass-park, it names a test file, and the reason readsit sits behind this workstream's outOfScope fence, which the spec does not lift, the refusal is the fence: the plan read the issue'sOut of scopesection as part of that fence (step 1 of Operating says why), so the fix pass was refused the file its own deliverable told it to write. It is the same refusal as the first entry above, met later. The reason names the refused file but not theOut of scopeentry that refused it, so compare the file against every bullet: a directory, a pattern or a cut-down entry can cover it. Then name the file in the deliverable, drop it fromOut of scope, and approve the edited body again, as step 1 and the end of step 5 of Operating say: the label or the tick approves the body as it was then. consolidated verify was refused repoRoot is dirty (...). Not a gate failure: the driver would not run the consolidated gate at all because it found files in the checkout that git does not ignore. When the names are undertarget/they are cargo's own build output and lock files, left by a gate that built Rust with the repository as its workspace root, sometimes by the driver's own earlier pass. The repository's.gitignorenow ignores/target/at the root, so these no longer count. Check the names in the cap before you delete anything: dirt the gate did not make may be work. When the driver wrote no reason, the cycle'serr.txtsays so in one line naming the cap. (#248, #285.)
The work is committed on a local branch in the workspace and was not pushed. There is no pull request. Change the issue where the cause is in it, then retry.
verify-baseline-red:<step>
Before the developer ran, the driver ran the product's gate once on a clean
checkout of the cycle's base commit, and it failed there too. The cause is
on the branch, not in the issue. The cap says ALSO FAILS on a clean checkout of the cycle's base commit <sha>, then the assertion that failed. When it
says (no specific assertion could be extracted), pi-rukas found none in the
gate's output, and the cycle keeps no copy of that output: its
stream.jsonl has no verify-completed event for the base run, and the
record's capReason is cut at about 180 characters. Run the gate yourself
on that commit, as The verify gate fails on code the cycle did not
touch says, to see
which case is red.
The cycle got here after its explore and plan steps, and the run at the base
takes as long as one full gate, so this is the most expensive way to learn
that the branch is red. Every cycle the poll starts onto the same commit
parks the same way. Set TEHAS_BRANCH_CHECK to the check that runs the gate
on every push, verify for this repository, and the poll holds new cycles
with holding: main is red at <sha> while that check failed on the head
commit (see Limits that hold work back).
Fix the branch, then retry.
What only pi-rukas can change (tehas-app/tehas#751): the base run should
write a verify-started and a verify-completed event with status: "failed", the failing suite, the assertion and the path of the output it
kept. When it extracts no assertion it should say so and name that path.
intent-park
The cycle stopped before the plan. Having read the issue and the code, the driver did not settle on what to build. No branch was made and nothing was written. The first sentence of "What this cap means" says which verdict, and "Resolver's rationale" says why.
| The comment says | Verdict | What to change |
|---|---|---|
| "does not say enough to build from" | underspecified | The next poll refines it once on its own. If it was refined before, add a ## Acceptance criteria section, or say concretely what should change |
| "central claim is contradicted by the code as it actually is" | contradicted-by-code | What the issue says about the code is not what the code does now. The issue may be stale, or describe a bug already fixed. Read the evidence in the comment, then correct the issue or close it |
| "rests on a premise the driver could not substantiate" | premise-unsound | Name where the API or behaviour the issue relies on is, or correct the premise |
| "appears to be already implemented" | already-implemented | Close the issue, or say what is still missing |
| "is too large to execute as one cycle" | too-large | The next poll refines it once on its own into a first part. If it was refined before, split it into several issues |
The last one is in pi-rukas and was not seen here. After the change, retry.
wall-clock
The cycle reached the host's own time limit, TEHAS_WORK_TIMEOUT (6 hours by
default), and nothing else stopped it first. This cap is tehas's, not
pi-rukas's: the runner stopped itself at the limit with no cap of its own, or
it did not stop and tehas stopped its container 300 seconds later. The status
is timeout, and the comment says which of the two happened and the step the
cycle was in. That step was cut off in the middle, so what it wrote may be
half done. The deadline before the limit should have parked the cycle at a
step boundary with the cap deadline; a cycle that reaches wall-clock was in
one step that outlasted the margin. Read the run log the comment names for
what that step was doing. Raise TEHAS_WORK_TIMEOUT only when the work was
progressing and needs more time; when the step was stuck, find out why, or
split the issue.
Until result schema 4 (pi-rukas, 18 October 2026) pi-rukas used the name
wall-clock for its review loop's budget. An older comment on a pull request
that names wall-clock is the cap below.
runner-never-started
The container started, ran its preflight, and ended before the driver of
pi-rukas wrote its first event. Nothing of the issue was read, no step began,
no branch was made, and no model time was spent. This cap is tehas's, not
pi-rukas's: tehas work watched the container to its end, found its result
empty and not one line in the cycle's stream, and left the account of it in
state/cycles/<N>.nostart. A result it could not read is still a result: that
runner started, and no note is left for it. The comment says no step started, the record's
step is no-step, and its capReason names the container's own exit status
(the container ended with the exit status 1 and wrote no line of its stream, so the driver wrote no event and no step started), so a run of this kind can be
counted and grouped with the others of it. A note that could not be read is
still the note: the cycle is on record the same way, its capReason says the
exit status could not be read, and tehasbot cycle warns of it. A note that is
a link, or holds anything but an exit status of 1 to 999, is no note, and
tehasbot cycle warns of that too. The word of the step is tehas's own:
no step of pi-rukas is named there, and it is kept clear of the word
not-started, which names a start tehas work refused at exit 4.
The cycle's own files hold nothing for it: console.txt has only the two lines
of a console that waited and detached, stream.jsonl is empty, and what
err.txt holds is the one line tehas work wrote for this end, which names
the preflight file: nothing of the container's own text is in it, because
tehas work removes that file when it clears the cycle's other files. The last
line of preflight.txt is the provider-retry echo, and it says nothing about
the failure: the cycles that ran for hours have the same last line.
So this cap says the host stopped the cycle, not the model or the change. What it cannot tell you is which part of the host did: an image that died on its way in, the slice refusing the container, a socket that closed, or the poll state of the cgroup. Look at those, in this order:
jq . ~/tehas/state/cycles/<N>.result.json # empty: the runner wrote no result
tail -n 5 ~/tehas/logs/work-<N>-*.preflight # what the preflight reached
docker ps -a --filter name=tehas-work-<N> # the container, if it is still there
systemctl --user show tehas.slice -p MemoryMax -p ActiveState # the slice's ceiling and state
Read those on the host, and do not paste their output into the issue: a preflight file carries the provider's own words and the remote of the product, and a container list names this host. The last command is asked for two properties rather than the unit's status because a status prints the host's name, which the rest of these files keep out of anything a cycle publishes.
Nothing of the issue needs to change, and there is no workspace to read: the
retry starts from the first step again. Each such end is posted on the issue as
it happens, so the comments of the issue say how many times it has ended this
way. Read that count before you start it again: when the same issue has ended
twice this way with nothing between them changed, the cause is on the host and
repeating the start will not fix it. Where the count is not visible on the
issue, tehasbot status names the cycles of an issue and their caps.
lens-review-timeout
The review stage's rounds of review and fix ran past pi-rukas's budget for
them, PI_ENSEMBLE_REVIEW_WALL_CLOCK_MS (90 minutes by default). It is the
review loop's own clock, not the cycle's time limit: raising
TEHAS_WORK_TIMEOUT does not change it. A PI_ENSEMBLE_REVIEW_WALL_CLOCK_MS
line in instance.env does. The record's capReason says how long the loop
ran, in which round, and the budget.
The comment is on the pull request. The pull request is open, with what was
pushed before. The comment names the worktrees in the workspace that hold the
cycle's commits; what was not pushed is only there. Read the review on the
pull request, then merge it, finish it by hand, or close it. Nothing in the issue needs to change. Close
the pull request before you retry: while it is open, a new cycle stops at
existing-pr-detected.
child-timeout:<step> and spawn-backstop
child-timeout:develop or child-timeout:explore: one child of that step ran
past its own run bound. pi-rukas told it to wrap up at the bound and ended it
10 minutes later. Read the run log for what the child was doing. When it was
progressing, split the issue; when it was stuck, find out why. The runner
reports the end as aborted; the cap child-timeout:<step> beside it says it
was a child's bound and not an abort.
A child-timeout:develop leaves a note of the attempt at the end of the
issue's body, which the next cycle reads. A second one on the same text offers
no retry: split the issue with tehas:plan, or make the body smaller. See
When a cycle stops.
spawn-backstop: a child ran past the backstop, PI_ENSEMBLE_SPAWN_TIMEOUT_MS,
which only catches a child nothing else ended. tehas gives the container that
bound from TEHAS_CHILD_TIMEOUT, whose default the settings table of
the tools page states; pi-rukas alone allows
the same two hours. When a child that was still making progress is stopped by
it, raise TEHAS_CHILD_TIMEOUT in the instance's optional.env; it may be at
most TEHAS_WORK_TIMEOUT. Until result schema 5 (pi-rukas v0.14.0) this cap was
named developer-timeout.
step-failed:adversarial
The adversarial review could not run: its dispatch failed twice. It says nothing about the code. All three times it was seen here, on 14 October, the model endpoint was timing out (tehas-app/tehas#147, trail-openers/pi-rukas#1243). The work is committed on a local branch in the workspace and was not pushed. There is no pull request. Check the endpoint, as in "The model endpoint does not answer" below, and retry once it answers. The issue needs no change. The retry starts from the first step: the work already done is not reused.
develop-incomplete-deliverables
The gate passed, but the change lacks a part the plan declared. The comment
names the missing parts by id and path, for example d5 (host/fun/host-data.js). pi-rukas has already tried once to add them.
The work is committed on a local branch in the workspace and was not pushed.
There is no pull request. Retry: a new cycle gets a new attempt at the
missing parts. If a missing part is one the issue does not want, say so in
the issue first.
lens-fix-not-integrated
In the review stage, a round of fixes was made in a worktree and could not be
committed onto the branch. Both times it was seen, git said Committing is not possible because you have unmerged files. The comment is on the pull
request. The pull request is open with the code from before that round; the
fixes are only in the workspace. Read the review's findings on the pull
request, then merge it, fix it by hand, or close it. Close it before you
retry, as for lens-review-timeout.
lens-fix-reposition
In the review stage, the next round of fixes could not fetch the branch from
GitHub (couldn't find remote ref). Both times it was seen, the pull request
had been merged while the review ran, and its branch was gone. Then nothing
is left to do. If the pull request is not merged, look for why the branch is
not on GitHub.
integration-worktree-violation
integrate worktree could not be created: refusing to force-remove existing
worktree .../.worktrees/issue-<N>-<name> - it holds unrecoverable work
This message is the second failure, not the first. pi-rukas commits the cycle's work to the feature branch and pushes it. When the push (or opening the pull request) fails, it falls back to an agent working in a fresh "integrate" worktree, and creating that worktree is refused because the cycle's own worktrees hold commits. So look for why the push failed.
The first two real cycles died this way: git in the sandbox had no credential
helper and every push ended in
could not read Username for 'https://github.com'. tehas work now passes the
helper and the bot's identity, and checks with a dry-run push before starting.
The host's own git is covered the other way round: tehas setup gives it gh's
helper for github.com and keeps one that is there (see
tehas setup).
Check the push by hand:
tehas work <issue> # exits 3 at once, with git's message, if it cannot push
While the sandbox cannot push, tehas work records the fault in
~/tehas/state/push-fault.json with the time, the bot's login and git's line,
and the poll holds every start while the file stands. The log has one line,
holding: the sandbox cannot push: <git's line> (<login>), and tehas status
prints push the sandbox cannot push: <git's line> (<login>) while the
file stands. Nothing is parked and no issue loses tehas:ready. Once the file
is ten minutes old the poll asks the sandbox itself, with no cycle spent on it:
it runs the same dry-run push a start runs, with the App's cycle token, in a
fresh copy of the product checkout as a start's workspace is, and with the
sandbox image already on the host. It asks only when the poll could start a
cycle: not while the factory is paused or nothing is ready. A check
that passes takes the file off and the queue starts as usual; one that is
refused writes the fault fresh and the hold begins again from that moment.
When the poll cannot ask at all (no sandbox image, no cycle token, no docker or
no daemon), it records nothing, logs WARN: the sandbox could not be asked whether it can push: ..., and lets the next start's own check decide. Planning
turns and refreshes run through the hold.
The fix is nearly always the App's install rather than the host's git: the install whose token the sandbox is given needs Contents: Read and write on the product repository. Check it on the App's page under Installation access, or with a person's own credentials:
git -C ~/tehas/repos/<name> push --dry-run origin HEAD:refs/heads/tehas-preflight
When that push is refused too, the repository, not the container, is the problem. When it works, the fault is in what the sandbox is given: a token without Contents write, a remote that is not the App's, or an expired install.
The work of a parked cycle is not lost. Its commits are in the cycle's own
workspace, ~/tehas/work/<product>-<N>/.worktrees/issue-<N>-*, and the
driver's combined commit is on the local branch feature/issue-<N>-... there.
A retry moves that workspace to <product>-<N>.before-retry.
Once the push works, retry.
existing-pr-detected
Before any work, pi-rukas found a pull request already open for the issue:
its branch names the issue, or its description closes it (Fixes #<N>).
Nothing was written. Here it was once a pull request of an earlier cycle and
once a person's own. Merge that pull request, or close it and retry. A retry
that asks with the tehas:ready label stops the same way while it is open: the
poll takes the label off and names the pull request on the issue. A retry
asked by ticking Retry in the park comment does not reach pi-rukas at all:
the poll sees the open pull request first, unticks the box and says the same
on the issue. Merge or close the pull request, then tick the box again.
review-incomplete
In the review stage, at least one of the six review passes failed every retry, so the review did not finish. That is not a rejection. The comment is on the pull request, which is open with the work pushed. Review the change yourself, then merge or close it.
The runner died and wrote no result
The bot's comment says Tehas cycle handed off with its pull request open and its review unfinished, or Tehas cycle stopped without a pull request, with
last step followed by read from its run log and a runner exit that is not
one of the ends of the contract (10, 11, 20, 21). The runner of that cycle died
before it could write its result, so tehas read the step it was in from its run
log and asked GitHub for the bot's pull request of the branch that
commit-pr pushed.
- The comment names the pull request when GitHub lists one. Read it: the change
is up for review, and a clean retry redoes what it already holds. That
comment has no retry boxes, and the issue carries
needs-human-attention. - A run log longer than the 200 KB tehas reads is read from its end, and only
what that end says is known. Such a cycle is not handed off: tehas cannot say
that nothing came after the step its log's end names, so the issue is parked
with the retry boxes, and the comment still names the pull request GitHub
lists on the branch. Read
~/tehas/logs/work-<N>-*.jsonlfor the rest. - The comment says no pull request was found when GitHub lists none. The
change is then either unpushed or pushed without a pull request. The
commits are in the cycle's workspace, on the local branch
feature/issue-<N>-...there:git -C ~/tehas/work/<product>-<N> log feature/issue-<N>-..., then push it and open the pull request by hand, or retry for a fresh cycle. - The step is
-when the run log has no step for this cycle at all, which is what saystehas workstopped before it started the container. Read~/tehas/logs/dispatch-work-<N>.log. A run that stopped for want of a gate is of that kind: the log has the line naming.pi/verify-cmd, and the issue has no comment, because a cycle that never began has nothing to hand off. See A new project for what the product has to hold. - A cycle whose container started and then ended before the driver wrote its
first event is not of this kind, and its step is not read from its run log at
all: it is on record as
runner-never-started, with the stepno-step.
jq . ~/tehas/state/cycles/<N>.result.json # empty, or missing: no result
tail -n 40 ~/tehas/logs/work-<N>-*.jsonl # the steps the runner reached
The log of the run says what the runner was doing; the comment says what tehas made of it, and the two are read in that order.
A provider error about context length
This model's maximum context length is 16384 tokens
A child agent fell back to the first model in models.json, a small one.
PI_ENSEMBLE_SUBAGENT_MODEL and PI_ENSEMBLE_SUBAGENT_PROVIDER did not reach
it. Check them in the instance's instance.env and run ./install.sh --check
in ~/tehas/platform. Listing the intended model first in models.json
removes the trap.
The model endpoint does not answer
curl -s -m 10 "$(jq -r '.providers.fleet.baseUrl' ~/.pi/agent/models.json)/models" | jq -r '.data[].id'
fleet is the provider's name in the example. An endpoint that takes a token
answers 401 without one: add -H "Authorization: Bearer $TEHAS_MODEL_KEY_MAIN"
from a login shell. For the backup, ask .providers.fleet.backupBaseUrl the
same way. The dispatcher makes this call
at every poll. While the call fails, or the answer lists no models or not the
configured one, it starts nothing: tehas status says warn: No resources,
the dashboard says no resources, and the dispatcher's log has one line that
starts with holding: no resources:. It logs released at the first poll
that finds the model again. A cycle that was already running when the endpoint
went away is not stopped: it stalls and times out.
The hold says which way the call failed:
does not answer: no answer within 10 seconds, or no connection at all.refused the request with HTTP <code>: the endpoint answered with an error. 401 or 403 is the token: check theapiKeyinmodels.jsonand the variable it names in~/.config/tehas/env. 429 is a rate limit.could not be asked: curl could not be run: curl is not on the dispatcher's PATH. Install it; the endpoint itself may be fine.
If the call works on the host but agents cannot reach the endpoint, its host
name does not resolve inside the sandbox: add it to PI_ENSEMBLE_HOST_ALIASES.
A sandbox build stopped partway
A build writes one file: the copy of the recipe docker is handed,
~/tehas/sandbox/sandbox-uid.Dockerfile, beside the build script. It takes that
copy back when the run ends, and a run that was killed by a signal bash cannot catch
leaves it standing; the next build names the time it was written, says it replaces
it, and builds from the tracked recipe. A link or a directory under the name is
refused instead, because the build would be written through it: take it away by
hand, as its owner.
rm ~/tehas/sandbox/sandbox-uid.Dockerfile # the copy a killed build left
tehasbot clean takes a copy of TEHAS_CLEAN_AFTER hours and older with the rest
of the host scratch, and sandbox/build.sh itself takes back the temporaries of
earlier runs before it starts. The copy is staged at
~/tehas/sandbox/sandbox-uid.Dockerfile, the name the build says when a stale
copy or a bad name stops it, and it is gitignored, so tehas update sees no local
change in it: what the image was built of is what the tracked
~/tehas/sandbox/Dockerfile holds.
The state file says running but nothing is running
A cycle that died leaves status: running behind. Confirm with
docker ps --filter name=tehas-work, then start clean:
tehas work <issue> --restart
The new run starts in a fresh workspace. The old one, its state file
included, is moved to ~/tehas/work/<product>-<issue>.before-retry, and the
next run replaces that. Branches pushed to GitHub are kept.
The verify gate fails on code the cycle did not touch
The base is broken. Confirm on a clean checkout of the default branch, with
the product's own full gate (the first line of .pi/verify-cmd-full). For the
example product:
scripts/verify.sh --full
Fix the default branch first; every cycle will fail the same way until then.
With TEHAS_BRANCH_CHECK set, the poll starts no cycle while the branch's
check is red, so new cycles wait for the fix instead of parking at
verify-baseline-red after their plan.
When the gate stops on a shellcheck note, the severity floor the lint runs at
and the one suppression it accepts (SC2016, for the line whose single quotes
are the point) are under scripts/test.sh in Tools.
tehas update says the console does not answer
tehas update runs in ~/tehas/libexec/console, so a console that does not start
stops any update with exit 1 before it changes anything. Exit 78 and
no console at say the file is not there at all. It cannot repair itself: put a
working console back by hand. On a host that updates from releases, that is the
install.sh of a version still on the host:
ls ~/tehas/versions # the versions on this host
~/tehas/versions/<previous>/install.sh # installs that version's files, its console among them
tehas update --to <previous> # points current at it and finishes the steps
touch ~/tehas/state/update-hold # stay there until a fixed release is out
On a host that updates from its checkout, run ./install.sh in ~/tehas/platform:
it builds the console. A console left by an interrupted --to to an older version
answers the same way, and the same steps mend it.
tehas update says the cycle token cannot push
A cycle's container pushes with the GitHub App's cycle token, which
tehasbot github-token --cycle makes: the app's token narrowed to
TEHAS_REPO, with Contents and Pull requests write and Issues read. A real
tehas update and install.sh --check push with it once, as a dry run, from
the product checkout to its origin. When that is refused, every cycle would
stop at once with exit 3 and tehas work: the sandbox cannot push to origin,
so the update says so first:
Cycle token: CANNOT PUSH (tehas-app-bot[bot] was refused a dry-run push to origin)
remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/tehas-app/tehas.git/': The requested URL returned error: 403
The update exits 1. What it installed stays installed. A drained factory stays drained, and the last line says so; on a factory that is not drained, the poll's push-fault hold below keeps it from starting one issue after another.
The token is the app's to fix, not the update's:
- The app is installed on the repository, by the account that owns it: an
installation on a personal account does not reach an organisation's
repository, and the other way round.
tehasbot github-token --cycle --checksays which repositories the token reaches. - The installation has Contents and Pull requests read and write and Issues read. When the app asks for new permissions, the owner of the installation accepts them in its settings; until then the token has the old ones.
- A ruleset on the repository lets the app push
tehas/branches.
Then run tehas update --check. When it says Cycle token: OK, run
tehas limit clear. the app made no cycle token instead means tehasbot
could not make one at all; its own line follows.
install.sh --check says Follow-ups: NOT DONE
A follow-up that was asked for has not run. The lines are in
~/tehas/state/update-pending: what install.sh recorded as it copied files, and
what tehas update has not finished. Run tehas update: it runs the steps in
their fixed order and clears the record. If it names a step
line in a WARN: instead, the checkout asks for a step this installed
tehas update does not know. Pull and run it again, since install.sh installs
the commands before the follow-ups run.
The lines are step lines, not shell text: docs on its own is not one, because
that renewal needs its --force-recreate flag. A line this version does not
accept is named in a WARN:, is not run, and stays in the record.
A record this account cannot open, written by another account or with a mode that blocks reading, stops the update with exit 1 rather than read as "nothing owed": it holds steps, and writing over it would lose them. Make it readable again, or delete it once you have run those steps yourself.
tehas update stopped partway
Each step prints one line, and the update stops at the first that fails, with
exit 1. What ran before it stays done: files install.sh copied stay
installed, each replaced file kept as <name>.prev. The steps not yet run stay
in ~/tehas/state/update-pending, and install.sh --check reports them as
Follow-ups: NOT DONE. Fix what the failed line names and run tehas update
again. It runs the owed steps even when the checkout has not moved.
A line that starts settings: and exit 78 right after the fast-forward mean
the new code asks for a setting the instance does not have. The checkout is
at the new code and nothing was installed. Add the setting to instance.env
and run tehas update again.
bootstrap.sh user stopped after the line naming the pi-rukas commit
The clone under ~/tehas/repos/pi-rukas is a copy of upstream, and a fetch of
it that fails now says which step failed and gives git's own words. Read that
line. A host from before this does the same thing without the words: the fetch
ran quietly, so the run ended after
bootstrap: installing pi-rukas <sha> (replacing <sha>) and
install.sh --check went on saying Dependencies: NOT OK. Run
./bootstrap.sh user again; it now takes a release tag upstream re-pointed.
The one case that still needs a hand is ~/.pi/agent: pi-rukas's installer
rewrites the two files it puts there, and install.sh is what puts them back.
Run ./install.sh after it, then ./install.sh --check.
install.sh printed a later: line
A later: line is for a person. tehas update passes it through and does not
run it, and it is not recorded as owed. Run the command it names yourself:
later: <checkout>/bootstrap.sh user:versions.envchanged, and the tools on the host follow the pins only when this runs, as the tehas user. Until theninstall.sh --checksaysDependencies: NOT OK.later: ~/tehas/bin/tehas index: the code index was not built. It needs the sandbox image and the product checkout.later: sudo <root-owned copy>/bootstrap.sh dev <user>: root's copy of the command behindtehas devfor other accounts is not this checkout's. Only root can install it, from a copy of the platform root owns at this version, not from the checkout: see Root runs its own copy.later: ./install.sh again ...: old files were left in place. The line says when to run it.
scripts/tag-deploy.sh fails with ~/tehas/env.sh: No such file or directory
The script runs tehas update on the host over ssh, as the account ssh logs in
as. Without a user in the destination or in ~/.ssh/config, that is your local
login name, not the tehas user. Put the host's user and key in ~/.ssh/config:
Host tehas-tehas
User boss
IdentityFile ~/.ssh/<key>
Then run scripts/tag-deploy.sh tehas-tehas again. TEHAS_SSH changes the
ssh command itself.
The edge router is not running
tehas update recreates the router only where it already runs, and never
starts it. Where nothing runs, the update says edge: not running on this host, left alone and the step is done. Start it:
. ~/tehas/env.sh
docker compose -f ~/tehas/edge/router.compose.yaml up -d
If compose says the port is taken, a container of some earlier install is
holding 8081: docker ps names it, and it is taken down with
docker rm -f <container> before the line above.
The router also needs the network tehas-previews, which install.sh makes. If
compose says the network is not found, make it. install.sh does not make it
on a Docker older than 27.1, and says so; check docker version first, and
update Docker before making it by hand:
docker network create --internal --ipv6=false -o com.docker.network.bridge.gateway_mode_ipv4=isolated tehas-previews
A preview is not there
The dashboard lists the open pull requests that have a state under
"Previews", with the address, or with the state and the reason written into
the state file. The same is in
~/tehas/preview/<pr>/state.json, and what the runs did is in
~/tehas/logs/preview.log. Look for the state first.
Nothing is listed at all. The section is missing when the host has no
~/tehas/live/previews.json. Either TEHAS_PREVIEWS is not 1, or the timer
was never enabled: systemctl --user list-timers tehas-preview.timer. An
update does not enable it. See Previews. A pull request from a fork
is never listed and never built; the log counts it as from elsewhere. Nor
is one that someone who is not an owner, member or collaborator of the
repository opened, even between two of its own branches; the log counts it
as opened by someone outside the repository.
no-recipe. The pull request's commit has no preview/Dockerfile. Add
the file to the branch; the next commit is tried. See
A new project.
build-failed. Read ~/tehas/logs/preview-<pr>.log. The reason in the
state says which of four things happened:
- The build failed or ran over 15 minutes. The same commit is not built again. Push a new commit and that one is tried. A preview of the earlier commit keeps serving meanwhile.
The recipe declares a volume outside /tmp, /config and /data. Its path is in logs/preview-<pr>.log on the host.The build went through and the image was not run, and it was removed. That log line names the path:The recipe declares a volume at <path>. A preview may write to /tmp, /config and /data only.It is text of the recipe's own, so it stays on the host. AVOLUMEline, in the recipe or in the image it starts from, names a directory other than those three, and Docker would put it on the host's disk. Take the line out, or start from an image without it, and push.The image's volumes could not be read.is the same outcome when Docker did not say what the image declares. Both are treated as a failed build: the same commit is not tried again, and a preview of the earlier commit keeps serving.- The container did not start: Docker could not create or start it, such as an image whose command is not in it. That can also be the host and not the commit, so it is tried again at each of the next three runs, and then no more for that commit. Nothing serves for that pull request, not the preview of the earlier commit either: the old container is removed before the new one is started, so the name answers 404 until a commit starts.
- The container started and stopped: five seconds after its start it was not
running, or Docker had started it again already. It was removed with the
image its build made, and the last 40 lines it wrote are at the end of the
log, under
docker logs of tehas-preview-<pr>. The usual causes are an image that writes outside/tmp,/configand/data, and one that does not start without a variable. The container ran, so this is the commit and not the host, and the same commit is not built again. Nothing serves for that pull request until a new commit starts: the old container was removed before the new one was started, and its image goes as well, since nothing runs it. Fix the recipe and push; the new commit is built.
A failed build and a recipe that declares a volume leave the earlier preview serving. A container that was never created, and one that started and stopped, leave the pull request answering 404 until a commit starts. The "Tried again" column of the table in Previews is the rule for each of these.
To have the same commit built again, remove the state and let the next run
find the pull request anew: rm -r ~/tehas/preview/<pr>.
no-space. Less than TEHAS_PREVIEW_MIN_FREE is free on the file system
of ~/tehas or on Docker's. Nothing is built, what serves stays, and /health
says warn.
df -h ~/tehas
docker system df
docker image prune # removes images with no tag that nothing uses
A sandbox build removes the date tags of builds before the newest two itself;
one run from a checkout has no console to ask what is held, and removes none. The
cleaner prunes Docker's build cache every hour, of whatever has not been
used for TEHAS_CLEAN_AFTER hours, and removes the build output of kept
workspaces, old host scratch, the sandbox image's dated tags before the newest
two builds whatever their age, and the upstream base image of that age a host
pulled before the base was built on the host
besides (see the cleaner). Nothing a container was
made from is taken: docker ps -a shows what holds an image, and an image in
use is kept whatever its age. The cleaner removes the base by its own name and
never asks docker for the images that have lost their tag, so a preview image or
a rollback image of that kind is left where it is. To free the space by hand,
name what you mean:
docker rmi tehas/pi-rukas:<date> for one dated tag, or
docker rmi <id> for the base. A bare
docker image prune would take any image on the daemon that had lost its tag,
and an --all of it any image no container names, which is wider than the
cleaner ever goes. A preview that lost its tag is among what a bare prune takes.
install.sh copies tehas-clean.timer; check systemctl --user list-timers tehas-clean.timer when it is not running, tail ~/tehas/logs/clean.log for
what it freed, and journalctl --user -u tehas-clean for a run that left
nothing in that file: a refusal of the settings, of the lock another run holds,
or of a state directory it could not make is said before the log is opened and
reaches the journal only. docker builder prune does the same at once, and the next
build of the sandbox image is then slower.
The default branch's preview (main in the list, uat-main.<domain>)
has the same states and the same fixes, with ~/tehas/preview/main/state.json
and ~/tehas/logs/preview-main.log. It is never over-limit and is not
removed by the run or the sweep. A log line main: GitHub did not say what the default branch is at, left as it is is one call that failed; the preview that
runs stays. To start it afresh: rm -r ~/tehas/preview/main. A name that
answers 404 "No such address" is a router from before this existed, or a proxy
that does not pass uat-main.
over-limit. More than TEHAS_PREVIEW_MAX pull requests are open, and
the newest ones win. Close one, or raise the setting in instance.env.
No new state, and the log says the commit could not be fetched. A pull
request that had a state keeps it, and a new one has none. The bare
clone ~/tehas/preview/repo.git could not fetch from the product's origin.
It is tried again at every run. The git message is in
~/tehas/logs/preview-<pr>.log. Check that git -C ~/tehas/preview/repo.git ls-remote origin answers.
The log says the network tehas-previews does not keep the host out (<reason>); nothing was built. A preview runs the pull request's own code,
so no run does anything on a network from which it could reach the host.
install.sh says the same as The network tehas-previews does not keep the host out (<reason>). The reason says what to do:
Docker <version> is older than 27.1, orDocker's version could not be read: update Docker. A Docker before 27.1 does not know the option that keeps the host out. Docker 29.1.3 was seen to accept an option it does not know, so a network an older one made may look right and not be. That was not tried on an older Docker, and remaking the network there does not help either way.install.shsays this asThe network tehas-previews was not made or checked. After the update, remake the network with the lines below, since the old Docker may have made it.it could not be read:docker network inspect tehas-previewsfailed. Checkdocker infoas the tehas user.it is not internal,its driver is not bridge,it has IPv6, orit is not isolated from the host: the network was made by hand, or by an install from before these were checked. Without--internala preview could reach the internet and the model host. With IPv6, or without the option, it could reach every service the host listens on at all addresses. Take the router and the previews off it, remove it and make it again:
docker compose -f ~/tehas/edge/router.compose.yaml down
docker ps -aq --filter label=tehas.preview | xargs -r docker rm -f -v
docker network rm tehas-previews
docker network create --internal --ipv6=false -o com.docker.network.bridge.gateway_mode_ipv4=isolated tehas-previews
. ~/tehas/env.sh && docker compose -f ~/tehas/edge/router.compose.yaml up -d
The next run builds the previews again.
The log says Docker does not answer. Nothing was built or removed. The
list for the dashboard is still written, without a figure for the free space,
and the dashboard and /health say the free space could not be read.
Check docker info as the tehas user.
The state is serving and the name answers 404 with "No preview is
running at this address". serving means the container was still running
five seconds after its start, not that it answers. The router did not reach
it.
docker ps -a --filter name=tehas-preview-<pr>
docker logs tehas-preview-<pr>
docker network inspect tehas-previews --format '{{range .Containers}}{{.Name}} {{end}}'
- The first line says
Restarting, or an age of seconds that never grows: the process stopped later than those five seconds, and Docker starts it again each time, because a preview runs with--restart unless-stopped. The state staysservingand the pull request keeps its notice with the address while that goes on. The second line says why. Fix the recipe and push; the new commit is built. A process that stops within the five seconds isbuild-failed, above. - The container is up: the image does not answer on port 8080, or the third line does not name both the router and the preview.
502 from outside. The proxy in front of the host got no answer from port 8081: the edge router is not running, or it is bound to another address than the proxy sends to. See "The edge router is not running" above.
521 or 525 from outside. The proxy or its certificate. The table in Previews says which.
Nothing in the pull request's description. The notice is written for
serving, build-failed and no-space only, once for each commit and state.
For over-limit and no-recipe a notice that is already there is changed to
say there is no preview, and none is made. What was said about a commit and
state is on record in ~/tehas/preview/<pr>/.notice and is not said twice, but
the description is looked at again whenever GitHub gives a later time for the
pull request than the one on record, so a notice a person removed comes back at
the next run. The rules are in
tehasbot preview. The log line says which case it is:
#<pr>: the description could not be read (no such pull request (HTTP 404)), tried again at the next run, or withGitHub refused the call (HTTP 403). Checkgh auth statusas the tehas user: a token that lost access, or one that cannot write pull requests, answers that way for every pull request.#<pr>: the description has a preview notice that is not this one, left alone. Someone wrote the marker lines, or put text of their own inside a notice. The description is left as it is, once for each commit and state.#<pr>: the answer about this pull request was not understood. GitHub answered with something that is not that pull request's description.#<pr>: the notice was not written, tried again at the next run, and after three of them#<pr>: the notice was not written three times, left to the next commit or state. What GitHub had as the description before the last write is in~/tehas/preview/<pr>/.description.#<pr>: the pull request is no longer open, nothing was written. It was merged or closed between the list the run was given and the read.#<pr>: the description was not backed up, the notice was not written, tried again at the next run. The host could not write~/tehas/preview/<pr>/.description, so nothing was sent to GitHub. Check that~/tehas/previewbelongs to the tehas user and has room.
A comment written by the version of previews that commented instead (until 2026-10-11) is not edited or removed by anything now.
The dashboard's "List written" time is old. Every run writes the list,
also one that builds nothing. An old time means no run came by:
systemctl --user list-timers tehas-preview.timer, and
tail ~/tehas/logs/preview.log.
A preview is still there after its pull request closed
The five minute run removes it at its next turn, if GitHub answered with a
list. The sweep is the second check, every three hours. Its lines in
~/tehas/logs/preview.log have the word swept, and the time of the last
one is jq .lastSweep ~/tehas/live/previews.json. Run it by hand:
tehasbot preview --sweep
A run asks GitHub about a pull request by itself before it removes anything of
it, because the list of open pull requests is read in pages and can move while
it is read. What it removed is in the log as #<pr>: pull request no longer open, removed, #<pr>: its branch is not in <repo>, removed or #<pr>: it was not opened by someone of <repo>, removed. What it kept is said too: #<pr>: open though the list did not say so, kept, or #<pr>: no answer from GitHub, kept
for a call that failed or answered unclearly.
It removes only on a clear answer, so read what it printed:
GitHub does not show <repo>; nothing was swept by its word: the bot's token cannot see the repository. Checkgh auth status.#<pr>: no answer from GitHub, kept: the call about that pull request failed or was unclear. The next sweep asks again.#<pr>: a container could not be removed, tried again at the next sweep: Docker refused to remove a container of that pull request, so its image and state were left too.docker ps -a --filter label=tehas.preview=<pr>shows it; remove it by hand withdocker rm -f -v.the lock was not free in 30 minutes, nothing was swept: a run was building all that time.
If neither timer runs, nothing is removed:
systemctl --user list-timers 'tehas-preview*'.
This site shows an old page
The pages are installed copies in ~/tehas/docs. After a change is merged:
tehas update # pull the platform checkout, install, renew what already runs
No restart is needed; each request reads the page from disk. If the host has no
platform checkout yet, run ./install.sh from wherever the repository is kept.