Skip to content

fix(execution): hand a run from the builder its provider's record - #332

Closed
pierreleca wants to merge 2 commits into
ThinkFlowLab:mainfrom
pierreleca:fix/builder-provider-record
Closed

pierreleca wants to merge 2 commits into
ThinkFlowLab:mainfrom
pierreleca:fix/builder-provider-record

Conversation

@pierreleca

Copy link
Copy Markdown
Contributor

Closes #331

What

A run started from the builder reads no saved settings (--from-run). It lost the record Settings holds for a preset provider (OPENROUTER: a name, a base and endpoints by protocol). An agent that speaks a protocol the record adds passed the builder's check. The run then refused it with "OpenRouter does not serve what the agent speaks". The launcher now exports the record of the run's preset provider when it validates, written again as the JSON that was checked, and run_env keeps that record alone. On a host, the launcher first unsets every preset provider's record the host's shell holds, then exports the one the builder checked.

Touches

backend · the standard · docs and site

Verified

  • Both suites on a plain copy, one module a process: backend 167 modules, 2,749 tests; routes 63 modules, 619 tests. Nothing fails that main passes; both fail test_settings alone (no .env.example in the copy).
  • Tests: the launched environment holds the run's provider's record alone, as the JSON that validated, also from a record with duplicate members; a host's own records are unset first; run_env keeps the provider's record alone.
  • field_contract.py --write and catalogue_docs.py --write change nothing; git diff --check is clean; the judge's own checks pass offline.
  • Not verified: a paid run through a host.

Risk

A record never holds a key: providers.record_problem refuses one with a key member for a preset. If the export were wrong, a run from the builder would serve other protocols than Settings names. Reverting the two commits restores the earlier launch line.

A run started from the builder reads no saved settings (--from-run). It
lost the record Settings holds for a preset provider (OPENROUTER: a name,
a base and endpoints by protocol). An agent that speaks a protocol the
record adds passed the builder's check, and the run then refused it.

The launcher now exports the record of the run's preset provider when it
validates, written again as the JSON that was checked, and run_env keeps
that record alone. A record never holds a key: record_problem refuses one.
… exported

A host's shell may hold provider records of its own. A standard run there
reads no saved settings, and a record left in that shell would be read as
the one the builder checked, or as one when the builder sent none. The
launcher now unsets every preset provider's record before it exports the
run's own.
@pierreleca
pierreleca force-pushed the fix/builder-provider-record branch from cb1c53e to 839eba9 Compare November 24, 2026 11:11
aitianshi added a commit that referenced this pull request Nov 24, 2026
Closes #383

## What

Official providers now use only their fixed protocol endpoints.
Previously, Settings offered editable extra protocols on preset cards;
the builder could accept those additions while a launched run discarded
them (#331, #332). Preset cards now show only supported endpoints,
read-only. Saved and environment overrides cannot extend presets, and
saving an override is rejected with a direction to use Custom.

Custom retains all six editable protocol fields. Tests cover saving its
endpoints, selecting judge protocols and URLs, and handing its named
base and key to a run. This replaces the need for preset-record
forwarding in #332; that PR should be updated and its original problem
rechecked after this lands.

## Touches

Backend provider registry and settings validation; Settings route;
backend and route tests; provider documentation and generated settings
example; UI evidence.

## Before and after

OpenRouter card at the same 1280px viewport. Custom continues to expose
all six editable protocol fields.

| Before | After |
| --- | --- |
|
![Before](https://github.com/ThinkFlowLab/nullius/blob/fix/settings-preset-endpoints/app/ui_tests/evidence/provider-endpoints/before.png?raw=true)
|
![After](https://github.com/ThinkFlowLab/nullius/blob/fix/settings-preset-endpoints/app/ui_tests/evidence/provider-endpoints/after.png?raw=true)
|

## Verified

- Route suite after merging current main: 658 tests in 68 modules pass.
- Backend suite after merging current main: 2,855 tests in 173 modules;
one OSWorld2 proxy timing failure under parallel load. Its full 36-test
module passes on isolated rerun; no code in that module was changed.
GitHub tests and PR judge both passed on
db69d14.
- Focused Settings/provider registry tests: 35 pass, including rejection
and reporting of existing saved preset overrides.
- Browser checks: OpenRouter and Custom cards at 390px and 1280px, light
and dark; no page JavaScript errors or horizontal overflow. Expanded
cards visually reviewed.
- `git diff --check` passes.
- Not verified: paid provider calls or a remote-host benchmark run.

## Risk

Existing user-added preset endpoints stop affecting protocol selection.
Users requiring those endpoints must create a Custom provider. Their
stored settings are retained and reported as unsupported. Revert
restores the old behavior.

Custom endpoint fields configure provider tests and judges; run relays
continue forwarding agent paths below the base URL rather than rewriting
them from those fields. That existing limitation is now documented. No
preset configuration or secret is newly forwarded to a run.
@aitianshi

Copy link
Copy Markdown
Collaborator

#384 has merged into main as 9615496, after both CI checks passed.

Official providers now use only their fixed endpoints. Settings exposes additional protocol fields only for Custom; saved or environment preset overrides no longer extend the preset's supported protocols. This removes the preset-extension case behind #331 rather than forwarding its record into a run.

Please update this PR against current main and recheck whether the original builder/run mismatch still persists. If it does, please include the smallest reproducer using a supported preset configuration or a Custom provider, and narrow this PR to the remaining problem.

Custom endpoint saving, judge endpoint selection, and launch base/key handoff were checked in #384. Custom run relays still forward the agent's paths beneath the base URL; endpoint fields do not rewrite those paths. That existing limitation is documented and should be distinguished from the original preset-record issue.

aitianshi added a commit that referenced this pull request Nov 24, 2026
Closes #379

## What

Before a live feed exists, a run now opens on Logs. Launch stages and
log output live there; the first usable feed switches to Live within the
same document, without reloading. Explicit tab choices are respected.
Restarted stages drop stale timing/detail, terminal executions settle
stage state, and unknown unit totals use an indeterminate bar.

The full-run overview shows identity cards with Runner first, then
Benchmark/Dataset, Agent/Model, and Trials/Duration. Task and All
attempts pages keep their own status and metrics without repeating run
identity.

Task overview cards put timing and Tool calls on the left and Model
usage on the right, stacking on narrow screens. Model usage combines a
compact token bar with Prompt growth when multiple calls were recorded.
Its labels and segments are input, cache, output; input means uncached
input, as its tooltip explains. Cache hit is plain text. Saved trial
totals provide a fallback when trajectory accounting is absent, and
missing usage is stated explicitly.

## Touches

backend · routes · templates and static · tests · field guide

No equivalent open or closed issue/PR was found in the repository or
private fork. Related open work: #336 (run facts), #338 (trial details),
#340 (task step progress). These have shared-file overlap, but implement
separate behavior. After merging main, pairwise merge checks are clean
for #332, #336, #338, #340, #342 and #344. Unmerged #352 and #354 still
require coordination in app/templates/runs/job.html and app/web/runs.py;
their features are not included here.

## Before and after

Task overview: the earlier real-run capture and the approved final
layout from that same saved run. Run identity is now kept on the
full-run overview.

| Before | After |
| --- | --- |
| <img width="430" alt="Earlier task overview with separate growth and
tool sections"
src="https://raw.githubusercontent.com/ThinkFlowLab/nullius/feat/run-logs-tab/app/ui_tests/evidence/run-logs/task-after.png">
| <img width="430" alt="Timing and Tool calls on the left, combined
Model usage on the right"
src="https://raw.githubusercontent.com/ThinkFlowLab/nullius/feat/run-logs-tab/app/ui_tests/evidence/run-logs/model-usage-after.png">
|

Full-run identity cards and Live/Results/Logs:

<img width="860" alt="Full-run overview with Runner first and benchmark,
dataset, agent, model, count and duration cards"
src="https://raw.githubusercontent.com/ThinkFlowLab/nullius/feat/run-logs-tab/app/ui_tests/evidence/run-logs/run-overview-after.png">

## Verified

- Backend suite: 2,856 tests in 173 modules passed after merging current
main outside the socket-restricted sandbox.
- Route suite: 660 tests in 68 modules passed after merging current
main.
- Focused progress and execution tests: 83 passed.
- Browser checks: desktop light/dark and narrow layout; automatic Logs →
Live retains the document and `performance.timeOrigin`; tab selection
and task metrics checked.
- Real τ³-bench Airline task using `meta/muse-spark-1.3-contributor`:
reward 1.0, 55.54 seconds agent time, 22 steps. Recorded uninterrupted
from cold setup through Logs → Live, Results and the task page. The
simulator and judge used `openai/gpt-4.1` because the configured dated
default alias was unavailable. The earlier refused attempt was not
counted as this successful run.
- Field-guide checks: 2 passed. Usage regression cases cover one call,
multiple calls, final metrics, trial totals, unreadable trajectories,
missing usage and output-only records.
- `git diff --check` passed.

## Risk

Feed readiness and polling changes could leave a preparing page on the
wrong tab; explicit choices must not be overridden. A terminal execution
now settles a remaining stage even if its final stage event was absent,
but does not manufacture a duration or unit count. Runs without launch
records have no Logs tab. The overview derives the benchmark from the
catalogue or a single recorded task source. The token summary preserves
existing trajectory cache accounting; partial per-call records can still
describe only the recorded subset. Revert to undo; no storage migration.
@pierreleca

Copy link
Copy Markdown
Contributor Author

Rechecked on main at ee8b644. A test compared the builder's provider check with that of the run it launches, under the same saved settings. They now agree: an OpenRouter record adding messages, saved or from the environment, is refused by both; Custom providers, named or unnamed, are accepted by both. On the commit before #384, the OpenRouter cases disagree. This PR and #331 can be closed.

@pierreleca pierreleca closed this Nov 24, 2026
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.

A run started from the builder loses its provider's record and refuses an agent the builder accepted

2 participants