Several sessions of one app: a session's working folder names its agent when that agent runs in the same app (MCP server and hooks), an i_am tool binds a session explicitly, the doctor checks second sessions against their app's install, and an agent that left the roster can still be uninstalled

This commit is contained in:
KeelrLeek committed 2026-10-06 10:06:01 -05:00
1 parent d755ab8a76
commit e283e4cc54
6 files changed
+63 -5

No files matched your search

+12
View File
@@ -340,6 +340,18 @@ class Projects(unittest.TestCase):
with self.assertRaises(projects.ProjectError):
projects.project_from_dict(bad, home=self.dir)
def test_session_identity_for_two_sessions_of_one_app(self):
made = projects.project_from_dict({
"name": "pair", "identities": {"wt-codex": "Codex", "wt-codex2": "Codex2", "wt-deepseek": "DeepSeek"},
"agents": [{"name": "Codex", "host": "codex"}, {"name": "Codex2", "host": "codex"},
{"name": "DeepSeek", "host": "deepseek"}, {"name": "User", "kind": "human"}]}, home=self.dir)
two = self.dir / "wt-codex2" / "src"
two.mkdir(parents=True)
self.assertEqual(made.session_identity("Codex", two), "Codex2") # same app: the folder decides
self.assertEqual(made.session_identity("Codex", self.dir), "Codex") # no folder match: installed one
self.assertEqual(made.session_identity("DeepSeek", two), "DeepSeek") # another app's folder: ignored
self.assertEqual(made.session_identity(None, two), "Codex2") # nothing pinned: the folder
def test_resolution_order_and_identities(self):
made = make_home(self.dir, names=("first", "second"))
self.assertEqual(projects.resolve(home=self.dir, cwd=self.dir).name, "first") # home default