feat(delegate-job): bump default --timeout 600s -> 3600s (1h wall-clock budget)
Changed 11 locations across 5 files: - scripts/registry.py: timeout_sec dataclass default + argparse default - scripts/job_subscriber.py: help text + fallback default - SKILL.md: 4 recommended invocation examples - registry.md: JSON example + CLI example - tmux-agent-orchestrate-delegate-job: bash wrapper TIMEOUT var --idle-timeout 120s preserved unchanged. Rationale: 10min default was too short for deep analysis / multi-file generation tasks; 1h aligns with long-running agent delegation patterns.
This commit is contained in:
@@ -78,7 +78,7 @@ tmux-agent-orchestrate-delegate-job submit \
|
|||||||
--prompt "정렬 문제 10개를 만들어 sort_problems.md로 저장" \
|
--prompt "정렬 문제 10개를 만들어 sort_problems.md로 저장" \
|
||||||
--workdir /path/to/project \
|
--workdir /path/to/project \
|
||||||
--agent-session tmux:demo \
|
--agent-session tmux:demo \
|
||||||
--timeout 600 --idle-timeout 120
|
--timeout 3600 --idle-timeout 120
|
||||||
# → stdout: registered job: <JID>
|
# → stdout: registered job: <JID>
|
||||||
# subscriber pid: …
|
# subscriber pid: …
|
||||||
# agent launched in tmux session: demo
|
# agent launched in tmux session: demo
|
||||||
@@ -107,10 +107,10 @@ SKILL=./skills/tmux-agent-orchestrate-delegate-job/scripts
|
|||||||
# 1) register
|
# 1) register
|
||||||
JID=$($PY "$SKILL/registry.py" register \
|
JID=$($PY "$SKILL/registry.py" register \
|
||||||
--prompt "…" --agent claude-code --agent-session tmux:demo \
|
--prompt "…" --agent claude-code --agent-session tmux:demo \
|
||||||
--timeout 600 --idle-timeout 120)
|
--timeout 3600 --idle-timeout 120)
|
||||||
|
|
||||||
# 2) START THE SUBSCRIBER FIRST (MQTT does not queue non-retained msgs)
|
# 2) START THE SUBSCRIBER FIRST (MQTT does not queue non-retained msgs)
|
||||||
$PY "$SKILL/job_subscriber.py" --job "$JID" --timeout 600 --idle-timeout 120 &
|
$PY "$SKILL/job_subscriber.py" --job "$JID" --timeout 3600 --idle-timeout 120 &
|
||||||
|
|
||||||
# 3) pass JID to the agent and instruct it to publish events with --job "$JID"
|
# 3) pass JID to the agent and instruct it to publish events with --job "$JID"
|
||||||
# (don't hard-code a job id you saw earlier — see Pitfall §"Wrong job_id")
|
# (don't hard-code a job id you saw earlier — see Pitfall §"Wrong job_id")
|
||||||
@@ -267,7 +267,7 @@ subscribe-first + run-agent + validate:
|
|||||||
```bash
|
```bash
|
||||||
tmux-agent-orchestrate-delegate-job submit --agent claude-code \
|
tmux-agent-orchestrate-delegate-job submit --agent claude-code \
|
||||||
--prompt "정렬 문제 10개를 만들어 sort_problems.md로 저장" \
|
--prompt "정렬 문제 10개를 만들어 sort_problems.md로 저장" \
|
||||||
--workdir /path/to/project --timeout 600 [--validate ./validate.sh]
|
--workdir /path/to/project --timeout 3600 [--validate ./validate.sh]
|
||||||
tmux-agent-orchestrate-delegate-job status --job <id> # one record, pretty-printed
|
tmux-agent-orchestrate-delegate-job status --job <id> # one record, pretty-printed
|
||||||
tmux-agent-orchestrate-delegate-job list # all jobs, one line each
|
tmux-agent-orchestrate-delegate-job list # all jobs, one line each
|
||||||
tmux-agent-orchestrate-delegate-job verify --job <id> --validate ./validate.sh # runs it, reports exit code
|
tmux-agent-orchestrate-delegate-job verify --job <id> --validate ./validate.sh # runs it, reports exit code
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Reference implementation: [`./scripts/registry.py`](./scripts/registry.py)
|
|||||||
"password": null
|
"password": null
|
||||||
},
|
},
|
||||||
"topic_prefix": "python/mqtt/jobs/abc12345",
|
"topic_prefix": "python/mqtt/jobs/abc12345",
|
||||||
"timeout_sec": 600,
|
"timeout_sec": 3600,
|
||||||
"idle_timeout_sec": 120,
|
"idle_timeout_sec": 120,
|
||||||
"expected_artifacts": ["sort_problems.md"],
|
"expected_artifacts": ["sort_problems.md"],
|
||||||
"last_seq": 0,
|
"last_seq": 0,
|
||||||
@@ -127,7 +127,7 @@ SQLite transaction when you migrate.
|
|||||||
```bash
|
```bash
|
||||||
PY=.venv/bin/python
|
PY=.venv/bin/python
|
||||||
$PY scripts/registry.py register --prompt "…" --agent claude-code \
|
$PY scripts/registry.py register --prompt "…" --agent claude-code \
|
||||||
--agent-session tmux:claude --timeout 600 --idle-timeout 120 # → prints job_id
|
--agent-session tmux:claude --timeout 3600 --idle-timeout 120 # → prints job_id
|
||||||
$PY scripts/registry.py list # human table
|
$PY scripts/registry.py list # human table
|
||||||
$PY scripts/registry.py list --json # full records
|
$PY scripts/registry.py list --json # full records
|
||||||
$PY scripts/registry.py get --job <id> # one record
|
$PY scripts/registry.py get --job <id> # one record
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ def main(argv=None) -> int:
|
|||||||
target.add_argument("--wait-any", action="store_true",
|
target.add_argument("--wait-any", action="store_true",
|
||||||
help="watch every pending/running job in the registry")
|
help="watch every pending/running job in the registry")
|
||||||
parser.add_argument("--timeout", type=float, default=None,
|
parser.add_argument("--timeout", type=float, default=None,
|
||||||
help="wall-clock budget in seconds (default: job.timeout_sec or 600)")
|
help="wall-clock budget in seconds (default: job.timeout_sec or 3600)")
|
||||||
parser.add_argument("--idle-timeout", type=float, default=None,
|
parser.add_argument("--idle-timeout", type=float, default=None,
|
||||||
help="max seconds with no new event (default: job.idle_timeout_sec or 120)")
|
help="max seconds with no new event (default: job.idle_timeout_sec or 120)")
|
||||||
parser.add_argument("--expect-retention", action="store_true",
|
parser.add_argument("--expect-retention", action="store_true",
|
||||||
@@ -148,7 +148,7 @@ def main(argv=None) -> int:
|
|||||||
|
|
||||||
# Resolve timeouts from CLI, falling back to the (first) job's settings.
|
# Resolve timeouts from CLI, falling back to the (first) job's settings.
|
||||||
base_job = jobs[0]
|
base_job = jobs[0]
|
||||||
wall_timeout = args.timeout if args.timeout is not None else float(base_job.get("timeout_sec", 600))
|
wall_timeout = args.timeout if args.timeout is not None else float(base_job.get("timeout_sec", 3600))
|
||||||
idle_timeout = args.idle_timeout if args.idle_timeout is not None else float(base_job.get("idle_timeout_sec", 120))
|
idle_timeout = args.idle_timeout if args.idle_timeout is not None else float(base_job.get("idle_timeout_sec", 120))
|
||||||
|
|
||||||
# All watched jobs share a broker in practice; connect using the first
|
# All watched jobs share a broker in practice; connect using the first
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def register_job(
|
|||||||
agent: str = "claude-code",
|
agent: str = "claude-code",
|
||||||
agent_session: str = "tmux:claude",
|
agent_session: str = "tmux:claude",
|
||||||
broker: Optional[Dict[str, Any]] = None,
|
broker: Optional[Dict[str, Any]] = None,
|
||||||
timeout_sec: int = 600,
|
timeout_sec: int = 3600,
|
||||||
idle_timeout_sec: int = 120,
|
idle_timeout_sec: int = 120,
|
||||||
registry_dir: str = DEFAULT_REGISTRY_DIR,
|
registry_dir: str = DEFAULT_REGISTRY_DIR,
|
||||||
job_id: Optional[str] = None,
|
job_id: Optional[str] = None,
|
||||||
@@ -187,7 +187,7 @@ def _build_parser() -> argparse.ArgumentParser:
|
|||||||
p_reg.add_argument("--prompt", required=True)
|
p_reg.add_argument("--prompt", required=True)
|
||||||
p_reg.add_argument("--agent", default="claude-code")
|
p_reg.add_argument("--agent", default="claude-code")
|
||||||
p_reg.add_argument("--agent-session", default="tmux:claude")
|
p_reg.add_argument("--agent-session", default="tmux:claude")
|
||||||
p_reg.add_argument("--timeout", type=int, default=600)
|
p_reg.add_argument("--timeout", type=int, default=3600)
|
||||||
p_reg.add_argument("--idle-timeout", type=int, default=120)
|
p_reg.add_argument("--idle-timeout", type=int, default=120)
|
||||||
p_reg.add_argument("--bits", type=int, default=32, help="32 (PoC) or 128 (prod)")
|
p_reg.add_argument("--bits", type=int, default=32, help="32 (PoC) or 128 (prod)")
|
||||||
p_reg.add_argument("--artifact", action="append", default=[], dest="artifacts")
|
p_reg.add_argument("--artifact", action="append", default=[], dest="artifacts")
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ EOF
|
|||||||
|
|
||||||
# ---- arg parsing helpers --------------------------------------------------
|
# ---- arg parsing helpers --------------------------------------------------
|
||||||
AGENT="claude-code"; PROMPT=""; WORKDIR="$(pwd)"; AGENT_SESSION="tmux:claude"
|
AGENT="claude-code"; PROMPT=""; WORKDIR="$(pwd)"; AGENT_SESSION="tmux:claude"
|
||||||
TIMEOUT=600; IDLE_TIMEOUT=120; VALIDATE=""; DRY_RUN=0
|
TIMEOUT=3600; IDLE_TIMEOUT=120; VALIDATE=""; DRY_RUN=0
|
||||||
JOB_ID=""; REGISTRY_DIR="$REGISTRY_DIR_DEFAULT"
|
JOB_ID=""; REGISTRY_DIR="$REGISTRY_DIR_DEFAULT"
|
||||||
|
|
||||||
parse_opts() {
|
parse_opts() {
|
||||||
|
|||||||
Reference in New Issue
Block a user