Skip to content

release: prime-runs 0.1.1 - #896

Merged
kcoopermiller merged 5 commits into
mainfrom
release/prime-runs-0.1.1
Sep 4, 2026
Merged

kcoopermiller merged 5 commits into
mainfrom
release/prime-runs-0.1.1

Conversation

@kcoopermiller

@kcoopermiller kcoopermiller commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Bumps prime-runs to 0.1.1 so release-runs.yml publishes the one change since 0.1.0:

#895 is merged (22e3c570) and main has been merged into this branch, so the diff is the one-line bump; the branch's earlier fix commits are the same content main now carries from the squash. Squash-merging flattens the merge commits.

Version-only change on top of the fix; the workspace lock is unaffected (the editable member carries no pinned version). Merging publishes 0.1.1 through OIDC and tags prime-runs-v0.1.1.

Follow-up once 0.1.1 is on PyPI: prime-rl#3459 bumps to prime-runs[train]>=0.1.1 and relocks, which lifts its merge gate.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYdQmKAVnGteT1tkimJb3g


Note

Low Risk
Single version string change with no behavioral diff in this PR.

Overview
Release-only change: bumps prime-runs __version__ from 0.1.0 to 0.1.1 in packages/prime-runs/src/prime_runs/__init__.py so CI (release-runs.yml) can publish the next patch to PyPI and tag prime-runs-v0.1.1.

No runtime or API code changes appear in this diff; it packages the hosted-run fix from #895 (PlatformClient / internal RFT router via PRIME_API_BASE) for consumers such as prime-rl once they pin prime-runs[train]>=0.1.1.

Reviewed by Cursor Bugbot for commit ecf403e. Bugbot is set up for automated code reviews on this repo. Configure here.

kcoopermiller and others added 2 commits September 3, 2026 21:16
Hosted managed RFT runs start their orchestrator with
`PRIME_API_BASE=<platform>/api/internal/rft` and a per-run token; that
router authenticates the token from the `x-api-key` header and serves the
monitoring routes (metrics, presign, confirm, finalize) only. `PlatformClient`
addressed everything under `<base>/api/v1` with a Bearer header alone, so an
attached hosted run would 404 every upload and go silently unmonitored.

`PlatformClient` now recognises the internal root (with or without the
trailing `/rft`): requests go under `<base>/api/internal` and the token is
repeated in `x-api-key`. The public root is unchanged, and a `/api/v1/rft`
root is accepted the same way. Headers are also sent per request, so a
caller-supplied `httpx.Client` authenticates like one the SDK opened.
Docs: `init()`, `RftBackend.attach`, README.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYdQmKAVnGteT1tkimJb3g
Bumps prime-runs to 0.1.1 so release-runs.yml publishes the one change since
0.1.0: #895 (PlatformClient reaches the platform's internal RFT router for
hosted runs, with the run's token in x-api-key).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYdQmKAVnGteT1tkimJb3g
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T04:21:17.991813Z 883f89a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 883f89aa39

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

kcoopermiller and others added 2 commits September 3, 2026 21:31
`split_api_root` stripped `/rft` from the whole string, so a platform host
that is itself named `rft` (`http://rft`, a plain service name) collapsed to
`http:/` and every request went to a host called `api`; the same slip
existed for `/api/v1` on a host named `api` before this branch. Suffixes are
now matched on the parsed URL's path only, longest first, and `/rft` is
recognised only after an API path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYdQmKAVnGteT1tkimJb3g
@kcoopermiller
kcoopermiller changed the base branch from main to fix/prime-runs-internal-api-root September 4, 2026 04:32
kennethnym
kennethnym previously approved these changes Sep 4, 2026
Base automatically changed from fix/prime-runs-internal-api-root to main September 4, 2026 16:52
@kcoopermiller
kcoopermiller dismissed kennethnym’s stale review September 4, 2026 16:52

The base branch was changed.

