A declaration copied to a second clone shares the first clone's tmux session, so up opens nothing and reports success (from martha#192) #197

Closed
opened 2026-11-25 19:20:36 +00:00 by pluto · 1 comment
Member

Purpose (fix): martha up in a second clone of one crew either opens the crew or says why it cannot, and never reports another root's session as this crew's; and the name martha init writes carries no double dash, and no claim the code does not keep.

Found in the review of martha-ai/martha#194 (martha#192), 2026-11-25, on martha main 2e937847.

A second clone on one machine shares the first clone's session

A declaration carried into a second clone of the same project on the same machine keeps the id it was given, and id names the tmux session on the one server every crew of the owner shares. So martha up in the second clone finds a session of that name, its members' windows already open, opens nothing, and says:

the crew is in tmux session <id>: martha attach shows it, from any terminal.

and exits 0. The windows it found belong to the first clone, so the second clone reports another root's crew as its own. A member the second clone then starts is opened as a window in the first clone's session, under a name that crew does not know.

This is not new: a hand-written declaration naming a shared id did the same before #194. What #192 changed is that every crew martha init declares now carries an id, so a declaration copied to a second clone is the ordinary case rather than the odd one.

The comment crewIdFor carries in src/declare_a_solo_crew/declare_a_solo_crew.ts says "two workspaces must never be named alike", which holds only for workspaces that each ran init. The title of the #192 case in declare_a_solo_crew.node-test.ts says the same. Both are corrected with this fix.

The 24-character cut can leave a double dash

crewIdFor cuts the folder's word at 24 characters, so a folder whose word has a dash at that cut names the crew aaaa...a--<digest>. It does no harm; the name is tidied with the same fix.

Done when:

  • martha up in a crew whose session name is already a session another root opened says so, naming that root, and opens nothing in it; or the session a crew opens is named for the root rather than only for the declaration;
  • a test runs two clones that share one declaration on one tmux server, and asserts the second up neither reports the first crew's session nor opens a window in it;
  • the comment in declare_a_solo_crew.ts and the #192 case's title say what holds (two workspaces that each ran init are named apart), and no name the 24-character cut leaves carries a double dash.

Refs martha-ai/martha#192.

Purpose (fix): `martha up` in a second clone of one crew either opens the crew or says why it cannot, and never reports another root's session as this crew's; and the name `martha init` writes carries no double dash, and no claim the code does not keep. Found in the review of martha-ai/martha#194 (martha#192), 2026-11-25, on martha main `2e937847`. ## A second clone on one machine shares the first clone's session A declaration carried into a second clone of the same project on the same machine keeps the `id` it was given, and `id` names the tmux session on the one server every crew of the owner shares. So `martha up` in the second clone finds a session of that name, its members' windows already open, opens nothing, and says: ```text the crew is in tmux session <id>: martha attach shows it, from any terminal. ``` and exits 0. The windows it found belong to the first clone, so the second clone reports another root's crew as its own. A member the second clone then starts is opened as a window in the first clone's session, under a name that crew does not know. This is not new: a hand-written declaration naming a shared `id` did the same before #194. What #192 changed is that every crew `martha init` declares now carries an id, so a declaration copied to a second clone is the ordinary case rather than the odd one. The comment `crewIdFor` carries in `src/declare_a_solo_crew/declare_a_solo_crew.ts` says "two workspaces must never be named alike", which holds only for workspaces that each ran init. The title of the #192 case in `declare_a_solo_crew.node-test.ts` says the same. Both are corrected with this fix. ## The 24-character cut can leave a double dash `crewIdFor` cuts the folder's word at 24 characters, so a folder whose word has a dash at that cut names the crew `aaaa...a--<digest>`. It does no harm; the name is tidied with the same fix. Done when: - `martha up` in a crew whose session name is already a session another root opened says so, naming that root, and opens nothing in it; or the session a crew opens is named for the root rather than only for the declaration; - a test runs two clones that share one declaration on one tmux server, and asserts the second `up` neither reports the first crew's session nor opens a window in it; - the comment in `declare_a_solo_crew.ts` and the #192 case's title say what holds (two workspaces that each ran init are named apart), and no name the 24-character cut leaves carries a double dash. Refs martha-ai/martha#192.
Member

Landed in 8b7c23bc; branch tip d1ebc018 is an ancestor of main (checked by Mars 2026-11-26). Closing.

Landed in 8b7c23bc; branch tip d1ebc018 is an ancestor of main (checked by Mars 2026-11-26). Closing.
mars closed this issue 2026-11-26 06:45:52 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha#197
No description provided.