feat(agent): deprecate and completely remove cline agent support
- Delete adapters/cline.py and unregister from registry.py - Remove cline branches from lib.sh and all 8 skill scripts (create, resume, stop, status, reconcile, update_yaml_resumed, resolve_session_id, orc_onboard) - Narrow own-key mapping dictionaries across lib_py core modules to 4 supported agents - Delete cline-exclusive tests and retarget shared fixtures to grok/hermes/claude - Update skills documentation and installation guides (439 passed, 0 failures) - Archive cline deprecation consensus and review reports
This commit is contained in:
+8
-13
@@ -606,18 +606,15 @@ print('\t'.join(env_flags) + '\n' + ' '.join(binary_tokens))
|
||||
*-creator-claude|*-planner-claude|*-reviewer-claude) kind="claude" ;;
|
||||
*-creator-agy|*-planner-agy|*-reviewer-agy) kind="agy" ;;
|
||||
*-creator-hermes|*-planner-hermes|*-reviewer-hermes) kind="hermes" ;;
|
||||
*-creator-cline|*-planner-cline|*-reviewer-cline) kind="cline" ;;
|
||||
*-creator-grok|*-planner-grok|*-reviewer-grok) kind="grok" ;;
|
||||
*)
|
||||
if echo "$name" | grep -qi "agy"; then kind="agy"
|
||||
elif echo "$name" | grep -qi "claude"; then kind="claude"
|
||||
elif echo "$name" | grep -qi "hermes"; then kind="hermes"
|
||||
elif echo "$name" | grep -qi "cline"; then kind="cline"
|
||||
elif echo "$name" | grep -qi "grok"; then kind="grok"
|
||||
elif echo "${final_cmd:-}" | grep -qi "agy"; then kind="agy"
|
||||
elif echo "${final_cmd:-}" | grep -qi "claude"; then kind="claude"
|
||||
elif echo "${final_cmd:-}" | grep -qi "hermes"; then kind="hermes"
|
||||
elif echo "${final_cmd:-}" | grep -qi "cline"; then kind="cline"
|
||||
elif echo "${final_cmd:-}" | grep -qi "grok"; then kind="grok"
|
||||
fi
|
||||
;;
|
||||
@@ -632,7 +629,7 @@ try:
|
||||
tokens = shlex.split(cmd)
|
||||
if tokens:
|
||||
first = tokens[0]
|
||||
if first in ('claude', 'agy', 'hermes', 'cline', 'grok') or any(first.endswith('/' + a) for a in ('claude', 'agy', 'hermes', 'cline', 'grok')) or (kind and (first == kind or first.endswith('/' + kind))):
|
||||
if first in ('claude', 'agy', 'hermes', 'grok') or any(first.endswith('/' + a) for a in ('claude', 'agy', 'hermes', 'grok')) or (kind and (first == kind or first.endswith('/' + kind))):
|
||||
tokens = tokens[1:]
|
||||
print(' '.join(shlex.quote(t) for t in tokens))
|
||||
except Exception:
|
||||
@@ -1660,7 +1657,7 @@ capture_conversation_id() {
|
||||
# Config-home isolation (.mam/agent_homes/<uuid>/) and legacy isolation.root
|
||||
# row consumers were completely deprecated and removed in favor of:
|
||||
# 1. Universal Global Config: all agents read/write standard ~/.claude, ~/.gemini,
|
||||
# ~/.hermes, ~/.cline user configuration and credential stores.
|
||||
# ~/.hermes user configuration and credential stores.
|
||||
# 2. Process Isolation: each agent-workspace pair runs in its own herdr pane.
|
||||
# 3. Conversation Isolation: session UUIDs discriminate conversation history.
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -2061,7 +2058,6 @@ send_keys_safe() {
|
||||
*-claude|*-claude-[0-9]*|claude|claude-[0-9]*) _sks_agent="claude" ;;
|
||||
*-agy|*-agy-[0-9]*|agy|agy-[0-9]*) _sks_agent="agy" ;;
|
||||
*-hermes|*-hermes-[0-9]*|hermes|hermes-[0-9]*) _sks_agent="hermes" ;;
|
||||
*-cline|*-cline-[0-9]*|cline|cline-[0-9]*) _sks_agent="cline" ;;
|
||||
*-grok|*-grok-[0-9]*|grok|grok-[0-9]*) _sks_agent="grok" ;;
|
||||
esac
|
||||
if [ -n "$_sks_agent" ]; then
|
||||
@@ -2105,12 +2101,11 @@ send_keys_safe() {
|
||||
# multi-byte UTF-8 char, e.g. Korean, producing a marker that can never match
|
||||
# the properly-decoded rendered pane text) of the last non-empty line.
|
||||
marker=$(printf '%s' "$text" | tr -d '\r' | awk 'NF {line=$0} END {print line}' | python3 -c "import sys; print(sys.stdin.read().rstrip('\n')[-24:], end='')")
|
||||
# Whitespace-normalized copy for matching: some TUIs (e.g. cline's own
|
||||
# message rendering) don't just soft-wrap with a bare newline — they add a
|
||||
# leading-space "hanging indent" on the continuation line too, so removing
|
||||
# only '\n' still leaves an extra space that breaks an exact literal match.
|
||||
# Matching with all whitespace collapsed out sidesteps wrap formatting
|
||||
# entirely, whatever shape it takes.
|
||||
# Whitespace-normalized copy for matching: some TUIs don't just soft-wrap
|
||||
# with a bare newline — they add a leading-space "hanging indent" on the
|
||||
# continuation line too, so removing only '\n' still leaves an extra space
|
||||
# that breaks an exact literal match. Matching with all whitespace collapsed
|
||||
# out sidesteps wrap formatting entirely, whatever shape it takes.
|
||||
marker_norm=$(printf '%s' "$marker" | tr -d '[:space:]')
|
||||
|
||||
local sks_buf="sks_${sess}_${job_id}_$$_${RANDOM}_$(date +%s%N 2>/dev/null || date +%s)"
|
||||
@@ -2123,7 +2118,7 @@ send_keys_safe() {
|
||||
return 3
|
||||
fi
|
||||
local was_popup=0
|
||||
if [[ "$sess" =~ "cline" ]] || [[ "$sess" =~ "claude" ]] || [[ "$sess" =~ "agy" ]] || [[ "$sess" =~ "grok" ]]; then
|
||||
if [[ "$sess" =~ "claude" ]] || [[ "$sess" =~ "agy" ]] || [[ "$sess" =~ "grok" ]]; then
|
||||
# Skip strict paste check due to scrollout false-positives, proceed to C-m submission loop
|
||||
true
|
||||
else
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
import os, json, shutil, glob
|
||||
from typing import Optional, Any
|
||||
from lib_py.agents.base import BaseAgentAdapter, DiscoveryContext
|
||||
from lib_py.verify_session import workspace_key
|
||||
|
||||
class ClineAgentAdapter(BaseAgentAdapter):
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return 'cline'
|
||||
|
||||
@property
|
||||
def own_key(self) -> str:
|
||||
return 'cline_conversation_id_own'
|
||||
|
||||
@property
|
||||
def ready_tokens(self) -> str:
|
||||
return 'Cline|history|Chat|What can I do|slash commands'
|
||||
|
||||
@property
|
||||
def strong_ready_tokens(self) -> str:
|
||||
return 'Cline|What can I do|slash commands'
|
||||
|
||||
@property
|
||||
def weak_ready_tokens(self) -> str:
|
||||
return 'history|Chat'
|
||||
|
||||
@property
|
||||
def modal_tokens(self) -> Optional[str]:
|
||||
return 'Select API Provider|Enter API Key|Select an API provider|API Provider|Cline API key'
|
||||
|
||||
@property
|
||||
def exit_key(self) -> str:
|
||||
return '/exit'
|
||||
|
||||
@property
|
||||
def delegate_agent_key(self) -> str:
|
||||
return 'cline-agent'
|
||||
|
||||
@property
|
||||
def identity_cache_fields(self) -> tuple:
|
||||
return ('session_id',)
|
||||
|
||||
@property
|
||||
def input_prompt(self) -> str:
|
||||
return '❯'
|
||||
|
||||
@property
|
||||
def input_placeholder(self) -> str:
|
||||
return 'Ask anything...'
|
||||
|
||||
@property
|
||||
def input_rule_pattern(self) -> str:
|
||||
return '─{10,}'
|
||||
|
||||
def artifact_path(self, uuid: str, ctx: DiscoveryContext) -> str:
|
||||
return f"{ctx.home_dir}/.cline/data/sessions/{uuid}/{uuid}.json"
|
||||
|
||||
def verify_artifact(self, uuid: str, ctx: DiscoveryContext) -> bool:
|
||||
path = self.artifact_path(uuid, ctx)
|
||||
if not os.path.exists(path):
|
||||
return False
|
||||
if ctx.epoch and os.path.getmtime(path) < ctx.epoch:
|
||||
return False
|
||||
try:
|
||||
with open(path) as f:
|
||||
sdata = json.load(f)
|
||||
if sdata.get("session_id") != uuid:
|
||||
return False
|
||||
found_cwd = sdata.get("cwd") or sdata.get("workspace_root")
|
||||
if found_cwd and workspace_key(found_cwd) != workspace_key(ctx.cwd):
|
||||
return False
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
|
||||
def purge_artifacts(self, uuid: str, ctx: DiscoveryContext) -> list:
|
||||
purged = []
|
||||
sessions_dir = f"{ctx.home_dir}/.cline/data/sessions/{uuid}"
|
||||
if os.path.isdir(sessions_dir):
|
||||
shutil.rmtree(sessions_dir)
|
||||
purged.append(sessions_dir)
|
||||
return purged
|
||||
|
||||
def spawn_spec(self, binary: str, session_uuid: str = "", use_wrapper: bool = False) -> str:
|
||||
return f"{binary} -i"
|
||||
|
||||
def resume_spec(self, binary: str, session_uuid: str, materialized: bool = False) -> str:
|
||||
if materialized and session_uuid:
|
||||
return f"{binary} -i --id {session_uuid}"
|
||||
return f"{binary} -i"
|
||||
|
||||
def auth_ok(self, run_cmd: Optional[Any] = None) -> bool:
|
||||
return True
|
||||
|
||||
def discover(self, ctx: DiscoveryContext) -> list:
|
||||
sessions_dir = f"{ctx.home_dir}/.cline/data/sessions"
|
||||
if os.path.isdir(sessions_dir):
|
||||
files = []
|
||||
for folder in glob.glob(f"{sessions_dir}/*"):
|
||||
if os.path.isdir(folder):
|
||||
fn = os.path.basename(folder)
|
||||
jf = f"{folder}/{fn}.json"
|
||||
if os.path.exists(jf):
|
||||
files.append(jf)
|
||||
files.sort(key=os.path.getmtime, reverse=True)
|
||||
candidates = []
|
||||
for j in files:
|
||||
cand = os.path.basename(j)[:-5]
|
||||
if cand and self.verify_artifact(cand, ctx):
|
||||
candidates.append(cand)
|
||||
return candidates
|
||||
return []
|
||||
@@ -5,14 +5,12 @@ from lib_py.agents.base import BaseAgentAdapter
|
||||
from lib_py.agents.adapters.claude import ClaudeAgentAdapter
|
||||
from lib_py.agents.adapters.agy import AgyAgentAdapter
|
||||
from lib_py.agents.adapters.hermes import HermesAgentAdapter
|
||||
from lib_py.agents.adapters.cline import ClineAgentAdapter
|
||||
from lib_py.agents.adapters.grok import GrokAgentAdapter
|
||||
|
||||
_ADAPTERS: Dict[str, BaseAgentAdapter] = {
|
||||
'claude': ClaudeAgentAdapter(),
|
||||
'agy': AgyAgentAdapter(),
|
||||
'hermes': HermesAgentAdapter(),
|
||||
'cline': ClineAgentAdapter(),
|
||||
'grok': GrokAgentAdapter(),
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ def atomic_dump_yaml_main():
|
||||
if name in old_roles and s.get('role') != old_roles[name]:
|
||||
raise SystemExit(f"VALIDATE: role of session {name!r} cannot be modified from {old_roles[name]!r} to {s.get('role')!r}")
|
||||
|
||||
running_keys = ['claude_session_id_own', 'agy_conversation_id_own', 'hermes_conversation_id_own', 'cline_conversation_id_own', 'grok_session_id_own']
|
||||
running_keys = ['claude_session_id_own', 'agy_conversation_id_own', 'hermes_conversation_id_own', 'grok_session_id_own']
|
||||
id_to_session = {}
|
||||
for s in d.get('herdr_sessions', []):
|
||||
if s.get('status') == 'running':
|
||||
|
||||
@@ -66,7 +66,7 @@ def mam_orchestrator_uuids():
|
||||
def mam_row_own_uuid(row):
|
||||
if not isinstance(row, dict):
|
||||
return None
|
||||
for k in ["claude_session_id_own", "agy_conversation_id_own", "hermes_conversation_id_own", "cline_conversation_id_own", "grok_session_id_own"]:
|
||||
for k in ["claude_session_id_own", "agy_conversation_id_own", "hermes_conversation_id_own", "grok_session_id_own"]:
|
||||
v = row.get(k)
|
||||
if v:
|
||||
return v
|
||||
|
||||
@@ -8,7 +8,6 @@ OWN_KEY = {
|
||||
'claude': 'claude_session_id_own',
|
||||
'agy': 'agy_conversation_id_own',
|
||||
'hermes': 'hermes_conversation_id_own',
|
||||
'cline': 'cline_conversation_id_own',
|
||||
'grok': 'grok_session_id_own'
|
||||
}
|
||||
|
||||
@@ -31,7 +30,7 @@ def find_workspace_uuid_main():
|
||||
if s_item.get('status') == 'running':
|
||||
if target and s_item.get('name') == target:
|
||||
continue
|
||||
for k in ['claude_session_id_own', 'agy_conversation_id_own', 'hermes_conversation_id_own', 'cline_conversation_id_own', 'grok_session_id_own']:
|
||||
for k in ['claude_session_id_own', 'agy_conversation_id_own', 'hermes_conversation_id_own', 'grok_session_id_own']:
|
||||
val = s_item.get(k)
|
||||
if val:
|
||||
running_ids.add(val)
|
||||
|
||||
@@ -129,7 +129,7 @@ herdr_sessions:
|
||||
|
||||
```bash
|
||||
WORKSPACE=/path/to/project
|
||||
AGENT=claude # claude | agy | hermes | cline | grok — always pass it explicitly
|
||||
AGENT=claude # claude | agy | hermes | grok — always pass it explicitly
|
||||
source .agents/skills/lib.sh
|
||||
SESSION_NAME="$(derive_session_name "$WORKSPACE" "$AGENT")"
|
||||
|
||||
@@ -160,7 +160,7 @@ case "$AGENT" in
|
||||
grok)
|
||||
herdr new-session -d -s "$SESSION_NAME" -x 140 -y 40 -c "$WORKSPACE" "grok --permission-mode bypassPermissions"
|
||||
;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes, cline or grok, got: $AGENT"; exit 2 ;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes, or grok, got: $AGENT"; exit 2 ;;
|
||||
esac
|
||||
|
||||
# 3. Wait for agent TUI to be ready (varies: claude ~5s, agy ~3s)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# create_session.sh — multi-agent-mux-create 의 부속 스크립트
|
||||
# Usage:
|
||||
# bash create_session.sh --workspace <path> --agent <claude|agy|hermes|cline> --role <role> [--session <name>] [--herdr-session <name>] [--wrapper]
|
||||
# bash create_session.sh --workspace <path> --agent <claude|agy|hermes|grok> --role <role> [--session <name>] [--herdr-session <name>] [--wrapper]
|
||||
#
|
||||
# 동작:
|
||||
# 1) preflight: herdr/claude/agy 가용성, workspace 존재
|
||||
@@ -26,11 +26,11 @@ source "$_lib_sh"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 --workspace <path> --agent <claude|agy|hermes|cline> --role <role> [options]
|
||||
Usage: $0 --workspace <path> --agent <claude|agy|hermes|grok> --role <role> [options]
|
||||
|
||||
Options:
|
||||
--workspace PATH project directory (required)
|
||||
--agent AGENT claude | agy | hermes | cline (required)
|
||||
--agent AGENT claude | agy | hermes | grok (required)
|
||||
--role ROLE assigned role (required)
|
||||
--session NAME herdr session name (default: derived from workspace)
|
||||
--wrapper force use of ~/.local/bin/<session> wrapper even if not present
|
||||
@@ -90,8 +90,8 @@ fi
|
||||
[ -n "$WORKSPACE" ] || { echo "ERROR: --workspace required" >&2; usage; exit 2; }
|
||||
[ -n "$AGENT" ] || { echo "ERROR: --agent required" >&2; usage; exit 2; }
|
||||
case "$AGENT" in
|
||||
claude|agy|hermes|cline|grok) ;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes, cline or grok, got: $AGENT" >&2; exit 2 ;;
|
||||
claude|agy|hermes|grok) ;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes or grok, got: $AGENT" >&2; exit 2 ;;
|
||||
esac
|
||||
[ -n "$ROLE" ] || { echo "ERROR: --role required" >&2; usage; exit 2; }
|
||||
[ -d "$WORKSPACE" ] || { echo "ERROR: workspace $WORKSPACE not a directory" >&2; exit 1; }
|
||||
@@ -119,11 +119,6 @@ elif [ "$AGENT" = "hermes" ]; then
|
||||
echo "ERROR: hermes is not functional. Run 'hermes setup' first." >&2
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$AGENT" = "cline" ]; then
|
||||
if ! cline history --json >/dev/null 2>&1; then
|
||||
echo "ERROR: cline is not functional or configured." >&2
|
||||
exit 1
|
||||
fi
|
||||
elif [ "$AGENT" = "grok" ]; then
|
||||
if [ -f "$HOME/.grok/auth.json" ] || [ -n "$XAI_API_KEY" ]; then
|
||||
true
|
||||
@@ -186,7 +181,6 @@ if [ -z "$CMD_FULL" ]; then
|
||||
claude) CMD_FULL="${RESOLVED_BIN} --dangerously-skip-permissions --session-id ${SESSION_UUID}" ;;
|
||||
agy) CMD_FULL="${RESOLVED_BIN} --dangerously-skip-permissions" ;;
|
||||
hermes) CMD_FULL="${RESOLVED_BIN} --yolo --accept-hooks" ;;
|
||||
cline) CMD_FULL="${RESOLVED_BIN} -i" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -207,10 +201,10 @@ spawn() {
|
||||
HERDR_SESSION_NAME="$HERDR_SESSION_NAME" _herdr new-session -d -s "$SESSION_NAME" -x 140 -y 40 -c "$WORKSPACE" "$CMD_FULL"
|
||||
fi
|
||||
;;
|
||||
agy|hermes|cline|grok)
|
||||
agy|hermes|grok)
|
||||
HERDR_SESSION_NAME="$HERDR_SESSION_NAME" _herdr new-session -d -s "$SESSION_NAME" -x 140 -y 40 -c "$WORKSPACE" "$CMD_FULL"
|
||||
;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes, cline or grok, got: $AGENT" >&2; exit 2 ;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes or grok, got: $AGENT" >&2; exit 2 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -316,7 +310,6 @@ if [ -n "$SUBMIT_JOB_PROMPT" ]; then
|
||||
case "$AGENT" in
|
||||
claude) delegate_agent="claude-code" ;;
|
||||
hermes) delegate_agent="hermes-agent" ;;
|
||||
cline) delegate_agent="cline-agent" ;;
|
||||
agy) delegate_agent="antigravity-cli" ;;
|
||||
grok) delegate_agent="grok-build" ;;
|
||||
*) echo "ERROR: cannot resolve delegate agent key for '$AGENT'" >&2; exit 2 ;;
|
||||
@@ -336,7 +329,7 @@ fi
|
||||
# 모든 값은 환경변수로 전달 — heredoc interpolation 없음 (P1-B).
|
||||
# 자식 pid 는 bash 에서 pgrep 으로 미리 구함 (P2: 도구명 필터).
|
||||
CHILD_PID=0
|
||||
if { [ "$AGENT" = "agy" ] || [ "$AGENT" = "hermes" ] || [ "$AGENT" = "cline" ]; } && [ -n "$PANE_PID" ]; then
|
||||
if { [ "$AGENT" = "agy" ] || [ "$AGENT" = "hermes" ]; } && [ -n "$PANE_PID" ]; then
|
||||
CHILD_PID=$(pgrep -P "$PANE_PID" -x "$AGENT" 2>/dev/null | head -1 || true)
|
||||
CHILD_PID="${CHILD_PID:-0}"
|
||||
fi
|
||||
@@ -420,11 +413,6 @@ elif agent == 'hermes':
|
||||
entry['child_pid'] = int(cp) if cp.isdigit() else 0
|
||||
entry['hermes_conversation_id_own'] = None
|
||||
entry['last_visible_status'] = "unverified"
|
||||
elif agent == 'cline':
|
||||
cp = os.environ.get('CHILD_PID', '0')
|
||||
entry['child_pid'] = int(cp) if cp.isdigit() else 0
|
||||
entry['cline_conversation_id_own'] = None
|
||||
entry['last_visible_status'] = "unverified"
|
||||
elif agent == 'grok':
|
||||
assigned = os.environ.get('SESSION_UUID', '') or None
|
||||
entry['grok_session_id_own'] = assigned
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# multi-agent-mux-delegate-job 스킬
|
||||
|
||||
작업(Job)을 자율 에이전트(claude-code/hermes/agy/cline/codex/opencode/human)에게 위임하고 MQTT
|
||||
작업(Job)을 자율 에이전트(claude-code/hermes/agy/grok-build/codex/opencode/human)에게 위임하고 MQTT
|
||||
이벤트 채널로 비동기 관찰하는 범용 에이전트 협업 스킬. **시작점은 [`SKILL.md`](./SKILL.md).**
|
||||
|
||||
- 프로토콜/스키마: [`job-protocol.md`](./job-protocol.md)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: multi-agent-mux-delegate-job
|
||||
description: "Delegate a unit of work to any autonomous agent (claude-code, hermes, agy, cline, grok-build, codex, or a human) and observe it asynchronously over an MQTT event channel. Supported roles include orchestrator, worker, and reviewer."
|
||||
description: "Delegate a unit of work to any autonomous agent (claude-code, hermes, agy, grok-build, codex, or a human) and observe it asynchronously over an MQTT event channel. Supported roles include orchestrator, worker, and reviewer."
|
||||
version: 3.1.0
|
||||
author: godopu
|
||||
license: MIT
|
||||
@@ -17,7 +17,7 @@ metadata:
|
||||
|
||||
Delegate a unit of work to any autonomous agent, then **observe** it asynchronously instead of blocking. Every job gets a unique ID and a registry record. The worker agent publishes lifecycle events (`started`, `permission_required`, `progress`, `completed`, `error`) to a per-job MQTT topic, and the delegator/orchestrator subscribes to verify the final state.
|
||||
|
||||
This skill allows any agent (`claude-code`, `hermes`, `agy`, `cline`, `grok-build`, etc.) to play any role: **Orchestrator/Delegator**, **Worker/Implementer**, or **Reviewer**.
|
||||
This skill allows any agent (`claude-code`, `hermes`, `agy`, `grok-build`, etc.) to play any role: **Orchestrator/Delegator**, **Worker/Implementer**, or **Reviewer**.
|
||||
|
||||
---
|
||||
|
||||
@@ -36,7 +36,7 @@ The `multi-agent-mux-delegate-job` bash wrapper handles job registration, subscr
|
||||
```bash
|
||||
# 1) Submit a new job to a targeted agent session (e.g. herdr session name 'demo')
|
||||
multi-agent-mux-delegate-job submit \
|
||||
--agent <claude-code|hermes-agent|agy-agent|cline-agent|grok-build|human> \
|
||||
--agent <claude-code|hermes-agent|agy-agent|grok-build|human> \
|
||||
--agent-session herdr:<session_name> \
|
||||
--prompt "Task description or instructions here" \
|
||||
--role <Worker|Planner|Reviewer> \
|
||||
|
||||
@@ -289,7 +289,7 @@ print(','.join(reviewers))
|
||||
"
|
||||
}
|
||||
|
||||
# Resolve target agent type (claude, cline, agy) via load_state_json.
|
||||
# Resolve target agent type (claude, hermes, agy) via load_state_json.
|
||||
resolve_agent_type() {
|
||||
local name="$1"
|
||||
NAME="$name" MAM_STATE_JSON="$(load_state_json)" python3 -c "
|
||||
@@ -307,8 +307,6 @@ if not agent:
|
||||
segments = name.split('-')
|
||||
if 'agy' in segments:
|
||||
agent = 'agy'
|
||||
elif 'cline' in segments:
|
||||
agent = 'cline'
|
||||
elif 'hermes' in segments:
|
||||
agent = 'hermes'
|
||||
else:
|
||||
|
||||
@@ -467,7 +467,7 @@ def _pin_and_verify_resume(s, agent, cwd, uuid, degraded=False):
|
||||
else:
|
||||
s['last_visible_status'] = f"resume dry-run failed: {res.stderr.strip() or res.stdout.strip()}"
|
||||
|
||||
id_name = 'session' if agent in ('claude', 'cline') else 'conversation'
|
||||
id_name = 'session' if agent == 'claude' else 'conversation'
|
||||
if not degraded:
|
||||
drifts.append({'class': 'C', 'name': s['name'], 'msg': f"{s['name']}: {id_name} id materialized: {uuid}"})
|
||||
else:
|
||||
@@ -518,7 +518,7 @@ if herdr_confirmed:
|
||||
agent = None
|
||||
role = 'creator'
|
||||
for r_name in ('creator', 'planner', 'reviewer'):
|
||||
for a_name in ('claude', 'agy', 'hermes', 'cline', 'grok'):
|
||||
for a_name in ('claude', 'agy', 'hermes', 'grok'):
|
||||
if name.endswith(f"-{r_name}-{a_name}"):
|
||||
role = r_name
|
||||
agent = a_name
|
||||
@@ -537,7 +537,7 @@ if herdr_confirmed:
|
||||
if tok.startswith('MAM_MANAGED='):
|
||||
managed_path = tok.split('=', 1)[1]
|
||||
if os.path.realpath(managed_path) == os.path.realpath(workspace_root):
|
||||
for a_name in ('claude', 'agy', 'hermes', 'cline', 'grok'):
|
||||
for a_name in ('claude', 'agy', 'hermes', 'grok'):
|
||||
if a_name in pm_check.get('cmd', '') or a_name in pm_check.get('cmd_full', ''):
|
||||
agent = a_name
|
||||
break
|
||||
@@ -598,9 +598,6 @@ if herdr_confirmed:
|
||||
elif agent == 'hermes':
|
||||
entry['child_pid'] = 0
|
||||
entry['hermes_conversation_id_own'] = None
|
||||
elif agent == 'cline':
|
||||
entry['child_pid'] = 0
|
||||
entry['cline_conversation_id_own'] = None
|
||||
d.setdefault('herdr_sessions', []).append(entry)
|
||||
yaml_session_names.add(name)
|
||||
drifts.append({'class': 'B', 'name': name,
|
||||
@@ -611,7 +608,7 @@ def row_agent(s):
|
||||
return agent_of_row(s)
|
||||
|
||||
OWN_KEY_BY_AGENT = {
|
||||
a: _get_own_key(a) for a in ('claude', 'agy', 'hermes', 'cline', 'grok')
|
||||
a: _get_own_key(a) for a in ('claude', 'agy', 'hermes', 'grok')
|
||||
}
|
||||
|
||||
# === drift C0: 지정된 ID 는 발견이 아니라 '확인'만 필요하다 ===
|
||||
@@ -782,51 +779,6 @@ for s in d.get('herdr_sessions', []):
|
||||
else:
|
||||
_pin_and_verify_resume(s, 'hermes', cwd, uuid, degraded=True)
|
||||
|
||||
# === drift C (cline): cline 새 session id materialize (per-row own id) ===
|
||||
for s in d.get('herdr_sessions', []):
|
||||
if row_agent(s) != 'cline':
|
||||
continue
|
||||
if s.get('status') != 'running':
|
||||
continue
|
||||
if s.get('cline_conversation_id_own'):
|
||||
continue
|
||||
cwd = (s.get('pane') or {}).get('cwd', '')
|
||||
if not cwd:
|
||||
continue
|
||||
sessions_dir = f"{home}/.cline/data/sessions"
|
||||
if not os.path.isdir(sessions_dir):
|
||||
continue
|
||||
candidates = []
|
||||
for session_folder in glob.glob(f"{sessions_dir}/*"):
|
||||
if os.path.isdir(session_folder):
|
||||
folder_name = os.path.basename(session_folder)
|
||||
json_file = f"{session_folder}/{folder_name}.json"
|
||||
if os.path.exists(json_file):
|
||||
candidates.append(json_file)
|
||||
candidates.sort(key=os.path.getmtime, reverse=True)
|
||||
|
||||
valid_candidates = []
|
||||
for j in candidates:
|
||||
uuid = os.path.basename(j)[:-5]
|
||||
if verify_session_uuid(cwd, 'cline', uuid, s, mode="discover"):
|
||||
valid_candidates.append(uuid)
|
||||
|
||||
if len(valid_candidates) > 1:
|
||||
drifts.append({'class': 'C-ambiguous', 'name': s['name'],
|
||||
'msg': f"{s['name']}: {len(valid_candidates)} candidate transcripts newer than session epoch; not pinning"})
|
||||
s['last_visible_status'] = f"ambiguous: {len(valid_candidates)} candidates"
|
||||
actions.append(f"ambiguous candidates: {s['name']}")
|
||||
if len(valid_candidates) == 1:
|
||||
uuid = valid_candidates[0]
|
||||
cmd = ['bash', '-c', f'source "{lib_sh}" && verify_tui_viewport "{s["name"]}" "cline" "{cwd}"']
|
||||
rc = subprocess.run(cmd).returncode
|
||||
if rc == 0:
|
||||
_pin_and_verify_resume(s, 'cline', cwd, uuid, degraded=False)
|
||||
elif rc == 1:
|
||||
drifts.append({'class': 'C-warn', 'name': s['name'], 'msg': f"{s['name']}: TUI viewport mismatch for candidate {uuid} — not pinned, will retry next cycle"})
|
||||
else:
|
||||
_pin_and_verify_resume(s, 'cline', cwd, uuid, degraded=True)
|
||||
|
||||
result = {
|
||||
'timestamp': now_iso,
|
||||
'yaml_path': yaml_path,
|
||||
|
||||
@@ -8,7 +8,7 @@ platforms: [linux, macos]
|
||||
environments: [terminal, herdr]
|
||||
metadata:
|
||||
hermes:
|
||||
tags: [agent, herdr, claude, antigravity, agy, cline, hermes, grok, orchestrator, onboard, isolation]
|
||||
tags: [agent, herdr, claude, antigravity, agy, hermes, grok, orchestrator, onboard, isolation]
|
||||
related_skills: [multi-agent-mux-create, multi-agent-mux-resume, multi-agent-mux-monitor]
|
||||
prereq_skills: [multi-agent-mux-create]
|
||||
---
|
||||
@@ -24,7 +24,7 @@ Registers an orchestrator session UUID into the `orchestrator_uuids` list of `.m
|
||||
```
|
||||
|
||||
### Options
|
||||
- `--uuid <uuid>`: Explicitly register the specified orchestrator session UUID (UUID format or cline ID format).
|
||||
- `--uuid <uuid>`: Explicitly register the specified orchestrator session UUID.
|
||||
- `--remove <uuid>`: Remove the specified UUID from the `orchestrator_uuids` list.
|
||||
- `--list`: Display all currently registered orchestrator UUIDs.
|
||||
- `--no-autodetect`: Disable process ancestry auto-detection when `--uuid` is not provided.
|
||||
@@ -32,18 +32,16 @@ Registers an orchestrator session UUID into the `orchestrator_uuids` list of `.m
|
||||
|
||||
## Auto-Detection Hierarchy (Rev.2)
|
||||
|
||||
When `--uuid` is omitted, `orc_onboard.sh` inspects the process ancestry tree of the nearest agent ancestor (`claude`, `agy`, `hermes`, `cline`, `grok`) in the following order:
|
||||
When `--uuid` is omitted, `orc_onboard.sh` inspects the process ancestry tree of the nearest agent ancestor (`claude`, `agy`, `hermes`, `grok`) in the following order:
|
||||
|
||||
1. **CLI `argv`**:
|
||||
- `claude -r <uuid>` / `claude --session-id <uuid>`
|
||||
- `agy --conversation <uuid>`
|
||||
- `cline --id <uuid>` / `cline --session-id <uuid>`
|
||||
- `grok --session-id <uuid>` / `grok --resume <uuid>`
|
||||
2. **Family-Matched Environment Variables**:
|
||||
- `claude` → `CLAUDE_CODE_SESSION_ID`
|
||||
- `agy` → `ANTIGRAVITY_CONVERSATION_ID`
|
||||
- `hermes` → `HERMES_SESSION_ID`
|
||||
- `cline` → `CLINE_SESSION_ID`
|
||||
- `grok` → `GROK_SESSION_ID`
|
||||
3. **Fallback**:
|
||||
- If no valid ID matching the nearest agent family is found, exits with status 3 (`Could not detect orchestrator ID`).
|
||||
|
||||
@@ -66,8 +66,7 @@ done
|
||||
is_valid_id() {
|
||||
local val="$1"
|
||||
local uuid_re='^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
|
||||
local cline_re='^[0-9]{10,}_[0-9A-Za-z]+$'
|
||||
if [[ "$val" =~ $uuid_re ]] || [[ "$val" =~ $cline_re ]]; then
|
||||
if [[ "$val" =~ $uuid_re ]]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
@@ -104,7 +103,7 @@ detect_nearest_agent() {
|
||||
local base
|
||||
base="$(basename "$tok")"
|
||||
case "$base" in
|
||||
claude|agy|hermes|cline|grok)
|
||||
claude|agy|hermes|grok)
|
||||
match="$base"
|
||||
break
|
||||
;;
|
||||
@@ -125,9 +124,6 @@ detect_nearest_agent() {
|
||||
hermes)
|
||||
detected_id=$(echo "$cmd_line" | grep -oE '(--resume|--session)[[:space:]=]+[^[:space:]]+' | head -n 1 | sed -E 's/^(--resume|--session)[[:space:]=]+//' || true)
|
||||
;;
|
||||
cline)
|
||||
detected_id=$(echo "$cmd_line" | grep -oE '(--id|--session-id)[[:space:]=]+[^[:space:]]+' | head -n 1 | sed -E 's/^(--id|--session-id)[[:space:]=]+//' || true)
|
||||
;;
|
||||
grok)
|
||||
detected_id=$(echo "$cmd_line" | grep -oE '(--session-id|--resume)[[:space:]=]+[^[:space:]]+' | head -n 1 | sed -E 's/^(--session-id|--resume)[[:space:]=]+//' || true)
|
||||
;;
|
||||
@@ -144,7 +140,6 @@ detect_nearest_agent() {
|
||||
claude) env_var="${CLAUDE_CODE_SESSION_ID:-}" ;;
|
||||
agy) env_var="${ANTIGRAVITY_CONVERSATION_ID:-}" ;;
|
||||
hermes) env_var="${HERMES_SESSION_ID:-}" ;;
|
||||
cline) env_var="${CLINE_SESSION_ID:-}" ;;
|
||||
grok) env_var="${GROK_SESSION_ID:-}" ;;
|
||||
esac
|
||||
|
||||
@@ -206,7 +201,7 @@ except Exception:
|
||||
target = sys.argv[1]
|
||||
for s in d.get("herdr_sessions", []):
|
||||
if s.get("status") == "running":
|
||||
for k in ["claude_session_id_own", "agy_conversation_id_own", "hermes_conversation_id_own", "cline_conversation_id_own", "grok_session_id_own"]:
|
||||
for k in ["claude_session_id_own", "agy_conversation_id_own", "hermes_conversation_id_own", "grok_session_id_own"]:
|
||||
if s.get(k) == target:
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
||||
|
||||
@@ -49,7 +49,7 @@ ideal resume path:
|
||||
|
||||
`agent-sessions.yaml` and on-disk discovery are used to resolve the UUID in this order:
|
||||
|
||||
1. **`herdr_sessions[]` row's per-row own id** (`claude_session_id_own` / `agy_conversation_id_own` / `hermes_conversation_id_own` / `cline_conversation_id_own` / `grok_session_id_own`) — explicitly saved by `multi-agent-mux-stop` right before teardown (tier-1, race-free).
|
||||
1. **`herdr_sessions[]` row's per-row own id** (`claude_session_id_own` / `agy_conversation_id_own` / `hermes_conversation_id_own` / `grok_session_id_own`) — explicitly saved by `multi-agent-mux-stop` right before teardown (tier-1, race-free).
|
||||
2. **Workspace-scoped on-disk scan** (adapter `discover()`)
|
||||
|
||||
If both are empty → the workspace has no conversation yet. Fall back to `multi-agent-mux-create`.
|
||||
@@ -58,7 +58,7 @@ If both are empty → the workspace has no conversation yet. Fall back to `multi
|
||||
|
||||
```bash
|
||||
WORKSPACE=/path/to/project
|
||||
AGENT=claude # claude | agy | hermes | cline | grok — pass it explicitly
|
||||
AGENT=claude # claude | agy | hermes | grok — pass it explicitly
|
||||
SESSION_NAME=<workspace>-creator-<agent> # same convention as multi-agent-mux-create
|
||||
|
||||
# Resolve the isolated herdr server name & load common utils
|
||||
@@ -88,7 +88,6 @@ case "$AGENT" in
|
||||
claude) CMD_FULL="claude --dangerously-skip-permissions $CLAUDE_ID_FLAG $UUID" ;;
|
||||
agy) CMD_FULL="agy --dangerously-skip-permissions --conversation $UUID" ;;
|
||||
hermes) CMD_FULL="hermes --resume $UUID --no-restore-cwd --yolo --accept-hooks" ;;
|
||||
cline) CMD_FULL="cline -i --id $UUID" ;;
|
||||
grok) CMD_FULL="grok --resume $UUID --permission-mode bypassPermissions" ;;
|
||||
esac
|
||||
|
||||
@@ -100,7 +99,7 @@ case "$AGENT" in
|
||||
# auto-handle trust / bypass dialogs
|
||||
handle_startup_dialogs "$SESSION_NAME" 20
|
||||
;;
|
||||
agy|hermes|cline|grok)
|
||||
agy|hermes|grok)
|
||||
eval "herdr new-session -d -s \"$SESSION_NAME\" -x 140 -y 40 -c \"$WORKSPACE\" \"$CMD_FULL\""
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# resolve_session_id.sh — multi-agent-mux-resume 의 부속 스크립트
|
||||
# Usage:
|
||||
# bash resolve_session_id.sh --workspace <path> --agent <claude|agy|hermes|cline>
|
||||
# bash resolve_session_id.sh --workspace <path> --agent <claude|agy|hermes|grok>
|
||||
# 출력: stdout 으로 UUID 한 줄 (없으면 빈 줄 + exit 0)
|
||||
#
|
||||
# P0-C: 전역 agent_identities 를 즉시 반환하지 않는다. lib.sh::find_workspace_uuid
|
||||
@@ -13,7 +13,7 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/lib.sh"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 --workspace <path> --agent <claude|agy|hermes|cline> [--session <name>]
|
||||
Usage: $0 --workspace <path> --agent <claude|agy|hermes|grok> [--session <name>]
|
||||
Outputs the resolved UUID on stdout (empty if not found).
|
||||
--session prefers that registry row's recorded id; falls back to workspace-wide discovery if it does not verify.
|
||||
EOF
|
||||
@@ -36,8 +36,8 @@ done
|
||||
[ -n "$WORKSPACE" ] || { echo "ERROR: --workspace required" >&2; exit 2; }
|
||||
[ -n "$AGENT" ] || { echo "ERROR: --agent required" >&2; exit 2; }
|
||||
case "$AGENT" in
|
||||
claude|agy|hermes|cline|grok) ;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes, cline, or grok" >&2; exit 2 ;;
|
||||
claude|agy|hermes|grok) ;;
|
||||
*) echo "ERROR: --agent must be claude, agy, hermes, or grok" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
find_workspace_uuid "$WORKSPACE" "$AGENT" "$SESSION_NAME"
|
||||
|
||||
@@ -9,7 +9,7 @@ source "$LIB_SH"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 --workspace <path> --agent <claude|agy|hermes|cline> --session <name> [options]
|
||||
Usage: $0 --workspace <path> --agent <claude|agy|hermes|grok> --session <name> [options]
|
||||
|
||||
Options:
|
||||
--herdr-session NAME specify isolated herdr session name (alias: --herdr-server)
|
||||
@@ -42,7 +42,7 @@ done
|
||||
[ -n "$WORKSPACE" ] || { echo "ERROR: --workspace required" >&2; exit 2; }
|
||||
[ -n "$AGENT" ] || { echo "ERROR: --agent required" >&2; exit 2; }
|
||||
case "$AGENT" in
|
||||
claude|agy|hermes|cline|grok) ;;
|
||||
claude|agy|hermes|grok) ;;
|
||||
*) echo "ERROR: unsupported agent: $AGENT" >&2; exit 2 ;;
|
||||
esac
|
||||
[ -n "$SESSION_NAME" ] || { echo "ERROR: --session required" >&2; exit 2; }
|
||||
@@ -86,14 +86,8 @@ fi
|
||||
|
||||
# Resolve absolute path of the agent command to prevent herdr PATH inheritance issues (especially on macOS)
|
||||
RESOLVED_BIN="$AGENT"
|
||||
if [ "$AGENT" = "cline" ]; then
|
||||
if command -v cline >/dev/null 2>&1; then
|
||||
RESOLVED_BIN="$(command -v cline)"
|
||||
fi
|
||||
else
|
||||
if command -v "$AGENT" >/dev/null 2>&1; then
|
||||
RESOLVED_BIN="$(command -v "$AGENT")"
|
||||
fi
|
||||
if command -v "$AGENT" >/dev/null 2>&1; then
|
||||
RESOLVED_BIN="$(command -v "$AGENT")"
|
||||
fi
|
||||
|
||||
# On macOS, clear quarantine attribute for the agent binary to prevent Gatekeeper hangs
|
||||
@@ -108,7 +102,6 @@ if [ -z "$CMD_FULL" ]; then
|
||||
claude) CMD_FULL="${RESOLVED_BIN} --dangerously-skip-permissions -r $UUID" ;;
|
||||
agy) CMD_FULL="${RESOLVED_BIN} --dangerously-skip-permissions --conversation $UUID" ;;
|
||||
hermes) CMD_FULL="${RESOLVED_BIN} --resume $UUID --no-restore-cwd --yolo --accept-hooks" ;;
|
||||
cline) CMD_FULL="${RESOLVED_BIN} -i --id $UUID" ;;
|
||||
grok) CMD_FULL="${RESOLVED_BIN} --resume $UUID --permission-mode bypassPermissions" ;;
|
||||
*) echo "ERROR: unsupported agent: $AGENT" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
# resume UUID 를 per-row own id (claude_session_id_own / agy_conversation_id_own)
|
||||
# 에 박는다 — agent_identities 전역은 더 이상 primary 아님 (cache 로 강등, P0-C/단계 e).
|
||||
#
|
||||
# Usage: bash update_yaml_resumed.sh --session <name> --uuid <id> [--agent claude|agy|hermes|cline]
|
||||
# Usage: bash update_yaml_resumed.sh --session <name> --uuid <id> [--agent claude|agy|hermes|grok]
|
||||
set -euo pipefail
|
||||
|
||||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)/lib.sh"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 --session <name> --uuid <id> [--agent claude|agy|hermes|cline] [--herdr-session <name>]
|
||||
Usage: $0 --session <name> --uuid <id> [--agent claude|agy|hermes|grok] [--herdr-session <name>]
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ NOW_EPOCH=$(date +%s)
|
||||
PANE_PID=$(_herdr list-panes -t "$SESSION_NAME" -F '#{pane_pid}' 2>/dev/null | head -1 || true)
|
||||
PANE_PID="${PANE_PID:-}"
|
||||
CHILD_PID=0
|
||||
if { [ "$AGENT" = "agy" ] || [ "$AGENT" = "hermes" ] || [ "$AGENT" = "cline" ]; } && [ -n "$PANE_PID" ]; then
|
||||
if { [ "$AGENT" = "agy" ] || [ "$AGENT" = "hermes" ]; } && [ -n "$PANE_PID" ]; then
|
||||
CHILD_PID=$(pgrep -P "$PANE_PID" -x "$AGENT" 2>/dev/null | head -1 || true)
|
||||
CHILD_PID="${CHILD_PID:-0}"
|
||||
fi
|
||||
@@ -190,13 +190,6 @@ elif agent == 'hermes':
|
||||
cp = os.environ.get('CHILD_PID', '0')
|
||||
if cp.isdigit() and int(cp) > 0:
|
||||
target['child_pid'] = int(cp)
|
||||
elif agent == 'cline':
|
||||
target['pane']['cmd'] = 'cline'
|
||||
target['pane']['cmd_full'] = f'cline -i --id {uuid}'
|
||||
target['cline_conversation_id_own'] = uuid
|
||||
cp = os.environ.get('CHILD_PID', '0')
|
||||
if cp.isdigit() and int(cp) > 0:
|
||||
target['child_pid'] = int(cp)
|
||||
|
||||
snap = d.setdefault('snapshot', {})
|
||||
snap['taken_at'] = now
|
||||
|
||||
@@ -53,12 +53,12 @@ def resume_on_disk(s):
|
||||
name = s.get('name', '')
|
||||
cwd = (s.get('pane') or {}).get('cwd', '')
|
||||
agent = None
|
||||
for a in ('claude', 'agy', 'hermes', 'cline', 'grok'):
|
||||
for a in ('claude', 'agy', 'hermes', 'grok'):
|
||||
if any(name.endswith(f'-{r}-{a}') for r in ('creator', 'planner', 'reviewer')) or name.endswith(f'-{a}'):
|
||||
agent = a
|
||||
break
|
||||
if not agent:
|
||||
for a in ('claude', 'agy', 'hermes', 'cline', 'grok'):
|
||||
for a in ('claude', 'agy', 'hermes', 'grok'):
|
||||
if f"-{a}" in name or f"_{a}" in name:
|
||||
agent = a
|
||||
break
|
||||
@@ -90,11 +90,6 @@ def resume_on_disk(s):
|
||||
except Exception:
|
||||
return 'MISSING'
|
||||
return 'no'
|
||||
if agent == 'cline':
|
||||
u = s.get('cline_conversation_id_own')
|
||||
if u:
|
||||
return 'yes' if os.path.exists(f"{home}/.cline/data/sessions/{u}/{u}.json") else 'MISSING'
|
||||
return 'no'
|
||||
if agent == 'grok':
|
||||
u = s.get('grok_session_id_own')
|
||||
if u:
|
||||
|
||||
@@ -37,7 +37,7 @@ The stop command is always **graceful by default**:
|
||||
|
||||
```bash
|
||||
SESSION_NAME=<workspace>-creator-<agent> # convention
|
||||
AGENT=claude # claude | agy | hermes | cline | grok — always pass it
|
||||
AGENT=claude # claude | agy | hermes | grok — always pass it
|
||||
AGENT_SESSIONS_YAML=.mam/agent-sessions.yaml
|
||||
|
||||
# 1) Session is registered?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# stop_session.sh — multi-agent-mux-stop 의 부속 스크립트
|
||||
# Usage:
|
||||
# bash stop_session.sh --session <name> [--agent claude|agy|hermes|cline] [--herdr-session <name>] \
|
||||
# bash stop_session.sh --session <name> [--agent claude|agy|hermes|grok] [--herdr-session <name>] \
|
||||
# [--reason <reason>] [--purge-conversation] [--yes]
|
||||
#
|
||||
# 동작: 항상 graceful stop 입니다. send-keys 로 정상 종료를 유도하고
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# 옵션:
|
||||
# --session <name> — 대상 세션 (필수)
|
||||
# --agent <type> — claude | agy | hermes | cline
|
||||
# --agent <type> — claude | agy | hermes | grok
|
||||
# (권장: 항상 명시. 미지정 시 레지스트리 기록으로
|
||||
# 해석 — agent 필드 → 세션명 접미사 → pane.cmd;
|
||||
# 셋 다 실패하면 exit 2)
|
||||
@@ -41,12 +41,12 @@ source "$_lib_sh"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 --session <name> [--agent claude|agy|hermes|cline] [--herdr-session <name>]
|
||||
Usage: $0 --session <name> [--agent claude|agy|hermes|grok] [--herdr-session <name>]
|
||||
[--reason <reason>] [--purge-conversation] [--yes]
|
||||
|
||||
Arguments:
|
||||
--session <name> — target session name (required)
|
||||
--agent <type> — claude | agy | hermes | cline (recommended: always pass it)
|
||||
--agent <type> — claude | agy | hermes | grok (recommended: always pass it)
|
||||
(falls back to the registry record: agent field ->
|
||||
session-name suffix -> pane.cmd)
|
||||
--herdr-session <name> — specify isolated herdr session name (alias: --herdr-server)
|
||||
@@ -58,9 +58,6 @@ Arguments:
|
||||
--purge-conversation — also delete on-disk conversation artifacts;
|
||||
status becomes terminated and resume is impossible
|
||||
--yes — skip the --purge-conversation confirmation prompt
|
||||
|
||||
Stop is always graceful and always captures the conversation id.
|
||||
(idempotent: stopping an already-stopped session is a no-op with exit 0)
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -94,8 +91,8 @@ while [ $# -gt 0 ]; do
|
||||
done
|
||||
if [ -n "$AGENT" ]; then
|
||||
case "$AGENT" in
|
||||
claude|agy|hermes|cline|grok) ;;
|
||||
*) echo "ERROR: invalid agent type '$AGENT'. Allowed types are: claude, agy, hermes, cline, grok." >&2; exit 2 ;;
|
||||
claude|agy|hermes|grok) ;;
|
||||
*) echo "ERROR: invalid agent type '$AGENT'. Allowed types are: claude, agy, hermes, grok." >&2; exit 2 ;;
|
||||
esac
|
||||
fi
|
||||
[ -n "$SESSION_NAME" ] || { echo "ERROR: --session required" >&2; usage; exit 2; }
|
||||
@@ -288,8 +285,6 @@ if captured and not purge:
|
||||
target['agy_conversation_id_own'] = captured
|
||||
elif agent == 'hermes':
|
||||
target['hermes_conversation_id_own'] = captured
|
||||
elif agent == 'cline':
|
||||
target['cline_conversation_id_own'] = captured
|
||||
elif agent == 'grok':
|
||||
target['grok_session_id_own'] = captured
|
||||
target['resumable'] = True
|
||||
|
||||
Reference in New Issue
Block a user