mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-12-03 00:00:58 +00:00
Compare commits
3
Commits
v3.61.0
...
v3.61.1-rc.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca4d02068a | ||
|
|
d185a639a9 | ||
|
|
3078dd9993 |
@@ -980,6 +980,7 @@ impl CodexProvider {
|
||||
let processed = self.prepare_generate_request(&generate, upstream, &context);
|
||||
let native_scope = processed.checked_native_continuation_scope(&context, direct_model)?;
|
||||
let mut upstream_request = processed.upstream;
|
||||
upstream_request.client_api_key_id = Some(context.client_api_key_ref().as_str().to_owned());
|
||||
let session_transport_key =
|
||||
derive_codex_transport_key(&upstream_request, context.client_api_key_ref());
|
||||
let previous_session = processed.previous_session;
|
||||
|
||||
@@ -349,23 +349,6 @@ impl CodexBackendClient {
|
||||
.iter()
|
||||
.map(|(name, value)| (name.as_str(), value.as_bytes())),
|
||||
);
|
||||
// 审计未启用时跳过 artifact 构造:payload 快照会深拷贝整个请求 body,
|
||||
// 且位于首字节前的关键路径上
|
||||
if websocket_audit_dir().is_some() {
|
||||
let artifact = websocket_audit_artifact_from_attempt(
|
||||
&websocket_request,
|
||||
opening.connection.opening_audit_snapshot(),
|
||||
// 插件准备后只由受控 wire capture 记录实际正文,不把原生 JSON 冒充最终帧
|
||||
self.outbound_middleware
|
||||
.is_none()
|
||||
.then(|| websocket_payload_audit_snapshot(&websocket_request)),
|
||||
);
|
||||
if let Err(error) =
|
||||
write_websocket_audit_artifact_from_env(&artifact, self.timezone).await
|
||||
{
|
||||
tracing::warn!(error = %error, "Failed to write Codex WebSocket audit artifact");
|
||||
}
|
||||
}
|
||||
let mut connection_profile = websocket_connection_profile(
|
||||
&headers,
|
||||
&self.middleware_headers,
|
||||
@@ -436,7 +419,7 @@ impl CodexBackendClient {
|
||||
self.egress_key
|
||||
)
|
||||
});
|
||||
let prepared = prepare_response_create_request_with_pool(
|
||||
let mut prepared = prepare_response_create_request_with_pool(
|
||||
&opening,
|
||||
pool,
|
||||
&self.websocket_origin_breaker,
|
||||
@@ -451,6 +434,33 @@ impl CodexBackendClient {
|
||||
),
|
||||
)
|
||||
.await;
|
||||
let can_reduce_history = self.protocol == OpenAiUpstreamProtocol::Codex
|
||||
&& plugin_payload.is_none()
|
||||
&& self.privacy.is_none()
|
||||
&& requirement == TransportRequirement::NewChain
|
||||
&& request.stream()
|
||||
&& !request.websocket_frame
|
||||
&& request.downstream_websocket_connection_id.is_none();
|
||||
if let Ok(WebSocketFastPath::Ready(socket)) = &mut prepared {
|
||||
socket.prepare_http_history(can_reduce_history.then_some(&mut websocket_request));
|
||||
}
|
||||
// 审计未启用时跳过 artifact 构造:payload 快照会深拷贝整个请求 body,
|
||||
// 且位于首字节前的关键路径上
|
||||
if websocket_audit_dir().is_some() {
|
||||
let artifact = websocket_audit_artifact_from_attempt(
|
||||
request,
|
||||
opening.connection.opening_audit_snapshot(),
|
||||
// 插件准备后只由受控 wire capture 记录实际正文,不把原生 JSON 冒充最终帧
|
||||
self.outbound_middleware
|
||||
.is_none()
|
||||
.then(|| websocket_payload_audit_snapshot(&websocket_request)),
|
||||
);
|
||||
if let Err(error) =
|
||||
write_websocket_audit_artifact_from_env(&artifact, self.timezone).await
|
||||
{
|
||||
tracing::warn!(error = %error, "Failed to write Codex WebSocket audit artifact");
|
||||
}
|
||||
}
|
||||
let prepared = match prepared {
|
||||
Ok(WebSocketFastPath::Ready(prepared)) => prepared,
|
||||
Ok(WebSocketFastPath::Missed) => {
|
||||
|
||||
@@ -95,7 +95,7 @@ pub struct CodexResponsesRequest {
|
||||
pub client_ip: Option<String>,
|
||||
/// 客户端 User-Agent,仅用于管理端使用记录展示
|
||||
pub client_user_agent: Option<String>,
|
||||
/// 已鉴权客户端 API key 的稳定 ID,仅用于事实归因
|
||||
/// 已鉴权 Client Key 的稳定 ID,用于约束连接内的历史续接
|
||||
pub client_api_key_id: Option<String>,
|
||||
/// 是否偏好 WebSocket 传输
|
||||
pub use_websocket: bool,
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
//! 物理 WS 的响应归属与 HTTP 全量输入的增量续接
|
||||
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
hash::{Hash, Hasher},
|
||||
};
|
||||
|
||||
use serde_json::Value;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
use crate::transport::protocol::{
|
||||
responses::CodexResponsesRequest, websocket::websocket_response_completed_id,
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) struct WebSocketContinuationState {
|
||||
latest_response_id: Option<String>,
|
||||
history: Option<HttpHistory>,
|
||||
}
|
||||
|
||||
impl WebSocketContinuationState {
|
||||
pub(super) fn latest_response_id(&self) -> Option<&str> {
|
||||
self.latest_response_id.as_deref()
|
||||
}
|
||||
|
||||
pub(super) fn begin_http_request(self, request: &mut CodexResponsesRequest) -> Self {
|
||||
let body = request.body();
|
||||
let Some(owner) = request.client_api_key_id.as_deref() else {
|
||||
return Self::default();
|
||||
};
|
||||
if request.store() || !request.generate() || body.contains_key("previous_response_id") {
|
||||
return Self::default();
|
||||
}
|
||||
// 每轮元数据随当前帧照常发送,模型、工具及未知正文属性均参与前缀校验
|
||||
let properties: BTreeMap<_, _> = body
|
||||
.iter()
|
||||
.filter(|(key, _)| !matches!(key.as_str(), "input" | "client_metadata"))
|
||||
.collect();
|
||||
let mut input = Prefix {
|
||||
count: 0,
|
||||
digest: fingerprint((owner, properties)),
|
||||
};
|
||||
let Some(Value::Array(items)) = request.body_mut().get_mut("input") else {
|
||||
return Self::default();
|
||||
};
|
||||
let cut = self
|
||||
.history
|
||||
.as_ref()
|
||||
.map_or(0, |last| last.total.count.min(items.len()));
|
||||
input.extend(&items[..cut]);
|
||||
let reuse = self.history.is_some_and(|last| last.total == input) && cut < items.len();
|
||||
input.extend(&items[cut..]);
|
||||
if reuse && let Some(id) = self.latest_response_id.filter(|id| !id.is_empty()) {
|
||||
items.drain(..cut);
|
||||
request.set_previous_response_id(Some(id));
|
||||
}
|
||||
Self {
|
||||
latest_response_id: None,
|
||||
history: Some(HttpHistory {
|
||||
input,
|
||||
total: input,
|
||||
added: 0,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn observe(&mut self, event: Option<&str>, value: &Value) {
|
||||
if let Some(history) = &mut self.history {
|
||||
match event {
|
||||
Some("response.output_item.added") => history.added += 1,
|
||||
Some("response.output_item.done") => {
|
||||
let index = history.total.count - history.input.count;
|
||||
if let Some(item) = value.get("item").filter(|i| i.is_object())
|
||||
&& value["output_index"].as_u64() == Some(index as u64)
|
||||
{
|
||||
history.total.push(item);
|
||||
} else {
|
||||
self.history = None;
|
||||
}
|
||||
}
|
||||
Some("response.completed") => {
|
||||
// 完整终态优先;省略输出的终态只采用连续完成的流式项
|
||||
if let Some(output) =
|
||||
value.pointer("/response/output").and_then(Value::as_array)
|
||||
&& !output.is_empty()
|
||||
{
|
||||
let observed = history.total.count - history.input.count;
|
||||
if output.len() < history.added.max(observed) {
|
||||
self.history = None;
|
||||
} else {
|
||||
history.total = history.input;
|
||||
history.total.extend(output);
|
||||
}
|
||||
} else if history.total.count == history.input.count
|
||||
|| history.total.count - history.input.count < history.added
|
||||
{
|
||||
self.history = None;
|
||||
}
|
||||
}
|
||||
Some("response.incomplete") => self.history = None,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
if let Some(id) = websocket_response_completed_id(value) {
|
||||
self.latest_response_id = Some(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct HttpHistory {
|
||||
input: Prefix,
|
||||
total: Prefix,
|
||||
added: usize,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
struct Prefix {
|
||||
count: usize,
|
||||
digest: [u8; 32],
|
||||
}
|
||||
|
||||
impl Prefix {
|
||||
fn extend(&mut self, items: &[Value]) {
|
||||
for item in items {
|
||||
self.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
fn push(&mut self, item: &Value) {
|
||||
self.digest = fingerprint((self.digest, item));
|
||||
self.count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Value 的 Hash 忽略对象键顺序、保留数组顺序;摘要只在当前进程的连接租约内比较
|
||||
fn fingerprint(value: impl Hash) -> [u8; 32] {
|
||||
struct DigestHasher(Sha256);
|
||||
|
||||
impl Hasher for DigestHasher {
|
||||
fn write(&mut self, bytes: &[u8]) {
|
||||
self.0.update(bytes);
|
||||
}
|
||||
|
||||
fn finish(&self) -> u64 {
|
||||
u64::from_be_bytes(self.0.clone().finalize().as_chunks::<8>().0[0])
|
||||
}
|
||||
}
|
||||
|
||||
let mut hasher = DigestHasher(Sha256::new());
|
||||
value.hash(&mut hasher);
|
||||
hasher.0.finalize().into()
|
||||
}
|
||||
@@ -14,6 +14,7 @@ use super::{
|
||||
breaker::{
|
||||
WebSocketOriginBreaker, WebSocketOriginBreakerDecision, WebSocketOriginBreakerPermit,
|
||||
},
|
||||
continuation::WebSocketContinuationState,
|
||||
error::CodexWebSocketExchangeError,
|
||||
exchange::{
|
||||
CodexWebSocketStreamingExchange, WebSocketStreamPoolReturn, stream_websocket_response,
|
||||
@@ -25,12 +26,12 @@ use super::{
|
||||
},
|
||||
pool::{
|
||||
self, CodexWebSocketPool, CodexWebSocketPoolKey, PooledWebSocketConnection,
|
||||
WebSocketContinuationState, WebSocketPoolAcquire, WebSocketPoolBypassReason,
|
||||
WebSocketPoolConnectLease, WebSocketPoolConnectOutcome, WebSocketPoolDecision,
|
||||
WebSocketPoolLease,
|
||||
WebSocketPoolAcquire, WebSocketPoolBypassReason, WebSocketPoolConnectLease,
|
||||
WebSocketPoolConnectOutcome, WebSocketPoolDecision, WebSocketPoolLease,
|
||||
},
|
||||
pump::{PumpLogContext, PumpedWebSocket, transport_metric_reason},
|
||||
};
|
||||
use crate::transport::protocol::responses::CodexResponsesRequest;
|
||||
|
||||
/// WebSocket 快路径的控制流结果;预算未命中不代表连接失败
|
||||
pub(crate) enum WebSocketFastPath<T> {
|
||||
@@ -90,6 +91,16 @@ impl PoolBinding {
|
||||
}
|
||||
|
||||
impl PreparedWebSocket {
|
||||
/// 只有获得物理连接的独占租约后,才能使用其上一轮前缀
|
||||
pub(crate) fn prepare_http_history(&mut self, request: Option<&mut CodexResponsesRequest>) {
|
||||
let previous = std::mem::take(&mut self.connection.continuation);
|
||||
if let Some(request) = request
|
||||
&& matches!(self.binding, PoolBinding::Pooled { .. })
|
||||
{
|
||||
self.connection.continuation = previous.begin_http_request(request);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn max_message_bytes(&self) -> Option<usize> {
|
||||
self.connection.metadata.max_message_bytes
|
||||
}
|
||||
|
||||
@@ -5,11 +5,12 @@ use serde_json::Value;
|
||||
|
||||
use crate::transport::protocol::websocket::{
|
||||
websocket_event_type, websocket_metadata_headers, websocket_metadata_turn_state,
|
||||
websocket_response_completed_id, websocket_response_is_interrupted,
|
||||
websocket_response_is_interrupted,
|
||||
};
|
||||
use crate::transport::response_meta;
|
||||
|
||||
use super::super::pool::{CodexWebSocketConnectionMetadata, WebSocketContinuationState};
|
||||
use super::super::continuation::WebSocketContinuationState;
|
||||
use super::super::pool::CodexWebSocketConnectionMetadata;
|
||||
use super::CodexWebSocketExchangeError;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -71,9 +72,7 @@ pub(super) fn reduce_websocket_event(
|
||||
});
|
||||
|
||||
let event = websocket_event_type(&value);
|
||||
if let Some(response_id) = websocket_response_completed_id(&value) {
|
||||
continuation.record_completed(response_id);
|
||||
}
|
||||
continuation.observe(event, &value);
|
||||
|
||||
let terminal = match event {
|
||||
Some("response.completed") => Some(WebSocketTerminalKind::Completed),
|
||||
|
||||
@@ -10,10 +10,8 @@ use tokio::sync::{Mutex, mpsc, oneshot};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use super::super::{
|
||||
pool::{
|
||||
CodexWebSocketConnectionMetadata, PooledWebSocketConnection, WebSocketContinuationState,
|
||||
WebSocketPoolLease,
|
||||
},
|
||||
continuation::WebSocketContinuationState,
|
||||
pool::{CodexWebSocketConnectionMetadata, PooledWebSocketConnection, WebSocketPoolLease},
|
||||
pump::{
|
||||
PumpExitReason, PumpedWebSocket, WebSocketConnectionObservation, transport_metric_reason,
|
||||
},
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
mod audit;
|
||||
mod breaker;
|
||||
mod continuation;
|
||||
mod control;
|
||||
mod coordinator;
|
||||
mod error;
|
||||
|
||||
@@ -36,7 +36,6 @@ pub(crate) use self::{
|
||||
},
|
||||
state::{
|
||||
CodexWebSocketConnectionMetadata, PooledWebSocketConnection, WebSocketConnectionLifetime,
|
||||
WebSocketContinuationState,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use uuid::Uuid;
|
||||
use super::super::super::{
|
||||
diagnostics::CodexUpstreamDiagnostics, response_meta::CodexResponseMetadata,
|
||||
};
|
||||
use super::super::continuation::WebSocketContinuationState;
|
||||
use super::super::pump::{PumpedWebSocket, WebSocketConnectionObservation};
|
||||
use super::lease::WebSocketPoolConnectOutcome;
|
||||
|
||||
@@ -255,29 +256,13 @@ impl From<super::CodexWebSocketPoolConfig> for WebSocketConnectionLifetime {
|
||||
pub(crate) struct PooledWebSocketConnection {
|
||||
pub(crate) websocket: PumpedWebSocket,
|
||||
pub(crate) metadata: CodexWebSocketConnectionMetadata,
|
||||
pub(crate) continuation: WebSocketContinuationState,
|
||||
pub(in crate::transport::websocket) continuation: WebSocketContinuationState,
|
||||
pub(crate) created_at: Instant,
|
||||
pub(crate) lifetime: WebSocketConnectionLifetime,
|
||||
// 首个已写入请求决定搜索能力,None 表示仅完成握手,后续工具变化不能覆盖此事实
|
||||
pub(crate) initial_search_declared: Option<bool>,
|
||||
}
|
||||
|
||||
/// 只随具体 WebSocket 生命周期存在的续接状态
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
pub(crate) struct WebSocketContinuationState {
|
||||
latest_response_id: Option<String>,
|
||||
}
|
||||
|
||||
impl WebSocketContinuationState {
|
||||
pub(crate) fn latest_response_id(&self) -> Option<&str> {
|
||||
self.latest_response_id.as_deref()
|
||||
}
|
||||
|
||||
pub(crate) fn record_completed(&mut self, response_id: String) {
|
||||
self.latest_response_id = Some(response_id);
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) enum WebSocketPoolSlot {
|
||||
Idle {
|
||||
connection: Box<PooledWebSocketConnection>,
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//! HTTP 全量历史在池化 WS 上的连续增量、分支与身份隔离
|
||||
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn http_history_follows_completed_output_on_its_own_connection() {
|
||||
let listener = TcpListener::bind("127.0.0.1:0").await.unwrap();
|
||||
let addr = listener.local_addr().unwrap();
|
||||
let tool = json!({"type":"function_call","name":"lookup","call_id":"c","arguments":"{}"});
|
||||
let message = json!({"type":"message","role":"assistant","content":"ok"});
|
||||
let (frames, mut seen) = tokio::sync::mpsc::unbounded_channel();
|
||||
let server = tokio::spawn({
|
||||
let tool = tool.clone();
|
||||
let message = message.clone();
|
||||
async move {
|
||||
// 更换会话池键后在另一条连接上从全量重新开始
|
||||
for turns in [0..6, 6..9] {
|
||||
let (socket, _) = listener.accept().await.unwrap();
|
||||
let mut ws = accept_codex_test_websocket(socket).await;
|
||||
for turn in turns {
|
||||
let frame = ws.next().await.unwrap().unwrap().into_text().unwrap();
|
||||
frames
|
||||
.send(serde_json::from_str::<Value>(&frame).unwrap())
|
||||
.unwrap();
|
||||
let output = if turn == 0 {
|
||||
for event in ["response.output_item.added", "response.output_item.done"] {
|
||||
let event = json!({"type":event,"item":tool,"output_index":0});
|
||||
ws.send(Message::Text(event.to_string().into()))
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
json!([])
|
||||
} else {
|
||||
json!([message])
|
||||
};
|
||||
if turn == 6 {
|
||||
// 终态只列出一项,但先前已开始两项,下一轮须重新建立基线
|
||||
for index in 0..2 {
|
||||
let added = json!({"type":"response.output_item.added","output_index":index,"item":message});
|
||||
ws.send(Message::Text(added.to_string().into()))
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
let terminal = json!({"type":"response.completed","response":{
|
||||
"id":format!("resp_{turn}"),"output":output
|
||||
}});
|
||||
ws.send(Message::Text(terminal.to_string().into()))
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
let backend = CodexBackendClient::new(
|
||||
reqwest::Client::builder().no_proxy().build().unwrap(),
|
||||
format!("http://{addr}"),
|
||||
test_wire_profile(),
|
||||
)
|
||||
.with_websocket_pool(Arc::new(CodexWebSocketPool::default()));
|
||||
|
||||
let mut history = vec![json!({"role":"user","content":"start"})];
|
||||
for turn in 0..9 {
|
||||
let next = json!({"role":"user","content":format!("turn {turn}")});
|
||||
match turn {
|
||||
0 => {}
|
||||
1 => {
|
||||
history.push(tool.clone());
|
||||
history.push(json!({"type":"function_call_output","call_id":"c","output":"found"}));
|
||||
}
|
||||
_ => {
|
||||
history.push(message.clone());
|
||||
history.push(next);
|
||||
}
|
||||
}
|
||||
if turn == 3 {
|
||||
history[0]["content"] = json!("edited");
|
||||
}
|
||||
let instructions = if turn < 4 { "original" } else { "changed" };
|
||||
let mut request = codex_request("model", instructions, history.clone());
|
||||
request.client_api_key_id = Some(if turn < 5 { "key-a" } else { "key-b" }.into());
|
||||
request.local_conversation_id = Some(if turn < 6 { "session" } else { "other" }.into());
|
||||
backend
|
||||
.create_response(&request, request_context("req", Some("acct")))
|
||||
.await
|
||||
.unwrap();
|
||||
let sent = seen.recv().await.unwrap();
|
||||
if matches!(turn, 1 | 2 | 8) {
|
||||
assert_eq!(sent["previous_response_id"], format!("resp_{}", turn - 1));
|
||||
assert_eq!(sent["input"], json!([history.last().unwrap()]));
|
||||
} else {
|
||||
assert!(sent.get("previous_response_id").is_none(), "turn {turn}");
|
||||
assert_eq!(sent["input"], json!(history));
|
||||
}
|
||||
}
|
||||
server.await.unwrap();
|
||||
}
|
||||
@@ -8,6 +8,7 @@ use provider_openai::transport::{
|
||||
|
||||
mod breaker;
|
||||
mod cleanup;
|
||||
mod continuation;
|
||||
mod diagnostics;
|
||||
mod fingerprint;
|
||||
mod metadata;
|
||||
|
||||
@@ -666,6 +666,8 @@ Responses WebSocket 接受文本消息,`response.create` 在同一连接串行
|
||||
| WS → SSE | 通常保留下游 WS。需要完整重放的 OpenAI 大包回退按下述规则重连 |
|
||||
| WS → WS | 保留当前绑定的上游 WS,支持下一轮续接 |
|
||||
|
||||
Codex OAuth 的 SSE 客户端可以每轮提交完整历史。复用同一上游 WS 时,若同一 Client Key 的请求配置和历史前缀匹配上一轮已完成的输入、输出,网关使用 `previous_response_id` 和新增输入续接。换连接或历史不匹配时发送本次完整输入。此优化用于 `store=false` 的生成请求;显式续接、出站插件接管的帧和启用隐私规则的请求沿用各自的传输合同
|
||||
|
||||
活跃客户端 WS 的绑定不受普通空闲回收期限约束;上游 Close(不限关闭码)、EOF、传输读写失败、总寿命到期或连接被回收仍可能使连接内续接失效,
|
||||
网关在收到绑定上游的失效通知且下游空闲时,以关闭码 1000 要求客户端重连并发送完整输入。
|
||||
终态后的结算先完成,已接收或正在处理的客户端消息先按原合同执行;启用 WS 帧中间件时保留连接。
|
||||
|
||||
@@ -809,6 +809,7 @@ Continuation 受原请求的 Client Key、账号范围、Provider 和发送/交
|
||||
- OpenAI Provider 在发送前按上游握手声明的消息大小上限检查最终出站帧,新链可选择 HTTP;超限的 connection-local
|
||||
续接和已标记为需要重放的 HTTP/WS 增量返回 `ClientReplayRequired`,由客户端重发
|
||||
完整历史。预检拒绝先释放连接及租约,不消耗 WS 故障预算;Provider session state 只携带元数据,不保存 transcript
|
||||
- Codex OAuth 的 HTTP 全量历史由独占租用的上游 WS 比较。连接只持有上一轮的响应 ID、项数和绑定 Client Key 与请求属性的前缀摘要,随连接回收;增量只改写出站帧,本次完整请求仍可用于安全回退
|
||||
- OpenAI 在有效输出交付前收到可安全重放的明确额度拒绝时,先隔离账号,再投影 `ClientReplayRequired`;
|
||||
丢弃未交付的原错误帧,由客户端提交完整历史开启新链,不把原增量输入交给其他账号。
|
||||
真实错误分类、状态码、发送状态和上游诊断保持不变,客户端合同见 [Responses API](api.md#3-模型数据面与模型目录)
|
||||
|
||||
+2
-21
@@ -1,22 +1,3 @@
|
||||
# v3.61.0
|
||||
# v3.61.1-rc.1
|
||||
|
||||
## 新增功能
|
||||
|
||||
- xAI 支持接入 Responses API Key 上游,Antigravity 支持接入 GenAI API Key 上游,两者均可与 OAuth 账号并存
|
||||
- 管理端侧栏显示当前运行版本的发布通道
|
||||
|
||||
## 优化改进
|
||||
|
||||
- 智能调度综合当前并发与同模型最近 60 秒的请求量评分,已有的 `loadWeight` 同时控制两项负载的权重
|
||||
- 系统更新显示所选通道的已发布版本和对应说明,仅在存在可安装的更高版本时提示升级
|
||||
|
||||
## 问题修复
|
||||
|
||||
- 修复 OpenAI 延迟返回的额度观测可能覆盖较新额度快照的问题
|
||||
- 修复账号列表的 Token 用量与所展示的额度窗口不一致的问题,区分零用量和缺少统计
|
||||
- 修复下拉选项字重不稳定和账号详情显示空 Token 数值的问题
|
||||
- HTTP 响应和 Responses 错误事件保留上游各类错误中的 `Retry-After` 与 `retry-after-ms`
|
||||
|
||||
## 升级须知
|
||||
|
||||
- 直接调用管理端版本与更新 API 时,需兼容 `latestVersion` 为 `null`,并使用 `hasUpdate` 判断是否存在可安装的更新
|
||||
Codex OAuth 的 SSE 请求复用同一条上游 WebSocket 时,若本轮配置与历史前缀匹配,网关只发送新增输入,无需跨轮缓存对话正文
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
version: 3.61.0
|
||||
version: 3.61.1-rc.1
|
||||
published:
|
||||
'3':
|
||||
stable: 3.60.5
|
||||
rc: 3.60.5
|
||||
beta: 3.60.5
|
||||
alpha: 3.60.5
|
||||
stable: 3.61.0
|
||||
rc: 3.61.0
|
||||
beta: 3.61.0
|
||||
alpha: 3.61.0
|
||||
|
||||
Reference in New Issue
Block a user