Skip to content

refactor(observability): move saved model-call readers out of the API model - #4736

Merged
giuliolovisotto merged 2 commits into
mainfrom
glovisotto/model-call-reader-refactor
Oct 19, 2026
Merged

giuliolovisotto merged 2 commits into
mainfrom
glovisotto/model-call-reader-refactor

Conversation

@giuliolovisotto

@giuliolovisotto giuliolovisotto commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Saved-exchange readers and rollout attachment currently live beside the model-server transport implementation. Move that code into nemo_gym.observability.model_calls, leaving capture middleware, streaming reconstruction and persistence in base_responses_api_model.py.

This is the refactor-only prerequisite for #4630. All 18 moved definitions and all definitions remaining in the base-model module have identical ASTs to the original implementations. Consumers and test patch targets use the new import locations; 25 reader tests now live in test_model_calls.py, with their assertions unchanged. Verifier IDs, ownership and lifecycle tracking belong to #4630.

Compatibility: old imports remain available through the repository’s lazy deprecation helper and warn with the replacement path. New code should import ModelCallRecord and the reader/aggregation helpers from nemo_gym.observability.model_calls; the docs example uses that path. No artifact-format, runtime-behavior or benchmark-result change. A separate issue is unnecessary: this extracts the structural portion of #4630 for independent review.

Validation of the final review follow-up: 643 focused tests, all-file pre-commit, Fern validation and git diff --check passed. All 20 relocated symbols retain identity through legacy imports, both module import orders work, and the docs example executes. Before this follow-up, 1,638 core/conformance tests and 223 adapter tests passed on main 285224a04 plus the refactor. Live model rollouts: N/A for this relocation and compatibility shim; the verifier follow-up retains its live HealthBench validation.

PYTHONPATH="$PWD" .venv/bin/python -m pytest tests/unit_tests/test_base_responses_api_model.py tests/unit_tests/test_model_calls.py tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_rollout_observability.py -q -o addopts='' --disable-warnings --maxfail=2
.venv/bin/pre-commit run --all-files
(cd fern && npm run check)
git diff --check

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Separate saved-exchange interpretation and rollout attachment from model-server transport and capture. Move the existing implementations unchanged and update consumers and test patch targets.

ModelCallRecord and reader helpers now live in nemo_gym.observability.model_calls; external imports must use that path. Verifier ownership is a separate follow-up.

Signed-off-by: Giulio Lovisotto <[email protected]>
@giuliolovisotto
giuliolovisotto added this pull request to the merge queue Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39312338319

Merged via the queue into main with commit 7ada531 Oct 19, 2026
50 of 56 checks passed
@giuliolovisotto
giuliolovisotto deleted the glovisotto/model-call-reader-refactor branch October 19, 2026 19:56

This branch was previously deployed

1 inactive deployment
public — c85fbbc7 Deployed Oct 19, 2026 by copy-pr-bot[bot] via release / finalize / notify #5753
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