Get the status of an NLME job
get_nlme_job_status.RdThe lifecycle field is state (not status): one of running, succeeded,
failed, dead, unknown, or not_found. The artifacts directory is
artifact_dir (not artifacts_dir) and equals file.path(run_dir, "artifacts"). This is a single-shot progress snapshot - it reads the latest
status once and returns immediately:
Arguments
- job_id
Job id from
start_nlme_job().- project_dir
Project root.
- wait_seconds
Optional server-side wait: block (polling every
poll_intervalseconds) until the job reaches a terminal state (succeeded/failed/dead/not_found) or this many seconds elapse, then return the latest status. Default0(single-shot, non-blocking). Capped at 600 so a tool handler never blocks indefinitely. For agent use preferwait_for_nlme_job()instead of tuning this directly.- poll_interval
Seconds between internal polls while waiting (default 2, minimum 0.5). Ignored when
wait_seconds <= 0.
Value
A list with job_id, state, timing (started/finished/
exit_code), pid, run_dir, artifact_dir, live progress, and (for a
terminal job) fit_health. This is the raw snapshot primitive; the
agent-facing next_action directive is added by wait_for_nlme_job().
Details
st <- get_nlme_job_status(job_id, project_dir)
artifact_dir <- st$artifact_dirTo watch a long fit without burning agent turns, prefer wait_for_nlme_job(),
which blocks server-side using the launch-configured watch budget. The
wait_seconds/poll_interval arguments here are retained for backward
compatibility and advanced manual R use; wait_for_nlme_job() is the
agent-facing watcher.
See also
wait_for_nlme_job() for the preferred long-job watcher.