Files
coucou/scripts/test-session-registry.sh
ClaudeandTheodoreRiant 5652ea8f9e Several Claude Code sessions on one pill no longer clobber each other
Two claude sessions under the same client (two VS Code projects, two
terminals) share the integration_claude pill. Before, one session's
SessionEnd removed the card and the diffs of the other, its Stop forced
the pill to finished then idle while the other was still working, and
the project name and terminal flipped between the two.

PillSessionRegistry (from #245 by @TheodoreRiant) tracks the live
sessions behind each pill: only the last session can take the card down,
a Stop only finishes the pill when no sibling is mid-turn, the 5.2 s
idle reset is skipped when a new turn started, and the oldest live
session owns the name, folder and terminal shown on the card (they pass
to the next one when it ends). Silent sessions expire (30 min mid-turn,
12 h overall). Rebased on main, with the terminal and client bundle id
also following the owner, and the tests run in CI.

Fixes #429, #18.

Co-Authored-By: TheodoreRiant <57949703+TheodoreRiant@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-11 22:33:04 +02:00

9 lines
338 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-session-registry.XXXXXX")"
trap 'rm -rf "$TEST_DIR"' EXIT
swiftc NotchBuddy/Sources/App/PillSessionRegistry.swift \
tests/PillSessionRegistryTests.swift -o "$TEST_DIR/session-registry-tests"
"$TEST_DIR/session-registry-tests"