@kcoopermiller
kcoopermiller merged commit 5ba7d95 into main Sep 4, 2026
20 checks passed
@kcoopermiller
kcoopermiller deleted the release/prime-runs-0.1.1 branch September 4, 2026 17:01
kcoopermiller added a commit to PrimeIntellect-ai/prime-rl that referenced this pull request Sep 9, 2026
Replaces `monitors/prime.py`'s`TrainRun` with `pr.init(kind="train",
...)`.

## What moved where

| was in prime-rl | now |
| --- | --- |
| `TrainRun.create` / `$RUN_ID` attach | `pr.init(kind="train", model=,
environments=, training=pr.TrainingSpec(...), config=, ...)` /
`pr.init(kind="train", id=$RUN_ID)` |
| `TrainRun.log_metrics` (fire-and-forget task per POST) |
`run.log_metrics(values, step=)` — a queue put; the SDK's uploader owns
retries, `Retry-After`, backpressure |
| `episodes_to_parquet_bytes` + `SAMPLE_SCHEMA` + presign→PUT→confirm |
`prime_runs.projection` + the SDK's training samples sink (same schema,
same flow) |
| the `step % 10` cadence in `log_episodes` | the sink
(`step_interval=10`), keyed on each episode's `run.work.step` — the
`TrainRunInfo` the dispatcher stamps |
| `finalize` → `POST /finalize`, fallback `set_status` | `run.finish()`
— drain, then an idempotent finalize; 409 on the failure path is treated
as already-closed |
| atexit `_mark_failed` | the SDK's atexit hook reports **crashed**
(with a message); an attached run's failure marking stays with the
launcher, as before |

The `kind == "train" and subset == "effective"` cohort filter stays
here. The monitor keeps `sanitize()` so dropped non-finite metric paths
are still named in the log (the SDK would drop them silently).
`$PRIME_API_BASE` still works — it historically points at
`…/api/v1/rft`, so the monitor strips what the SDK re-adds.

## Decisions

- **Step keying.** The samples sink keys each episode by the step it was
*dispatched* at (`run.work.step`), not the batch step; the platform
keeps one Parquet object per upload and the viewer unions every object
under a step, so an off-policy episode landing in a later batch adds an
object rather than replacing one, and each object numbers its
`sample_id`s in its own range (SDK side, `aba26790`). "Step N" in the
sample viewer therefore means dispatched at N, while the metrics at N
describe the batch trained at N.
- **Run identity.** The orchestrator keeps the launcher's `PRL_RUN_ID`
(or a local uuid) as the run identity for episodes, W&B and sandbox
labels, exactly as on `main`. The SDK keys every uploaded record to the
platform run (`run.id` / `run.type` on the uploaded copy, `work` kept),
so Prime Traces documents carry the id the dashboard shows without the
orchestrator learning it.

## Dependency

`prime-runs[train]>=0.1.1` from PyPI
([0.1.1](https://pypi.org/project/prime-runs/0.1.1/),
PrimeIntellect-ai/prime#896); the lock carries `prime-runs 0.1.1` +
`prime-traces 0.0.3` from the registry. The monitor's own unit tests run
in CI; there is no GPU-free end-to-end path for the training seam, so
the RFT contract was verified by reading the platform's `/api/v1/rft/*`
and `/api/internal/rft/*` routes against the SDK's calls.

## Hosted managed runs

Since PrimeIntellect-ai/platform#4885, hosted managed runs start the
orchestrator with `--monitors.prime.name`, `RUN_ID`, a per-run token in
`PRIME_API_KEY` and `PRIME_API_BASE=<platform>/api/internal/rft`.
prime-runs 0.1.1 (PrimeIntellect-ai/prime#895) addresses that internal
router and sends the run's token in `x-api-key`, the header it
authenticates on; 0.1.0 only spoke `/api/v1` with a Bearer header and
would have left those runs silently unmonitored. This monitor's
`_base_url()` passes `$PRIME_API_BASE` minus the trailing `/rft`, which
0.1.1 accepts, so the floor bump is the whole change. External runs
(prime-rl launched outside the platform) were never affected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01Fk5fBAAaTiPfJ5UpNyqxXR


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes how training runs register and upload to the Prime platform
(including hosted `$RUN_ID` / internal RFT paths); misconfiguration now
fails launch instead of silently skipping monitoring, but orchestrator
run identity for W&B stays unchanged.
> 
> **Overview**
> **Replaces** the in-repo `TrainRun` HTTP/Parquet implementation in
`PrimeMonitor` with **`prime-runs[train]>=0.1.1`**, so run registration
(or `$RUN_ID` attach), metrics streaming, episode sample uploads,
finalize, and crash reporting are owned by the SDK uploader instead of
custom `httpx` + fire-and-forget tasks.
> 
> The monitor layer is now a thin adapter: `pr.init(kind="train", …)` on
startup, `run.log_metrics` / `run.log_episodes` via `asyncio.to_thread`,
and `run.finish()` with a **60s** drain timeout. Local behavior kept
where it matters: non-finite metrics are still **sanitized with named
warnings**, only **train / effective** episodes are forwarded, and
**`$PRIME_API_BASE`** is normalized for the SDK. Episode
**every-10th-step** upload cadence moves into the SDK sink (keyed on
dispatch step on `run.work`).
> 
> **Docs** in `training.md` describe the SDK, team allowlisting,
**`PRIME_RUNS_MODE=disabled`**, and **`RUN_ID`** attach.
**Lock/pyproject** add `prime-runs` and transitive **`prime-traces`**,
with fast-track resolver entries.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
aed9bbf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants