Skip to content

fix(cursor): preserve mixed-case effort aliases - #5084

Open
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:agent/effort-alias-case-20260919
Open

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:agent/effort-alias-case-20260919

Conversation

@luvs01

@luvs01 luvs01 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Motivation

The effort-row parser runs before normal model routing and used case-sensitive membership checks. A configured alias like Sensitive--high requested as sensitive--high was not recognized as a known id, so it was parsed as a synthetic effort row and misrouted — potentially off the configured provider, which is a credential-isolation boundary, not just a 404.

Description

  • isKnownId now also matches the lowercase form, and knownEffortRowIds registers each alias together with its lowercase form — the same case-insensitive contract ordinary alias routing already uses.

Tests

  • bun test tests/providers/cursor/cursor-effort-rows.test.ts — covers a mixed-case configured alias requested in lowercase staying on its configured provider.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed mixed-case model aliases so they resolve correctly instead of being mistaken for synthetic effort rows.
    • Requests using these aliases now route to the configured provider and target model across supported response and messaging APIs.
  • Tests
    • Added coverage for mixed-case aliases and provider routing behavior.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: cdd8f096-299c-494d-bcfd-02a72780ce70

📥 Commits

Reviewing files that changed from the base of the PR and between 3d5efc7 and 2f5110a.

📒 Files selected for processing (2)
  • src/server/effort-row.ts
  • tests/providers/cursor/cursor-effort-rows.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change makes effort-row alias recognition case-insensitive and adds coverage for mixed-case aliases across Responses, Chat Completions, and Claude Messages routing.

Changes

Effort alias resolution

Layer / File(s) Summary
Case-insensitive alias registration
src/server/effort-row.ts
At lines 33–35, isKnownId checks both the original id and its lowercase form. At lines 48–53, knownEffortRowIds adds both forms for each alias. Lines 65–66 apply this behavior to regular and namespaced aliases.
Mixed-case routing validation
tests/providers/cursor/cursor-effort-rows.test.ts
Lines 285–359 verify that sensitive--high resolves to private-model through all three handlers, uses the configured provider, returns status 200, and does not use the fallback provider.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2f511

Mixed-case effort aliases retain their configured provider routing across supported request formats. The change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving mixed-case Cursor effort aliases. It matches the implementation and added test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

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

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun @Ingwannu

@github-actions
github-actions Bot marked this pull request as ready for review September 18, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant