Skip to content

Re-type the native default, not whatever the input happens to show - #9282

Merged
danielhanchen merged 3 commits into
mainfrom
fix-retype-shown-precondition
Aug 19, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
fix-retype-shown-precondition

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

"re-typing the shown context does not pin an override" failed on a staging
runner and passed on the org queue for the same commit, on a PR touching one
backend test file:

STEP reset clears the per-model override
reset: Context Length input now shows '4096'
STEP re-typing the shown context does not pin an override
FAIL: re-typing the shown context pinned it as an override (4096)

The step read its target value out of the input, calling it "the currently
displayed native/default context". Those are two different things, and the
Reset step immediately above already says so in its own comment: "a live-loaded
model can still echo its context even with the stored override gone."

After Reset the model is still live at DISTINCT_CTX, so the input echoes 4096
while the native default is 2048. The step then ticked "Remember for this
model", typed 4096, and called the resulting override a phantom pin. That
override is correct -- the value differs from the default and the user asked
for it to be remembered. The step was asserting the opposite of its subject,
and only passed when timing happened to leave the native default showing.

So it now re-types default_ctx, captured at the top of the suite before any
override existed, and checks that the input actually shows it before asserting
anything. The precondition IS the subject here: the regression being guarded is
that entering an unchanged value replays a cached blur value into a stored
override, and "unchanged" has to be true for that to mean anything. When it is
not, the step says which way it went instead of testing something else.

That stays a soft_fail rather than a silent skip, for the reason the existing
comment gives: this step is the only guard on the phantom-pin regression, so a
run where it did not execute must not read as a run where it passed.

default_ctx is bound before the step that assigns it, because both assigning
branches sit inside failure guards -- otherwise a run that failed early would
raise NameError here and bury the step that actually broke.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@danielhanchen

Copy link
Copy Markdown
Member Author

Marking this draft: the premise is wrong.

I assumed the Context Length shown before the model loads is the model's native default, and re-typing that value is what the step is about. The improved diagnostic disproves it on the first run:

FAIL: re-type-shown did not run: the input shows 32768, not the native default 2048

2048 is the pre-load UI default; 32768 is the loaded model's actual native context. So the precondition I added can essentially never hold, and the step goes from intermittently red to permanently red. That is a worse outcome than the flake.

What is left is a genuine product question I do not want to answer by adjusting the test until it is green. The step's stated invariant is that entering a value that is unchanged commits no onChange, so nothing should be stored. But it also ticks "Remember for this model" first, and storing the current context is what that checkbox is for. Those two readings disagree, and which one is right decides whether the original failure was a real phantom-pin bug or a test asserting against its own setup.

Leaving the diagnostic improvement in place here because it is what made the disagreement visible, and picking this up once the intended semantics are settled.

"re-typing the shown context does not pin an override" reports a regression
against behaviour the product implements on purpose.

model-config-page.tsx:

  const pinFixedLayerContext =
    target.isGguf && loadableConfig.gpuMemoryMode === "manual" &&
    loadableConfig.gpuLayers != null && loadableConfig.gpuLayers >= 0 &&
    loadableConfig.customContextLength == null && activeLoadedContext != null;

with the reason stated directly above it: "If the user fixes GPU Layers
(Manual) and remembers, pin that shown context so a later fresh load keeps the
fitted placement instead of sending native/0 and recreating the OOM."

So storing the context is the feature. The step could not tell that apart from
the phantom pin it was written to catch, and on a CPU-only runner -- placement
manual, gpuLayers 0 -- the documented condition always holds, so the step failed
deterministically every time it ran.

Why it looked intermittent rather than always broken: as introduced in #7351 it
inherited the popover from the Reset step above, Reset closes the popover, and
the step skipped without saying so. #7760 made it own its state and it started
running for real. Both of those PRs are right; the step was passing by not
executing, and neither change could have known that.

It has never failed on main, either, and that is not evidence it works: main's
picker shard has been dying in "Install Playwright browsers" on the webkit
package set, so the suite never reaches this step. Once that is fixed the shard
gets far enough to run it, which is how this surfaced -- on a staging run, on a
PR touching one backend test file.

The distinction is now made from the stored entry: a pinned context is expected
when that entry also carries the fixed-layer placement, and a regression when it
does not. The phantom-pin guard survives, because a pin with no manual placement
behind it still fails, and the failure now prints the fields it judged on rather
than a bare number.

Supersedes my first attempt on this branch, which re-typed the pre-load default
instead of the shown value. That was wrong twice over: the pre-load 2048 is a UI
default rather than the model's native context (32768 once loaded), and the
step's invariant is about entering an UNCHANGED value, which only the shown one
is.
@danielhanchen
danielhanchen marked this pull request as ready for review August 19, 2026 11:21
@danielhanchen
danielhanchen force-pushed the fix-retype-shown-precondition branch from 4d62789 to f30f85c Compare August 19, 2026 11:21
@danielhanchen
danielhanchen merged commit b01b6ab into main Aug 19, 2026
24 checks passed
@danielhanchen
danielhanchen deleted the fix-retype-shown-precondition branch August 19, 2026 12:08
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.

1 participant