feat(tmuxx): per-provider login sessions lab-login-<id> with prefix-keyed exclusions (ADR-0034) #82

Merged
dominik.polakovics merged 1 commit from afk/77 into main 2026-07-09 22:52:54 +02:00

Closes #77

What

  • tmuxx.LoginSession (the single fixed lab-login name) is gone. internal/tmuxx now has one prefix const LoginSessionPrefix = "lab-login", a name derivation LoginSessionName(providerID)lab-login-<providerID>, and one predicate IsLoginSession(name) — derivation and predicate share the const, so they cannot drift.
  • Every exclusion site goes through the predicate: cap counting (instance.LiveInstanceCount, LiveInstances), stop-all (instance.StopAll), branch ownership (reconcile.ownedBranches), discard (reconcile.killSessionOnBranch), and the zombie drain (afk.drainZombies). No equality comparison against a login-session constant remains (grep-clean).
  • The claude-code provider derives its session name from its provider id (lab-login-claude-code); no other login-flow behavior changes.
  • The bare legacy lab-login still satisfies the predicate, so a login session left over from an older binary stays excluded.
  • ADR-0034 records the decision (provider-seam grill, 2026-07-09; extends ADR-0026).

Tests

  • New internal/tmuxx/login_test.go: derivation + predicate table tests (legacy name true; lab-loginx/xlab-login false).
  • Two fake providers' login sessions coexist with the legacy name and survive cap counting, StopAll, ownedBranches, Discard, and the zombie drain (extended existing fixtures; no new harnesses).
  • Existing claude-code login-flow tests pass unchanged with the derived name.

Verification

go build ./..., go vet ./..., go test ./... (full suite), gofmt -l clean, and the flake's golangci-lint check (nix build .#checks.x86_64-linux.golangci-lint) all green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M94su7zDQEqezGWFqcqzVs

Closes #77 ## What - `tmuxx.LoginSession` (the single fixed `lab-login` name) is gone. `internal/tmuxx` now has one prefix const `LoginSessionPrefix = "lab-login"`, a name derivation `LoginSessionName(providerID)` → `lab-login-<providerID>`, and one predicate `IsLoginSession(name)` — derivation and predicate share the const, so they cannot drift. - Every exclusion site goes through the predicate: cap counting (`instance.LiveInstanceCount`, `LiveInstances`), stop-all (`instance.StopAll`), branch ownership (`reconcile.ownedBranches`), discard (`reconcile.killSessionOnBranch`), and the zombie drain (`afk.drainZombies`). No equality comparison against a login-session constant remains (grep-clean). - The claude-code provider derives its session name from its provider id (`lab-login-claude-code`); no other login-flow behavior changes. - The bare legacy `lab-login` still satisfies the predicate, so a login session left over from an older binary stays excluded. - ADR-0034 records the decision (provider-seam grill, 2026-07-09; extends ADR-0026). ## Tests - New `internal/tmuxx/login_test.go`: derivation + predicate table tests (legacy name true; `lab-loginx`/`xlab-login` false). - Two fake providers' login sessions coexist with the legacy name and survive cap counting, StopAll, ownedBranches, Discard, and the zombie drain (extended existing fixtures; no new harnesses). - Existing claude-code login-flow tests pass unchanged with the derived name. ## Verification `go build ./...`, `go vet ./...`, `go test ./...` (full suite), `gofmt -l` clean, and the flake's `golangci-lint` check (`nix build .#checks.x86_64-linux.golangci-lint`) all green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01M94su7zDQEqezGWFqcqzVs
feat(tmuxx): per-provider login sessions lab-login-<id> with prefix-keyed exclusions (ADR-0034)
All checks were successful
ci / native (pull_request) Successful in 4m55s
b11b9ed235
Replace the single fixed lab-login tmux session name with per-provider
names derived via tmuxx.LoginSessionName(providerID). Every exclusion
site — cap counting, branch ownership, stop-all, reconcile discard, the
zombie drain — now keys on one predicate, tmuxx.IsLoginSession, a prefix
match on the single LoginSessionPrefix const, so the name derivation and
the predicate cannot drift. The bare legacy lab-login name still
satisfies the predicate, so a login session left by a pre-#77 binary is
not orphaned from the exclusions. claude-code derives its session name
from its provider id; no other login-flow behavior changes.

Tests: predicate/derivation unit tests; two fake providers' login
sessions coexist and survive cap counting, stop-all, ownedBranches,
discard, and the zombie drain, alongside the legacy bare name.

Closes #77

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M94su7zDQEqezGWFqcqzVs
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
Cloonar/coding-lab!82
No description provided.