Skip to content

fix(ci): document OMNIROUTE_STRIP_SYSTEM_PREAMBLE — the env/docs base red blocking every PR - #14022

Merged
diegosouzapw merged 3 commits into
release/v3.8.51from
fix/release-v3.8.51-basereds-env-xkiro
Sep 18, 2026
Merged

diegosouzapw merged 3 commits into
release/v3.8.51from
fix/release-v3.8.51-basereds-env-xkiro

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Base-red repair for release/v3.8.51 — documentation only, no behavior change.

The red

Docs sync + fabricated-docs (strict) fails on the base tip and therefore on every open PR
(tracked in #14004):

✗ In code but missing from .env.example: 1
   - OMNIROUTE_STRIP_SYSTEM_PREAMBLE
✗ Env / docs contract is out of sync.

Reproduced against a clean release/v3.8.51 checkout with no local changes.

The gap

OMNIROUTE_STRIP_SYSTEM_PREAMBLE is read at
open-sse/translator/response/openai-to-claude.ts:413 and gates the system-echo preamble
stripper in open-sse/utils/directivePreambleStripper.ts, but it was never added to
.env.example / docs/reference/ENVIRONMENT.md.

The fix

Documented in both, next to its sibling OMNIROUTE_SYSTEM_INSTRUCTION_APPEND, with the default
(0, off) and the reason it is opt-in: the stripper matches by English-prose heuristics and does
mutate the response payload, so a reply that legitimately opens with such a section would lose it.

After: ✓ Env / docs contract is in sync.

Note: the file-size ratchet drift on src/sse/handlers/chatHelpers.ts listed in #14004 is
non-blocking and rebaselined at release — not touched here.

diegosouzapw added a commit that referenced this pull request Sep 17, 2026
Another session opened #14022 documenting OMNIROUTE_STRIP_SYSTEM_PREAMBLE in
the same two files. That PR has a live worktree, so per the cross-session rule
it owns the fix; this one keeps only the file-size rebaseline, which #14022
does not carry.
This was referenced Sep 17, 2026
diegosouzapw and others added 2 commits September 18, 2026 03:51
…constant

The env/docs contract gate had a SECOND violation on the release tip, added after
this branch was cut: #13857's comboTimeoutMs narrative in ENVIRONMENT.md cites
COMBO_LOOP_SAFETY_TIMEOUT_MS, which is a source constant
(open-sse/services/combo/comboPredicates.ts:35 — `10 * 60 * 1000`), not an
operator-facing env var. The doc regex captured the SHOUTY_NAME and reported it
as documented-but-missing-from-.env.example.

DOC_ONLY_ALLOWLIST already exists for exactly this class (see CLI_COMPAT_OMITTED_PROVIDER_IDS,
LOCAL_ONLY_API_PREFIXES, VACUUM). Gate now reports all three directions in sync.
@diegosouzapw

Copy link
Copy Markdown
Collaborator Author

Validated in local merge-train /tmp/mt-basereds.log on 192.168.0.113 @ train tip c2fb6404606064c56520d7b2a148e8770dc70cd0 (boarded #14022 #14016 #14079 #14082): static gates green; test:unit 40635 tests, 17 failing — every one reproduces on the pure release tip 1603c86 (41 failing there; list in the base-red sweep), zero new reds. Merged with --admin per merge-gates §4/§7 (inherited base-reds only).

@diegosouzapw
diegosouzapw merged commit 94aa978 into release/v3.8.51 Sep 18, 2026
15 of 21 checks passed
diegosouzapw added a commit that referenced this pull request Sep 18, 2026
…rride (#13870) (#14046)

filterTargetsByRequestCompatibility ranked combo targets solely on the
chars/4 estimateTokens() heuristic. On a repetitive agent-session body the
estimate overstates real usage several-fold, so a manually-overridden
primary sized correctly for the real request got marked context-incompatible
and was reordered behind an unconfirmed catalog "emergency" member with a
large but unverified limit_context.

Fix: when the reorder branch promotes known-context-compatible targets,
split them by whether their pass came from an operator-set
model_context_override (trusted) or bare catalog metadata (advisory), and
also trust a near-boundary override rejection (required tokens within 5x
the override — covering the ~3.7x overestimate the issue measured) over a
catalog-only pass. An override target keeps or regains priority over an
unconfirmed catalog-only "known compatible" target; two override targets or
two catalog-only targets keep resolving purely on their own fit as before.

Regression test: tests/unit/combo-13870-chars4-overdrops-override-primary.test.ts
(RED before the fix — emergency member promoted to position 0 ahead of the
override primary; GREEN after).

⚠️ base-red inherited: #14004 — docs env/docs contract (fixed separately in
#14022), chatHelpers file-size drift. Not touched by this branch.
diegosouzapw added a commit that referenced this pull request Sep 18, 2026
…budget (#13703) (#14047)

resolveDirectHeadersTimeoutMs() (open-sse/utils/directResponseStartTimeout.ts)
now bounds only the pooled dispatcher attempt (attempt 0) with the flat
OMNIROUTE_DIRECT_HEADERS_TIMEOUT_MS watchdog. The fresh-socket retry (attempt
1) is by construction a brand-new socket with no zombie-socket risk (#10214's
rationale only applies to the pooled attempt), so when the caller already
attached its own deadline signal it now defers to a generous, configurable
backstop (OMNIROUTE_DIRECT_RESPONSE_RETRY_TIMEOUT_MS, default 600s) instead of
reusing the identical short flat window — fixing spurious 504s on healthy
slow-TTFB reasoning models that need well over 60s total for both attempts.

Regression test: tests/unit/proxyfetch-direct-response-start-flat-retry-budget-13703.test.ts
(RED against unmodified code: retry cut at 81ms against an 80ms flat budget
with ~1920ms of caller deadline unused; GREEN after the fix).

New env var documented in .env.example and docs/reference/ENVIRONMENT.md.

tlsProfileForProvider's return type in proxyFetch.ts is pulled into a named
alias so its signature stays on one line under prettier's canonical
formatting -- otherwise prettier's mandatory lint-staged reformat of this
frozen file grows it past the check:file-size baseline on every future touch.

base-red inherited: #14004 (docs env/docs contract, fixed separately in
#14022; chatHelpers file-size drift)
HouMinXi added a commit to HouMinXi/OmniRoute that referenced this pull request Sep 20, 2026
cheaper-inference#14022 already documented OMNIROUTE_STRIP_SYSTEM_PREAMBLE and
allowlisted COMBO_LOOP_SAFETY_TIMEOUT_MS. The remaining mismatch is
the ENVIRONMENT.md sentence that still backticks the constant as if
it were operator-facing.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
diegosouzapw pushed a commit that referenced this pull request Sep 22, 2026
#14022 already documented OMNIROUTE_STRIP_SYSTEM_PREAMBLE and
allowlisted COMBO_LOOP_SAFETY_TIMEOUT_MS. The remaining mismatch is
the ENVIRONMENT.md sentence that still backticks the constant as if
it were operator-facing.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
… red blocking every PR (cheaper-inference#14022)

* fix(ci): document OMNIROUTE_STRIP_SYSTEM_PREAMBLE (env/docs contract base-red)

* fix(ci): allowlist COMBO_LOOP_SAFETY_TIMEOUT_MS as a doc-only source constant

The env/docs contract gate had a SECOND violation on the release tip, added after
this branch was cut: cheaper-inference#13857's comboTimeoutMs narrative in ENVIRONMENT.md cites
COMBO_LOOP_SAFETY_TIMEOUT_MS, which is a source constant
(open-sse/services/combo/comboPredicates.ts:35 — `10 * 60 * 1000`), not an
operator-facing env var. The doc regex captured the SHOUTY_NAME and reported it
as documented-but-missing-from-.env.example.

DOC_ONLY_ALLOWLIST already exists for exactly this class (see CLI_COMPAT_OMITTED_PROVIDER_IDS,
LOCAL_ONLY_API_PREFIXES, VACUUM). Gate now reports all three directions in sync.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…rride (cheaper-inference#13870) (cheaper-inference#14046)

filterTargetsByRequestCompatibility ranked combo targets solely on the
chars/4 estimateTokens() heuristic. On a repetitive agent-session body the
estimate overstates real usage several-fold, so a manually-overridden
primary sized correctly for the real request got marked context-incompatible
and was reordered behind an unconfirmed catalog "emergency" member with a
large but unverified limit_context.

Fix: when the reorder branch promotes known-context-compatible targets,
split them by whether their pass came from an operator-set
model_context_override (trusted) or bare catalog metadata (advisory), and
also trust a near-boundary override rejection (required tokens within 5x
the override — covering the ~3.7x overestimate the issue measured) over a
catalog-only pass. An override target keeps or regains priority over an
unconfirmed catalog-only "known compatible" target; two override targets or
two catalog-only targets keep resolving purely on their own fit as before.

Regression test: tests/unit/combo-13870-chars4-overdrops-override-primary.test.ts
(RED before the fix — emergency member promoted to position 0 ahead of the
override primary; GREEN after).

⚠️ base-red inherited: cheaper-inference#14004 — docs env/docs contract (fixed separately in
cheaper-inference#14022), chatHelpers file-size drift. Not touched by this branch.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…budget (cheaper-inference#13703) (cheaper-inference#14047)

resolveDirectHeadersTimeoutMs() (open-sse/utils/directResponseStartTimeout.ts)
now bounds only the pooled dispatcher attempt (attempt 0) with the flat
OMNIROUTE_DIRECT_HEADERS_TIMEOUT_MS watchdog. The fresh-socket retry (attempt
1) is by construction a brand-new socket with no zombie-socket risk (cheaper-inference#10214's
rationale only applies to the pooled attempt), so when the caller already
attached its own deadline signal it now defers to a generous, configurable
backstop (OMNIROUTE_DIRECT_RESPONSE_RETRY_TIMEOUT_MS, default 600s) instead of
reusing the identical short flat window — fixing spurious 504s on healthy
slow-TTFB reasoning models that need well over 60s total for both attempts.

Regression test: tests/unit/proxyfetch-direct-response-start-flat-retry-budget-13703.test.ts
(RED against unmodified code: retry cut at 81ms against an 80ms flat budget
with ~1920ms of caller deadline unused; GREEN after the fix).

New env var documented in .env.example and docs/reference/ENVIRONMENT.md.

tlsProfileForProvider's return type in proxyFetch.ts is pulled into a named
alias so its signature stays on one line under prettier's canonical
formatting -- otherwise prettier's mandatory lint-staged reformat of this
frozen file grows it past the check:file-size baseline on every future touch.

base-red inherited: cheaper-inference#14004 (docs env/docs contract, fixed separately in
cheaper-inference#14022; chatHelpers file-size drift)
@diegosouzapw
diegosouzapw deleted the fix/release-v3.8.51-basereds-env-xkiro branch October 18, 2026 23:50
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