Repository navigation
Studio: keep the SYSTEM prompt of an Ollama model made from a Modelfile - #18045
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36d767351a
ℹ️ 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".
…ty system turn [skip ci]
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e78e0030a8
ℹ️ 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".
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…red since #18036) (#18072) ## Summary `Repo tests (CPU, rest-2)` fails on main since #18036 (seen on #18045, on `0d4793e1`): ``` tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding AssertionError: 1 file reads in the test trees touch a checked-in file with the platform default encoding, ... 'tests/_ddp_trainable_embeddings_worker.py:81: open()' ``` #18036 added `tests/_ddp_trainable_embeddings_worker.py`, which writes each rank's result JSON with `open(path, "w")`, so it uses the platform default encoding (cp1252 on Windows). The repo-wide guard requires every `open()` in the test trees to name an encoding. The DDP change itself is fine; only the new helper missed the convention. The guard is doing its job. ## Change - `tests/_ddp_trainable_embeddings_worker.py`: the result file is written with `encoding = "utf-8"`. - `tests/test_ddp_find_unused_default.py`: the two `read_text()` calls that read those files back pass `encoding = "utf-8"` too, so the writer and the reader agree on every platform. ## Verification - `tests/test_source_read_encoding.py -k checked_in_file_reads`: fails on main with the line above, passes with this change.
…nd Anthropic Messages
|
Pushed da3c514 on top of the branch (fast-forward; main is 16 ahead with no conflicts, so I didn't merge it). The Modelfile SYSTEM fallback now also reaches two routes that still dropped it:
Verified live with a real
Tests are in |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Wrap-up for da3c514:
|
… fixed 0.1 s sleep (#18103) `studio/backend/tests/test_anthropic_admission.py` fails intermittently in the Studio `a-f` shard on unrelated PRs (#18045, #18006, #18069, #18075): ``` test_non_streaming_queued_then_admitted E AssertionError: assert 0 == 1 E + where 0 = LlamaAdmissionSnapshot(..., capacity=1, active=1, queued=0, ...).queued test_capacity_enforced_from_effective_parallel_slots E AssertionError: assert (3 == 3 and 3 == 3 and 0 == 1) ``` ## Cause Each of these tests occupies every slot, starts a request as a task, sleeps a fixed 0.1 s and then expects the request to be in the admission queue. On a loaded runner the handler sometimes has not reached the queue within 0.1 s, so the snapshot still shows `queued=0`. The admission code is not at fault; the test raced it. ## Fix `_until_queued(task)` polls the queue snapshot every 10 ms until the request is queued, for up to 5 s. It still fails if the request finishes without ever queueing (`task.done()`) or never queues within the deadline, so a request that skips admission is still caught. It replaces the fixed sleep at all five sites that assert `queued == 1` right after starting the task. The assertions themselves are unchanged. ## Verification - `tests/test_anthropic_admission.py`: 39 passed, twice. - Slow handler simulated locally (`await asyncio.sleep(0.25)` at the top of `anthropic_messages`, not committed): - main: the five queued checks fail (plus `test_uncontended_hot_path_is_fast`, which is meant to catch a slow handler). - this branch: only `test_uncontended_hot_path_is_fast` fails.
A model built with
ollama createfrom a Modelfile that has a SYSTEM line shows up in the chat picker under Ollama, but chatting with it in Studio ignores that SYSTEM text. The model answers as the bare base model, with nothing to say the prompt was dropped. This hits personas and fine-tunes exported with the system message they were trained on.When the loaded model is an Ollama model with a SYSTEM layer and the chat has no system prompt of its own, that text is now sent as the system prompt, the way Ollama does it. A system prompt set in Studio, or sent by an API client, still replaces it, and the current date line still goes in front of it when that setting is on.
Screenshots
Before (main)
After (this PR)