Skip to content

comments: the retired Claude auto route is described as retired (#1358) - #1361

Merged
gen16k merged 1 commit into
mainfrom
fix/1358-retired-claude-comments
Sep 13, 2026
Merged

gen16k merged 1 commit into
mainfrom
fix/1358-retired-claude-comments

Conversation

@gen16k

@gen16k gen16k commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Motivation

#1358。L97(waired-ai/waired#1313)で auto ルート・post-dispatch フォールバック・reroute notice・X-Waired-Fallback / X-Waired-Fallback-Allowed・Stop フックの通知・gateway-models.json 書込と discovery フラグ・waired/subagent ラベルは撤去された(#1183#1188、決定 docs/decisions/20260903/0333-no-automatic-crossing-to-or-from-anthropic.md)。コードのコメント 15 か所がそれらを現在の挙動として説明したままで、そのコメントだけ読んだ読者は機構が今も動いていると誤解する。

Work performed

コメントのみ 16 ファイル。今の挙動(ピアを名指した 4xx で終わる、どこにも回さない)を現在形で書き、形の理由が歴史にあるところは過去形にして撤去 PR を添えた。

ファイル 直した点
internal/integration/claudemanaged/hook.go 冒頭: 今書くのは SessionStart の 1 件。Stop フックは撤去済みで、定数は剥がすために残る
internal/integration/claudemanaged/managedsettings.go 冒頭: discovery フラグは書かず剥がすだけ。超過 400 は capability_rejected トークン。directive id は waired/*
internal/gateway/server.go ResolveUnknownModel / TTFBBudget の doc: fallback replay と X-Waired-Fallback-Allowed ゲートの記述を撤去、pinned 脚も対象
internal/gateway/probe.go HeaderLocalErrorLocalError* 6 件の doc: 「auto mode が reroute する」「intercept に複製あり」を撤去(#1198 で intercept のミラーは消えている)
internal/gateway/anthropic.go classifyEngineFailure / 超過ガード / proxyAnthropicStream / relayPeerContextOverflow の doc
internal/gateway/anthropic_models.go max_input_tokens は discovery が読む欄だが waired はもう discovery を有効にしない
internal/gateway/peerwait.go / internal/router/endpoint_router.go 「reroute notice に載る」→ 人が読むエラーに載る
internal/agentconfig/config.go ClaudeTTFBBudget* / ClaudePeerWaitCeilingMs の doc
cmd/waired-agent/inference.go HandlerSet の doc(クラスは X-Claude-Code-Agent-Id ヘッダから、waired-agent#1186)、TTFB 予算、503 + Retry-After
internal/proxy/intercept/server.go OnServed / observeLocalModel / Flush の doc から dispatchAuto / fallbackRecorder を撤去
internal/gui/tray/state.go ピン切れの説明
internal/e2e/integration/{harness,budget,legs}.go fail-open replay と X-Waired-Fallback を過去形に

コードが変わるのは 1 か所だけ: internal/agentgrade/probe.go が撤去済みの X-Waired-Fallback ヘッダを読んでエラー文に「did not stay local」を出していた(死んだ読取)。フィールド・読取・そのヘッダを立てるテスト TestRun_failOpenMarkerSurfaces を消した。probe が叩くローカルゲートウェイには外へ出る passthrough が無い。

Results / verification

  • go build ./...GOOS=windows / GOOS=darwin で触ったパッケージのビルド、go vet 9 パッケージ、golangci-lint run 6 パッケージ 0 issues
  • go test -count=1 agentgrade / intercept / claudemanaged / agentconfig / gateway: 全 ok
  • 実機不要(コメントと死んだ読取の削除のみ)

docs-not-needed: コメントと、何も立てないヘッダの死んだ読取の削除だけで、ユーザーが読む面(tray の文言・CLI 出力・docs-site)は 1 文字も変わらない

Refs

🤖 Generated with Claude Code

https://claude.ai/code/session_01RiDigZqYQR62KtoUukmehu

@gen16k
gen16k force-pushed the fix/1358-retired-claude-comments branch from d167450 to 9e9f47f Compare September 13, 2026 17:46
L97 (waired-ai/waired#1313) retired the auto route, the post-dispatch
fallback and its reroute notice, the X-Waired-Fallback /
X-Waired-Fallback-Allowed headers, the Stop hook notice, the
gateway-models.json cache write with its discovery flag, and the
waired/subagent label (#1183-#1188, decision
docs/decisions/20260903/0333-no-automatic-crossing-to-or-from-anthropic.md).
Fifteen comments still explained one of those as today's behaviour, and
a reader of that comment alone would take the mechanism for live:

- claudemanaged/hook.go and managedsettings.go headers said waired
  installs the Stop hook and co-writes the discovery flag;
- gateway/server.go, probe.go, anthropic.go, anthropic_models.go,
  peerwait.go and agentconfig/config.go said a pre-commit abort makes
  "auto mode reroute the turn", that TTFB budgets are armed only behind
  the X-Waired-Fallback-Allowed gate, that the over-window 400 copies
  Anthropic's wording, and that discovery reads max_input_tokens;
- cmd/waired-agent/inference.go said the class comes from the
  managed-settings subagent label and that a stalled peer reroutes;
- proxy/intercept/server.go listed dispatchAuto's fallbackRecorder as a
  writer shape; router/endpoint_router.go and gui/tray/state.go named
  the reroute notice and the auto route;
- the e2e harness (harness.go, budget.go, legs.go) described the
  fail-open replay and the X-Waired-Fallback evidence as current.

Each is rewritten to say what happens now (a 4xx that names the peer,
no reroute) and, where the history explains the shape, to say so in the
past tense with the retiring PR. The one piece of code that changes is
internal/agentgrade/probe.go: it read the X-Waired-Fallback header,
which nothing sets any more, into an error-message marker. The field,
the read and the test that staged the header are removed; the local
gateway the probe drives has no passthrough to leave through.

Fixes #1358

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RiDigZqYQR62KtoUukmehu
Signed-off-by: gen16k <gen16k@users.noreply.github.com>
@gen16k
gen16k force-pushed the fix/1358-retired-claude-comments branch from 9e9f47f to 5a1d2a2 Compare September 13, 2026 18:36
@gen16k
gen16k merged commit 9041dba into main Sep 13, 2026
33 checks passed
@gen16k
gen16k deleted the fix/1358-retired-claude-comments branch September 13, 2026 19:00
gen16k added a commit that referenced this pull request Sep 13, 2026
…and counted where they are assigned (#1354) (#1382)

* gateway(:9473): the dispatch log names the traffic class, as the Anthropic surface's does

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014oG6PZ535CDWwjXpoo6hNB
Signed-off-by: gen16k <gen16k@users.noreply.github.com>

* routing: requests that arrive together are ranked one after another, and counted where they are assigned

Claude Code launches its subagents within a few milliseconds of each other,
and every one of a measured burst was ranked before the first committed: the
congestion term (capacity_used + 1) saw none of its siblings. Four of six
landed on the requester's own one-slot engine and ran in turn for up to
371 s, while a two-slot peer ranked just below it stayed idle. The same six
sent 50 ms apart spread 1/1/2/2 (#1354).

The probe round now ranks through Selector.SelectKAssigned: the ranking runs
under a lock shared by every Selector the provider builds (router.Assignments),
and the first candidate's count is taken before the lock is released —
LocalInFlight for a peer, Assignments for this device's own engine, which is
never refused. The congestion term reads the larger of the observed
capacity_used and this requester's outstanding count. Probes still run in
parallel outside the lock, and the best-ranked ready candidate still wins; a
first choice that was not committed gives its count back through
Candidate.Abandon, without having touched the sticky store or a public grant.

The owner decision is recorded in
docs/decisions/20260914/0420-assignment-is-counted-when-it-is-made.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014oG6PZ535CDWwjXpoo6hNB
Signed-off-by: gen16k <gen16k@users.noreply.github.com>

* gateway: fallbackReason uses probeReasonCapacityFull, which #1361 named

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014oG6PZ535CDWwjXpoo6hNB
Signed-off-by: gen16k <gen16k@users.noreply.github.com>

---------

Signed-off-by: gen16k <gen16k@users.noreply.github.com>
Co-authored-by: gen16k <gen16k@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 16, 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.

comments: the retired Claude auto route, fallback headers and discovery flag are still described as current behaviour

1 participant