Skip to content

feat(session): per-session git identity from session name#1

Open
DerekfromMadison wants to merge 1 commit into
masterfrom
feat/per-session-git-identity
Open

feat(session): per-session git identity from session name#1
DerekfromMadison wants to merge 1 commit into
masterfrom
feat/per-session-git-identity

Conversation

@DerekfromMadison

Copy link
Copy Markdown
Owner

What

Each CodeMan session now commits under its own git identity, derived from the session's display name: a session named w1-axon authors commits as w1-axon <w1-axon@codeman.local>.

Why

Running several sessions in parallel, every commit was attributed to the same identity — whatever the repo's local user.name happened to be. Per-session identity makes git log attribution and per-session rollback clean when multiple agents touch the same repo.

How

  • New setGitIdentityEnvVars(muxName, name) in tmux-manager.ts, mirroring the existing setOpenCodeEnvVars (uses tmux setenv, inherited by panes, invisible in ps).
  • Called in createSession (just before respawn-pane) and in updateSessionName.
  • Sets GIT_AUTHOR_* and GIT_COMMITTER_*env vars, because they're the only thing that overrides a repo-local user.name, and they work even when multiple sessions share one working directory (per-directory git config can't tell them apart).

Behavior

  • The tmux session env persists across respawns, so a rename re-stamps the identity and the next (re)spawn — resume / clear / pane respawn — commits under the new name.
  • A currently-running process keeps its spawn-time identity until it respawns — by design.
  • Email is a stable slug: lowercased, runs of non-[a-z0-9._-] collapse to -, e.g. auth analysis becomes auth-analysis@codeman.local.

Verified live

9 concurrent sessions each commit under their own name; a real commit from a session named id is authored id <id@codeman.local>, overriding the repo-local identity. One session caught mid-rename showed its session env updated while the still-running process kept its spawn-time name — exactly as documented above.

Stamp GIT_AUTHOR_* / GIT_COMMITTER_* onto each tmux session's env, derived from the session's display name (slugged to <name>@codeman.local). Every commit a session makes is then attributable to that session and overrides any repo-local user.name — the only thing that works when sessions share a working dir (per-dir git config can't tell them apart; env vars beat all config files).

Mirrors setOpenCodeEnvVars (tmux setenv, inherited by panes, invisible in ps). Called on session create and on rename; the session env persists across respawns, so a rename re-stamps and the next (re)spawn adopts the new name, while a running process keeps its spawn-time identity until it respawns.
DerekfromMadison pushed a commit that referenced this pull request Jun 13, 2026
feat(frontend): inline rename for session names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant