fix: preserve protocol parity across compatibility hops (#259)
* wip: preserve local changes before upstream merge * Improve proxy routing stability and add stable-first strategy * Sync explicit-group routing strategy to eligible source routes * Fix proxy retry and runtime health review issues * fix: make proxy channel retry attempts configurable * fix: harden proxy retry recovery and bookkeeping * fix: address pr 257 review comments * fix: preserve oe tool_result structure * fix: preserve protocol parity across compatibility hops * fix: satisfy server build and typecheck * fix: preserve codex and mcp fallback semantics * fix: address ci and review follow-ups --------- Co-authored-by: bnvnvnv <bnvnvnv@gmail.com>
This commit is contained in:
@@ -30,22 +30,11 @@ export const codexProviderProfile: ProviderProfile = {
|
||||
openAiBeta: getInputHeader(input.baseHeaders, 'openai-beta')
|
||||
|| (websocketTransport ? asTrimmedString(config.codexResponsesWebsocketBeta) : null),
|
||||
});
|
||||
const codexSessionId = getInputHeader(headers, 'session_id') || getInputHeader(headers, 'session-id');
|
||||
const shouldInjectDerivedPromptCacheKey = !!codexSessionId
|
||||
&& !asTrimmedString(input.body.prompt_cache_key)
|
||||
&& !asTrimmedString(input.codexExplicitSessionId)
|
||||
&& !!asTrimmedString(input.codexSessionCacheKey);
|
||||
const body = shouldInjectDerivedPromptCacheKey
|
||||
? {
|
||||
...input.body,
|
||||
prompt_cache_key: codexSessionId,
|
||||
}
|
||||
: input.body;
|
||||
|
||||
return {
|
||||
path: '/responses',
|
||||
headers,
|
||||
body,
|
||||
body: input.body,
|
||||
runtime: {
|
||||
executor: 'codex',
|
||||
modelName: input.modelName,
|
||||
|
||||
@@ -39,7 +39,11 @@ describe('resolveProviderProfile', () => {
|
||||
modelName: 'gpt-5.2-codex',
|
||||
stream: true,
|
||||
});
|
||||
expect(result.body.prompt_cache_key).toBe(result.headers.Session_id);
|
||||
expect(result.body).toEqual({
|
||||
model: 'gpt-5.2-codex',
|
||||
stream: true,
|
||||
store: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('builds claude provider requests without rebuilding protocol bodies', () => {
|
||||
|
||||
Reference in New Issue
Block a user