CLI: --as <Agent> from a second session's worktree of the same app runs as that session (Codex2 copies the Codex app's shared --as Codex instructions)

This commit is contained in:
KeelrLeek committed 2026-10-06 10:59:09 -05:00
1 parent fdaa3b0806
commit 9c74b17943
1 file changed
+6
+6
View File
@@ -399,6 +399,12 @@ def main(argv=None):
if not agent:
agent = project.identity_for(os.getcwd())
source = "working directory" if agent else None
else:
# a second session of the same app (Codex2 in the Codex app) copies the app's shared `--as Codex`
# instructions; its working folder says who it is
session = project.session_identity(agent, os.getcwd())
if session != agent:
agent, source = session, f"working directory (same app as {agent})"
recorded = []