feat(scope): implement workspace-scoped session isolation (A-1) and native Herdr session naming (A-5)
This commit is contained in:
@@ -474,6 +474,11 @@ if herdr_confirmed:
|
||||
pm = pane_meta(name, srv)
|
||||
if not pm:
|
||||
continue
|
||||
# A-1 게이트: pane cwd가 현재 workspace_root 하위가 아니면 타 워크스페이스 세션으로 판단하여 오등록 방지
|
||||
pane_cwd_abs = os.path.realpath(pm['cwd']) if pm.get('cwd') else ''
|
||||
ws_root_abs = os.path.realpath(workspace_root)
|
||||
if not pane_cwd_abs or not (pane_cwd_abs == ws_root_abs or pane_cwd_abs.startswith(ws_root_abs + os.sep)):
|
||||
continue
|
||||
if agent == 'claude':
|
||||
cmd_full = 'claude --dangerously-skip-permissions'
|
||||
elif agent == 'agy':
|
||||
@@ -488,11 +493,10 @@ if herdr_confirmed:
|
||||
'status': 'running',
|
||||
'herdr_session_created_at': datetime.fromtimestamp(t['created'], tz=timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ'),
|
||||
'herdr_session_epoch': t['created'],
|
||||
'herdr_server': srv,
|
||||
'herdr_session': srv,
|
||||
'pane': {'index': 0, 'pid': pm['pid'], 'cmd': agent, 'cmd_full': cmd_full, 'cwd': pm['cwd']},
|
||||
# P2: cwd 인용
|
||||
'start_command': f'herdr {server_opt}new-session -d -s "{name}" -x 140 -y 40 -c "{pm["cwd"]}" "{cmd_full}"',
|
||||
'attach_command': f'herdr {server_opt}agent attach {name}',
|
||||
'start_command': f'HERDR_SESSION_NAME={srv} herdr new-session -d -s "{name}" -x 140 -y 40 -c "{pm["cwd"]}" "{cmd_full}"',
|
||||
'attach_command': f'HERDR_SESSION_NAME={srv} herdr agent attach {name}',
|
||||
'kill_command': f'herdr {server_opt}kill-session -t {name}',
|
||||
'last_visible_status': 'running',
|
||||
'last_visible_note': 'auto-registered by monitor',
|
||||
|
||||
Reference in New Issue
Block a user