Skip to content

Commit 7eb43f0

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/ws-8.21.0
2 parents 3c054db + 8f0f2c9 commit 7eb43f0

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

.agents/skills/transformerlab-cli/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ Also note that secrets passed inside `--config` (e.g. `api_token`, `azure_client
762762
9. **`job task-logs --follow`** streams continuously and blocks until the job finishes — use when the user wants real-time monitoring
763763
10. **Never use the deprecated `lab job logs`** — see the "Job logs: three real commands" section below.
764764
11. **Before queuing a task, CONFIRM the experiment with the user.** Run `lab config` to read the current default and `lab --format json experiment list` to verify it exists, then ask: "I'm about to queue this under experiment `<name>` (your current default). OK, or pick another?" Show 2–3 alternatives from `experiment list` if the current one looks stale or missing. Skip the confirmation only when the user has already named the experiment in this turn.
765-
12. **After queuing a task, ASK the user if they'd like you to watch the logs.** Don't start streaming or polling automatically — jobs can take minutes to hours, and `--follow` blocks. Report the Job ID and ask: "Want me to watch the logs and report back?"
765+
12. **After queuing a task, ASK the user if they'd like you to watch the logs.** Don't start streaming or polling automatically — jobs can take minutes to hours, and `--follow` blocks. Report the Job ID and ask: "Want me to watch the logs and report back?" If they say yes and your harness can self-schedule (e.g. Claude Code's `ScheduleWakeup`), watch by checking once per turn and scheduling the next check — not a blocking `--follow` or a `while`/`sleep`/background poll loop, which can strand the session with a finished job (see workflows.md "Polling Pattern for Agents").
766766
13. **Never create API keys programmatically** — if auth fails, ask the user to provide an API key from the web UI
767767
14. **Always pass `--description/-m` when queuing a task. Generate it yourself — never ask the user.** See "Always write a run description" below.
768768

.agents/skills/transformerlab-cli/references/autoresearch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ The agent loops autonomously. Never ask "should I continue?" — keep going unti
250250
6. **Advance.** What this means depends on parallelism:
251251
- **N = 1 (sequential):** wait for the just-queued job to finish, then go to step 7. Poll with `lab --format json job list --running`.
252252
- **N ≥ 2 (parallel / fire-and-advance):** **do not wait.** Return to step 0 and pick the next idea immediately, until `RUNNING >= N`. Only block when the queue is full. This is what enables grid-style search; waiting after every queue collapses parallelism back to 1.
253+
- **How to "wait" / "block" without stranding the session:** don't hold the turn open with a `while`/`sleep` or `run_in_background` poll loop — on remote providers the harness can't track the job, so a loop that ends before the job finishes leaves the session idle until a manual nudge. If your harness can self-schedule (e.g. Claude Code's `ScheduleWakeup`), do **one** `lab job list --running` / `job info` check, then schedule the next check and end the turn, repeating until a job is terminal. The bare poll loop is the fallback for scripts/cron and agents without self-scheduling.
253254
7. **Score → keep or discard** any *completed* jobs whose results haven't been processed yet. In parallel mode, this means scanning recently-finished jobs at the start of each cycle, not just the one you queued last.
254255
```bash
255256
# Find COMPLETE jobs we haven't acted on yet (no discard flag set, not the current best).

.agents/skills/transformerlab-cli/references/workflows.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ lab --format json job info JOB_ID
188188

189189
### Polling Pattern for Agents
190190

191+
> **Interactive agents: prefer your harness's scheduler over this loop.** The `while`/`sleep`
192+
> loop below blocks a whole turn, and run in the background it can be orphaned by a user
193+
> message — either way it can leave the session idle with a finished job unnoticed. If your
194+
> harness can self-schedule a wake (e.g. Claude Code's `ScheduleWakeup`), do **one** `lab job
195+
> info` check per turn, then schedule the next check and end the turn, repeating until terminal.
196+
> The blocking loop below is the fallback for scripts, cron, and agents without self-scheduling.
197+
191198
When monitoring a job programmatically, use this pattern:
192199

193200
```bash

.agents/skills/transformerlab-cli/templates/queue-and-monitor.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Template: Queue a task and monitor until completion
33
# Queues a task non-interactively, polls for job completion, and downloads results.
44
#
5+
# NOTE: this blocking poll loop is for scripts/cron. An interactive agent should NOT run it
6+
# in-session — a self-scheduling harness (e.g. Claude Code's ScheduleWakeup) should check once
7+
# per turn and reschedule instead, so a finished job can't strand the session.
8+
#
59
# Usage: ./queue-and-monitor.sh <task_id> [output_dir]
610
#
711
# Arguments:

0 commit comments

Comments
 (0)