Skip to content

Commit e97ed7a

Browse files
authored
fix(devin): fold counter-read findings into the propagation layer (#4557)
The adversarial counter-read of 5d95dbf returned two should-fix findings and one nit, all folded here: the advertised-catalog tests now stub globalThis.fetch to throw, so a seeded-cache miss fails the test instead of dialling Cognition; the catalog.md precedence sentence is scoped to inputModalities (live contextWindow and reasoningEfforts have their own configured sources and the broader claim was not literally true) and moved out of the TTL paragraph; and the registry.md collapse wording covers the whole EFFORT_TOKENS suffix set rather than only effort variants.
1 parent 72335fc commit e97ed7a

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎structure/adapters/registry.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ Some adapters share another adapter's routed-tool semantics while retaining inde
5656
`ClientModelConfig` field #4 as the per-account disabled gate, field #18 as the per-account
5757
context window, and field #5 as an optional `supportsImages` tri-state — a present value
5858
asserts image support or its absence, while an omitted field stays unknown (the #1796
59-
precedent). `src/adapters/devin/live-models.ts` collapses that tri-state across each base
60-
model's effort variants: unmeasured rows abstain, unanimous measured rows advertise
59+
precedent). `src/adapters/devin/live-models.ts` collapses that tri-state across the
60+
rows each base model's collapsed UID gathers — the EFFORT_TOKENS suffixes, tier rows
61+
like `-1m` included: unmeasured rows abstain, unanimous measured rows advertise
6162
`["text"]` or `["text", "image"]`, and measured disagreement stays unadvertised.
6263

6364
The registry records those relationships with `contractParent`. A parent relationship does **not** mean the registry recursively constructs a parent adapter and injects it into the child. Azure and MiMo keep owning their existing internal composition. This avoids making production constructors depend on test/conformance needs and keeps this authority refactor behavior-neutral.

‎structure/catalog.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ Provider live-model lists are cached with a configured TTL (`src/codex/model-cac
9595
deleting, or editing a provider's shape clears that per-provider cache; a disabled-only change
9696
deliberately does not, because a disabled provider is already excluded from the catalog gather
9797
instead. Codex's own `models_cache.json` is a different cache, invalidated by catalog refresh.
98-
A Devin live row spreads its measured `contextWindow`, `reasoningEfforts` and
99-
`inputModalities` before `catalogHintsFromProviderConfig`, so exact `modelCapabilities`
100-
declarations, the legacy `modelInputModalities` record and the vision-sidecar rewrite keep
101-
precedence and a live value survives only when none of them applies.
98+
99+
A Devin live row spreads its measured `inputModalities` before
100+
`catalogHintsFromProviderConfig`, so exact `modelCapabilities` declarations, the legacy
101+
`modelInputModalities` record and the vision-sidecar rewrite keep precedence and the live
102+
value survives only when none of them applies.
102103

103104
For `liveModels: false`, a static provider publishes the ordered union of `models` and
104105
`retainModels`. When `models` is absent or empty, its configured `defaultModel` seeds that

‎tests/providers/devin-live-models.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ function seedCatalog(...entries: Buffer[]): void {
4545
));
4646
}
4747

48+
// A cache miss must fail the test, never dial Cognition: every case here is
49+
// supposed to be served by the seeded catalog, so the network is a bug.
50+
let realFetch: typeof globalThis.fetch;
4851
beforeEach(() => {
52+
realFetch = globalThis.fetch;
53+
globalThis.fetch = (() => {
54+
throw new Error("devin-live-models.test.ts reached the network — the seeded catalog cache missed");
55+
}) as typeof globalThis.fetch;
4956
setCachedCatalogForTests(null);
5057
clearModelCache("devin-test");
5158
providerCacheGenerations.delete("devin-test");
5259
});
5360
afterEach(() => {
61+
globalThis.fetch = realFetch;
5462
setCachedCatalogForTests(null);
5563
clearModelCache("devin-test");
5664
providerCacheGenerations.delete("devin-test");

0 commit comments

Comments
 (0)