better-auth-fix-api-return-response

Based on#7521
SegmentInvestigate-and-fix
Typebug
## Task

our oauth/oidc endpoints are coming back wrong when the framework adapters forward an HTTP request to them. the body ends up wrapped like `{ response: { ... } }` instead of the actual oauth payload. `Set-Cookie` is missing too.

spec-strict OAuth clients are rejecting the shape. weirdly, the same endpoints look fine when our internal plugin code calls them without an HTTP request in hand. can we fix this? needs to be generic, not path-scoped.

## General instructions

- The code repo is at /repo/better-auth.
- You are inside of a Docker container. You may not be able to perform all operations you would normally be able to do on a local machine. Dependencies have not been pre-installed, and you may need to install them yourself.
- You are expected to act autonomously as a software engineer to complete tasks you are given.
- Do not stop until you feel you have completed the task and your code changes can be merged.
- You may need to use software engineering skills like analyzing the codebase, researching technologies, running services, analyzing logs, etc. to complete the task. Not all tasks will be solvable by reading source code alone.

Agent Results

AgentTastefulBasicVerifierValidationRubricBloatPractTasteCheated
Oracle
4/41.0x5.04.0
Gemini 3.1 Pro
4/45.9x2.02.0
GPT-5.4
4/417.0x4.03.0
Opus 4.7
4/43.5x2.02.0
Opus 4.8
4/410.9x2.03.0
Sonnet 4.6
4/43.0x3.03.0
Gemini 3.5 Flash
2/41.5x3.02.0
GLM-5.2
1/47.6x4.02.0
GPT-5.5
1/410.4x4.03.0
Kimi K2.6
1/40.3x2.01.0
Sonnet 5
1/43.5x3.03.0
No-Op
1/4
Agent details

Verifier Tests

Gemini 3.1 Pro4/4

Taste Scores

Patch Bloat5.9x
47 agent / 8 oracle SLOC, 2 / 1 files(raw: 45.6x)
Practice Alignment — 2.0/5
2
style consistency
2
pattern adherence
3
library usage
2
abstraction level
3
documentation fit
Relative Taste — 2.0/5
1
minimality
2
approach quality
2
hygiene
2
fluency
2
craftsmanship

Agent Patch