fix: propagate model-suffix/config effort to response streaming and harden affinity#603
Merged
Merged
Conversation
…arden affinity - wantReasoning/wantThinking now derived from codexRequest.reasoning?.effort after translation; previously only explicit client fields were checked, so effort injected via model suffix (e.g. gpt-5.4-high) or default_reasoning_effort config was sent upstream but the returned reasoning deltas were silently dropped - SessionAffinityMap stores instructions as SHA-256 hash instead of raw string to bound per-entry memory usage; implicit-resume comparison updated to match - developer role in Codex requests now mapped to system for OpenAI-compatible backends that reject the developer role; CodexInputItem type updated accordingly - Proxy host field now accepts a full URL directly to avoid double-prefix when user pastes http://... or socks5://... into the host input - Dashboard proxy panel adds "Paste URL" mode as alternative to field-by-field entry; i18n strings added for zh/en - Config version bump to 26.519.81530 / build 3178
- [CRITICAL] null instructions → hash regression: record() now accepts
string|null|undefined and uses sha256(instructions ?? "") so that
no-system-prompt sessions store sha256("") instead of undefined,
matching the comparison side in proxy-session-context; callers no
longer coerce null→undefined via ?? undefined
- [HIGH] ProxyPool handleAdd useCallback missing urlMode/newRawUrl deps
caused URL paste mode to always see stale empty values and never
submit; also reset urlMode in resetForm()
- [MEDIUM] proxy name credential leak: when name is empty and falls back
to the full URL, strip username/password before using as display name
Cover three missing paths from PR review: - empty name with credential URL → name has creds stripped - full URL pasted into host field → accepted as-is - explicit name takes precedence over URL fallback
This was referenced May 27, 2026
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
修复 4 个 bug,新增代理面板"粘贴 URL"模式。核心问题:
/v1/chat/completions和/v1/messages路由在判断是否向客户端透传推理内容时,错误地读取原始请求字段而非翻译后的 codexRequest,导致通过 model suffix(如gpt-5.4-high)或default_reasoning_effort配置注入的 effort 虽然已正确发到上游,但 Codex 返回的 reasoning deltas 被代理静默丢弃,客户端误以为 effort 无效。Changes
wantReasoning/wantThinking改为翻译后从codexRequest.reasoning?.effort判断,不再只看显式reasoning_effort/thinking.type字段 (src/routes/chat.ts,src/routes/messages.ts,tests/unit/translation/openai-to-codex.test.ts)SessionAffinityMap改存 SHA-256 hash 而非原始 instructions 字符串,防止大 system prompt 占用过多内存;implicit-resume 比对逻辑同步更新 (src/auth/session-affinity.ts,src/routes/shared/proxy-session-helpers.ts,src/routes/shared/proxy-session-context.ts)developerrole 在转 OpenAI 兼容格式时映射为system,避免不接受 developer role 的 provider 返回 400;CodexInputItem类型补充 developer role (src/translation/codex-request-to-openai.ts,src/proxy/codex-types.ts)src/routes/proxies.ts)http://user:pass@host:port等完整 URL (web/src/components/ProxyPool.tsx,shared/hooks/use-proxies.ts,shared/i18n/translations.ts)web/src/components/ProxyPool.tsx)Test Plan
npm test— 239 files, 2357 passednpm run build— Vite + tsc cleanNotes
default_reasoning_effort配置或 model suffix(-high/-low等)注入的 effort 现在能正确触发客户端可见的 reasoning 内容输出。之前这类配置只影响上游请求,客户端侧完全静默。