Skip to content

[WRONG BRANCH] fix(devin): preserve account-specific effort ladders - #527

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-effort-ladder-overwrite-issue
Draft

luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-effort-ladder-overwrite-issue

Conversation

@luvs01

@luvs01 luvs01 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The provider-wide degraded-mode reasoning ladder could overwrite per-account Devin discovery, causing clients to advertise effort rungs a live account did not expose and producing incorrect routing when users selected those rungs.
  • The change restores the catalog authority flow so measured per-model ladders from a signed-in Devin account remain authoritative while allowing explicit per-model operator overrides to keep highest precedence.

Description

  • Add a helper buildDevinLiveCatalogEntry in src/codex/catalog/provider-fetch.ts that applies live-discovered context windows and measured efforts while avoiding replacement by provider-wide degraded fallbacks.
  • Replace the inline live-row construction in the Devin discovery branch with calls to buildDevinLiveCatalogEntry so live account evidence is preserved.
  • Add regression tests in tests/providers/devin-effort-ladder.test.ts to cover the precedence: live-account rungs win over provider fallback, and explicit modelReasoningEfforts still override discovery.
  • Update documentation and structure notes (docs-site/src/content/docs/reference/adapters.md, structure/*.md) to record that Devin live-discovered ladders are authoritative and the degraded/provider defaults are only for signed-out or failed-discovery cases.

Testing

  • Ran focused Devin tests: bun test tests/providers/devin-effort-ladder.test.ts tests/providers/devin-adapter.test.ts, both passed (49 tests, 0 failures).
  • Ran typecheck (bun run typecheck), structure SSOT (bun run structure:check) and privacy scan (bun run privacy:scan), all passed, and rebuilt docs (cd docs-site && bun install --frozen-lockfile && bun run build) which succeeded.
  • git diff/format checks and bun run privacy:scan were clean for the changeset.
  • The full bun run test run exercised the whole suite but surfaced many unrelated environment/concurrency failures and one error outside the modified area; the focused Devin regression suite is green and validates the fix.

Codex Task

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b80280a8-fbf1-40ad-b98b-e6dcfd8330ec


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T01:03:59.038851Z 9f9e167 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f9e167259

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1769 to +1774
return buildDevinLiveCatalogEntry(
name,
prov,
id,
provider: name,
...(liveWindow ? { contextWindow: liveWindow } : {}),
// The account catalog names the effort variants each base model has, so
// its ladder is measured rather than assumed. Without this the entry
// inherits the generic routed ladder and offers rungs the model rounds
// away, and every client that keys an effort control off this field —
// the Pi-shaped exports — renders no control at all.
...(liveResult.efforts[id]?.length ? { reasoningEfforts: liveResult.efforts[id] } : {}),
...catalogHintsFromProviderConfig(name, prov, id, contextCap, metadataModelIdCaseFold, captured.effectiveAlias),
} as CatalogModel;
liveWindow,
liveResult.efforts[id],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve live ladders on cached Devin reads

When a later catalog gather hits cachedDevin, the cached rows are passed through applyConfigHintsToCachedModels, whose configuredReasoningEfforts call reapplies prov.reasoningEfforts and overwrites the account ladder stored by this new builder. Consequently, only the first return after discovery preserves the measured rungs; ordinary reads during the cache TTL advertise the degraded provider-wide ladder again. The cached path needs the same Devin-specific precedence handling.

Useful? React with 👍 / 👎.

Comment on lines +904 to +906
// A per-model setting is an operator override. The provider-wide value is
// only a degraded-mode fallback, so live account evidence supersedes it.
...(liveEfforts?.length && modelEfforts === undefined ? { reasoningEfforts: liveEfforts } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear the fallback when discovery exposes no ladder

When a successful account catalog exposes zero or only one reasoning variant for a base model, fetchDevinUsableModels intentionally omits that model from efforts because there is no useful control. Here, an undefined/empty liveEfforts skips the final spread and leaves hinted.reasoningEfforts set to the provider-wide fallback, so the live result advertises choices the account did not expose. Successful discovery should explicitly suppress the fallback for this case.

Useful? React with 👍 / 👎.

Comment on lines +898 to +906
const modelEfforts = modelRecordValue(prov.modelReasoningEfforts, id);
return {
id,
provider: name,
...(liveWindow ? { contextWindow: liveWindow } : {}),
...hinted,
// A per-model setting is an operator override. The provider-wide value is
// only a degraded-mode fallback, so live account evidence supersedes it.
...(liveEfforts?.length && modelEfforts === undefined ? { reasoningEfforts: liveEfforts } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor noReasoningModels before applying live efforts

Checking only modelReasoningEfforts misses the existing per-model noReasoningModels override: catalogHintsFromProviderConfig correctly produces reasoningEfforts: [] for such a model, but this final spread replaces it with the discovered ladder. A Devin model explicitly configured to reject reasoning therefore regains an effort picker after successful discovery; the previous hints-last ordering preserved that configuration. Treat this explicit disable as authoritative as well.

AGENTS.md reference: src/AGENTS.md:L10-L10

Useful? React with 👍 / 👎.

@github-actions github-actions Bot added the bug Something isn't working label Sep 14, 2026
@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title fix(devin): preserve account-specific effort ladders [WRONG BRANCH] fix(devin): preserve account-specific effort ladders Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft September 14, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant