Repository navigation
fix(supervisor): reach a computer whose name is too long for DNS by its short id - #935
Open
contextablemark wants to merge 1 commit into
Open
contextablemark wants to merge 1 commit into
contextablemark wants to merge 1 commit into
Conversation
…ort id Docker's network DNS answers only for names up to 63 characters (one DNS label). An isolated Bot's container name is exactly 63 with the default namespace, so any longer COMPUTER_NAMESPACE made its computer unreachable (ENOTFOUND) while it ran healthy. Over 63, the address handed to the server now uses the container's short id, which Docker also registers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
contextablemark
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
October 31, 2026 23:52
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
With the supervisor on a shared network (Compose),
ensurehands the serverhttp://<container name>:4100. Docker's embedded DNS answers only for names of up to 63 characters (one DNS label). Longer names are listed in the endpoint'sDNSNamesbut never resolve. An isolated Bot's container name,<namespace>-computer-bot-agent_<uuid>, is exactly 63 characters with the defaultopenbotnamespace, so any longerCOMPUTER_NAMESPACE(or a long person id) gives a computer that starts and reports healthy while every server request to it fails withENOTFOUND. The Bot then reports that its computer isn't running.This adds
networkHostFor(container, shortId)tonames.ts: the container name if it is 63 characters or fewer, otherwise the container's 12-character short id, which Docker registers on every user-defined network too.inspectOwnednow also returns the short id. Names that fit, including every name derived with the default namespace, are used exactly as before.A short id changes when the container is replaced. That's fine here: the server takes the address from every
ensure, and a stale one resolves to nothing rather than to a different computer.Where it runs
docker inspecton eachensure.ensure; a supervisor gives the same answer for the same container.Boundary and audit
docker inspectof a containerinspectOwnedhas already confirmed is this supervisor's.Changelog
CHANGELOG.mdunderUnreleased.Proof
Docker DNS limit, on Docker Engine 29.9.2 (Docker Desktop, arm64), resolving from the Debian
serverimage on a throwaway user-defined network:In a local staging of
c396a5fwithCOMPUTER_NAMESPACE=albert-openbot, an isolated Bot's computeralbert-openbot-computer-bot-agent_3e08c0e4-…(70 characters) was healthy, butgetent hostsanddns.resolve4both returned not-found from the server container, while its short id resolved. Every browser action failed. With this change built into the supervisor image, the same isolated Bot completed browser tasks on its own computer (the person computer had no browser running).bun testinsupervisor/: 46 pass, 1 skip (the opt-in Docker lifecycle suite), 0 fail, including three new cases innames.test.ts: a 63-character name is kept, longer names fall back to the short id, and with no short id the name is kept.tsc --noEmitinsupervisor/is clean, and biome format and lint are clean.🤖 Generated with Claude Code