feat(room): sync-mas command + proper Docker app user#343
Merged
Conversation
Adds POST /rooms/{room_name}/sync-mas backend endpoint that registers an
existing room with the CFN mgmt plane. Handles the 409 case (name already
exists in CFN) by fetching the existing MAS ID from the GET list rather
than erroring, making the operation fully idempotent.
Adds `mycelium room sync-mas <name>` CLI command that calls the endpoint.
Wires a fix_fn into _check_room_mas_ids in doctor.py so that
`mycelium doctor --fix` automatically registers all rooms missing a MAS ID.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hermes agents written by feat/hermes fail doctor's manifest validation because the Literal type and AGENT_ADAPTERS set did not include 'hermes'. Fixes the schema validation error seen in `mycelium doctor` output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
compose.yml runs mycelium-backend as user 1000:1000 but the image was built with /app/logs owned by root and /root mode 700, causing two PermissionErrors on startup: one writing logs/app.log and one accessing the /root/.mycelium bind-mount. Fix both in the Dockerfile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the chown/chmod hack with a proper non-root app user: - Dockerfile: useradd mycelium (uid 1000), chown /app to that user, add USER mycelium directive so the image declares its own intent - compose.yml: drop user: "1000:1000" (image now declares it) and move MYCELIUM_DATA_DIR + bind-mount target from /root/.mycelium to /home/mycelium/.mycelium Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 988fae2.
juliarvalenti
previously approved these changes
Jun 9, 2026
ruff format check failed on app/routes/rooms.py; OpenAPI snapshot was stale after new routes were added without regenerating. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
mycelium room sync-mas <name>CLI command andPOST /rooms/{room_name}/sync-masbackend endpoint to register (or re-register) an existing room with the CFN mgmt plane. Idempotent: on 409 it falls back to fetching the existing MAS ID from the GET list rather than erroring.fix_fninto_check_room_mas_idsindoctor.pysomycelium doctor --fixautomatically registers all rooms missing a MAS ID.chown/chmod 755 /roothack in the Dockerfile with a propermyceliumapp user (uid 1000),USERdirective, and/home/myceliumhome directory. Drops the hardcodeduser: "1000:1000"fromcompose.ymlsince the image now declares it, and moves the bind-mount target from/root/.myceliumto/home/mycelium/.mycelium.Test plan
mycelium room sync-mas <room>registers a room that was created before CFN was configured and prints its new MAS IDmycelium room sync-mas <room>on a room already in CFN finds the existing MAS ID rather than erroringmycelium doctorreports missing MAS IDs;mycelium doctor --fixresolves themdocker compose ... up mycelium-backendstarts cleanly as themyceliumuser with no PermissionError on logs or.myceliumdocker run --rm mycelium-backend:dev whoamireturnsmycelium🤖 Generated with Claude Code