claude: a computer with no engine declares a window it can reach (#1246) - #1257
Merged
Merged
Conversation
Three residuals of the /model restructure, all found reading the surrounding code during L97. CLAUDE_CODE_MAX_CONTEXT_TOKENS was written only when this host resolved a local window, so a computer with no engine wrote nothing at all — and Claude Code then assumed its own 200k default AND showed "isn't described by this version's model catalog" on every Waired row, which is the notice the variable exists to suppress. Every row such a host offers is a peer row, so a peer's window is not an approximation of something better; it is the only honest number available. WriteOptions and RemoveOptions gain a PeerContextWindow used only when the local one is 0, and both go through DeclaredContextWindow() so a scrub recognises exactly what a write would have put there. Smallest reachable window, not largest: the number sizes one session and the rows it covers are several computers, so over-declaring means a turn is compacted only after the gateway has already refused it. Nothing reachable still writes nothing — declining beats guessing about what an elevated process tells Claude Code. The general "one number for rows that hold different windows" question is settled as leave it, recorded rather than changed: the variable is a compaction hint, and what actually refuses an over-long prompt is this gateway's own 400. KindClaudeNodeChange and KindClaudeNodeFallback have had no producer since #1198 removed the anthropic-route degrade and the per-class routes. Both repositories were checked for readers: none in code, two mentions in the private dev-docs, which follow separately. Fixes #1246 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJUUSmAfbRdjER1seDdjXm Signed-off-by: gen16k <gen16k@users.noreply.github.com>
|
📘 Docs preview — the preview channel for this PR has been deleted now that it is closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three residuals of the
/modelrestructure (#1185, #1177, #1186, #1187), allfound reading the surrounding code during L97 and filed rather than fixed in
passing. Each is answered here, so the issue closes whole.
1. A computer with no engine declares a window it can reach
This is the part #1246 calls "a real gap rather than a trade-off, and the one
part of this worth fixing regardless of which direction the rest goes".
CLAUDE_CODE_MAX_CONTEXT_TOKENSwas written only when this host resolved alocal window. On a computer with no engine of its own that number is 0, so
nothing was written at all — and Claude Code then did two things:
"waired/peer" isn't described by this version's model catalogoneach of them.
That second one is exactly what the variable exists to suppress (measured on
2.1.261 during L97: with the variable present the notice is gone, and the
Prompt is too longclassification still works).Every row such a host offers is a peer row, so a peer's window is not an
approximation of something better — it is the only honest number available.
WriteOptionsandRemoveOptionsgainPeerContextWindow, used only whenthe local window is 0, and both go through
DeclaredContextWindow()so ascrub recognises exactly what a write would have put there. Without that
second half, a value written from a peer's window would survive
waired claude disableand go on steering every session that starts on thatcomputer — the shape #1174 warns about.
Smallest reachable window, not largest: the number sizes one session and
the rows it covers are several computers, so over-declaring means a turn is
compacted only after the gateway has already refused it, which is the one
outcome the variable is there to avoid. Nothing reachable still writes
nothing, the same rule
claudeLocalWindowFromModelsfollows — this decideswhat an elevated process tells Claude Code about a window, so declining beats
guessing.
2. One number for rows that hold different windows — settled as leave it
Recorded rather than changed
(
docs/decisions/20260906/0415-the-declared-window-falls-back-to-a-peers.md).The variable is a compaction hint; what actually refuses an over-long prompt
is this gateway's own 400, unified on
capability_rejected: prompt_too_longin#1187. Claude Code offers no documented way to declare a window per picker row
—
behavesAsmaps a row onto a known model's client-side handling, which is adifferent and coarser thing, and appears in no public settings reference. So
the current number stays right for the row most people use, and the rest is
the limit of what the client accepts.
3. Two event kinds with no producer
KindClaudeNodeChangeandKindClaudeNodeFallbackhave had no writer since#1198 removed the anthropic-route degrade and, with it, the per-class routes.
KindClaudeNodeFallback's own doc comment named the producer that is gone.#1246 deliberately left them alone because the ring is a shared surface, so
both repositories were checked before removing them: no readers in code,
and two mentions in the private dev-docs (the observability kind table and one
current-behaviour paragraph), which follow in a separate small PR there. The
dated records — the rc7 review-machine observation and
docs/decisions/20260802/0631— stay frozen; they are what was actually seenat the time.
KindPinnedPeerUnreachableis untouched: since #325 it is the only record of apin going down, and it is a different event.
Tests
internal/integration/claudemanaged/reachable_context_window_test.go(new):DeclaredContextWindow()as a table, including that a bigger peer windownever overrides a serving host's own; the engine-less write; the scrub
recognising a peer-derived value; and an operator's own value surviving it.
cmd/waired/claude_reachable_window_test.go(new): driven through the realfetch against an
httptestlistener rather than a swapped seam, so the routeand the parsing are exercised too. Covers the smallest of several, peers that
are not serving, a peer that declares no window, an empty mesh, and an
unreachable daemon.
Docs
guides/claude-code.mdx(+ja) said the limit Claude Code works to "is the onethis computer's engine holds". That is now incomplete, and one sentence says
what an engine-less computer passes on instead.
Checks
go build ./...,go test ./...,gofmt -l,golangci-lint run --max-same-issues=0, the decision-log guard, andi18n-pair-guard.sh.Fixes #1246
Refs waired-ai/waired#1313
🤖 Generated with Claude Code
https://claude.ai/code/session_01HJUUSmAfbRdjER1seDdjXm