fix(server): restore claude effort remapping and exclude perf tests from default scope#5
Merged
Berkay2002 merged 1 commit intomainfrom Apr 17, 2026
Conversation
…rom default scope Cherry-pick drift from d81e41c: ClaudeAdapter never remapped unsupported or prompt-injected effort levels to a model-supported tier. For Claude Sonnet 4.6 a request for "max" or "ultrathink" silently fell back to the model default ("medium") instead of capping to the highest supported non-prompt-injected level ("high"); ultrathink also lost its "Ultrathink:\n" prompt prefix path because callers saw `null` effort. Replace the post-resolveEffort `getEffectiveClaudeCodeEffort` helper with a caps-aware version that: - passes supported, non-prompt-injected efforts through unchanged - falls back to the model default when no effort is requested - caps unsupported or prompt-injected efforts ("max", "ultrathink") to the highest supported non-prompt-injected level The existing prompt-prefix path in `buildPromptText` already handles the "Ultrathink:\n" injection from the raw effort, so it now works end-to-end once the effort assertion stops short-circuiting the test. Also exclude `integration/perf/**` from the default `bun run test` scope. The perf benchmarks run ~90s each and fail deterministically on shared CI hardware; opt back in via `bun run test:perf` (VITEST_PERF=1) which targets the folder explicitly.
There was a problem hiding this comment.
Pull request overview
Restores capability-aware Claude “effort” resolution (including correct handling of prompt-injected efforts like ultrathink) and adjusts the server’s Vitest configuration so wall-clock-sensitive perf benchmarks don’t run in the default test suite.
Changes:
- Reworked
ClaudeAdapter.getEffectiveClaudeCodeEffortto cap unsupported/prompt-injected efforts to the highest supported non-prompt-injected level. - Updated server Vitest config to exclude
integration/perf/**by default, with an opt-in viaVITEST_PERF=1. - Updated
test:perfscript to setVITEST_PERF=1so perf tests still run when explicitly requested.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/server/src/provider/Layers/ClaudeAdapter.ts | Makes effort selection capability-aware and preserves prompt-injected effort behavior while choosing a safe API effort value. |
| apps/server/vitest.config.ts | Excludes perf tests from default runs and gates inclusion behind VITEST_PERF=1, preserving Vitest default excludes. |
| apps/server/package.json | Updates test:perf to opt back into perf tests via VITEST_PERF=1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Berkay2002
added a commit
that referenced
this pull request
Apr 17, 2026
Resolve conflicts with PR #5 (restore claude effort remapping): - Adopt main's new getEffectiveClaudeCode/AgentEffort signature (caps, rawEffort) with capability-aware remapping, while keeping our rename to ClaudeAgentEffort. - Drop the pre-computed resolveEffort variable; the new function subsumes it. - Revert test assertions back to "high" now that the remapping caps to the top supported non-prompt-injected level.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ClaudeAdapter.getEffectiveClaudeCodeEffort(cherry-pick drift from d81e41c) so unsupported or prompt-injected efforts cap to the highest supported non-prompt-injected level instead of silently falling back to the model default.effort: "max"oreffort: "ultrathink"now resolves to"high"(was"medium"), and"ultrathink"keeps its"Ultrathink:\n"prompt prefix path intact via the existingbuildPromptTexthelper.integration/perf/**from the defaultbun run testscope;bun run test:perfopts back in viaVITEST_PERF=1so the explicitly-targeted perf script keeps working.Changes
apps/server/src/provider/Layers/ClaudeAdapter.ts: rewritesgetEffectiveClaudeCodeEffort(caps, rawEffort)to be capability-aware. Drops the now-unusedresolveEffortimport in this file (the new helper handles everything).apps/server/vitest.config.ts: addsexclude: [...configDefaults.exclude, "integration/perf/**"](preserving vitest's default exclude), gated byVITEST_PERF=1sotest:perfstill discovers the perf folder.apps/server/package.json: prefixestest:perfwithVITEST_PERF=1to opt back into the perf folder.Verify
bun run typecheck— passes (8/8 packages).bun run test src/provider/Layers/ClaudeAdapter.test.ts— 57/57 passing (was 55/57 with the two effort tests failing).bun run test:perf— still discoversintegration/perf/**(verified viavitest list --filesOnly).Test plan
max/ultrathinkpaths produce the expectedeffortand prompt prefixhttps://claude.ai/code/session_01CCbLqcPV5imhah2QTotE1H