Repository navigation
Conversation
ChatGPT subscribers and OpenAI API users can ask for a faster priority tier (Responses `service_tier: "priority"`), which costs more plan limits or a higher per-token price. PI-Desktop never requested a tier. Model settings now own whether a model may use it: a per-model "Fast mode" opt-in, enabled for Responses wires, stored in the existing binding JSON. The cost is a per-conversation choice, so `/fast` toggles a persisted session switch (schema v25, additive). On a model that is not configured, `/fast` stores nothing and points to Settings → Models → Advanced. Launch sends Fast mode only when both are on, and only main turns carry the field; subagents and compaction keep the default tier. closes vastsa#1657
|
Feasibility check for the implementation as described: |
|
The failing check is the transcript-render probe inside the Trusted extensions Electron E2E job: |
pi-ai's Responses and Codex adapters already accept `serviceTier`, send it as `service_tier`, and price the tier the response reports. Only `streamSimple` dropped the option while building its base options, which is why the first version wrote the field through a payload hook. Forward `serviceTier` in the existing pi-ai patch and pass the native option on main turns instead. The request bytes are unchanged, and the Codex adapter can now price a priority request even when the backend echoes the default tier.
|
Thanks — good catch on the native option. Updated in d4c7795:
On the E2E failure: agreed it's the |
Closes #1657
做了什么
给订阅制 ChatGPT(Codex)和 OpenAI Responses 接口加上 Fast 模式:请求会携带
service_tier: "priority",即 OpenAI 的优先档位。回复更快,但订阅会更快消耗额度,API key 则按更高的 token 单价计费。按照讨论中的建议,能不能开由模型设置决定,开不开由会话决定:
/fast:为当前会话开关 Fast。状态会保存,重启后保留,fork 会复制;在空白首页发送时,记在新任务草稿上,带进创建出的会话。/fast不改任何状态,只提示「该模型未配置 Fast 模式,请到「设置 → 模型 → 高级」中开启」。后续如何使用
/fast:弹出「已为当前会话开启 Fast 模式」,模型标签旁出现 ⚡。/fast即可关闭。其他会话不受影响,新会话默认关闭。截图
隔离 profile 加本地假 Responses 端点(无 API key),端点会把收到的
service_tier回显在回复里。1. 设置 → 模型 → 高级 → 能力:Fast 模式(附计费提示)

2.

/fast开启:提示 + 模型标签 ⚡3. 发送消息:请求体带

service_tier: priority(端点记录:{"path":"/v1/responses","model":"gpt-5.5","service_tier":"priority"})4. 切到未配置的模型后发送

/fast:提示去设置里配置实现
ModelBinding.fastModeAllowed,存在已有的 providerconfig_json里(与nativeWebSearch相同),无需迁移;provider 同步、复制与导入链路都已带上该字段。sessions.fast_mode(schema v25,仅新增一列,迁移前备份 v24)。session.create/session.configure接受可选布尔值fastMode,缺省保留原值,非布尔值返回INVALID_PARAMS。fork 复制该值,定时任务和委托子会话从关闭开始。远程会话拒绝该字段。session-launch只有在「会话开启 + 用户保存的模型绑定允许」时才向 sidecar 传fastMode: true。这里直接读用户保存的绑定,因为 Codex 这类 OAuth 账号的模型配置不经过它。openai-codex-responses/openai-responses时传入 pi-ai 原生的serviceTier: "priority",由适配器写入service_tier并按档位计价。pi-ai 的streamSimple组装参数时会丢掉serviceTier,所以在已有的 pi-ai 补丁里加了一行转发(dist/api/simple-options.js),并在SimpleStreamOptions类型里声明该字段。验证
streamSimple(Responses / Completions)检查请求体;session-launch 判断;/fast用户路径(草稿 → 创建会话、开关、未配置、远程会话、Composer 标识);设置页契约。pnpm lint、desktop typecheck、cargo fmt --check、cargo clippy通过。data_relocation(macOS 本地环境),以及 agent-runtimesubagent-fallback的 429 用例超时(撤掉本改动后在同一 main 上同样失败)。/fast→ 实际请求体。未使用真实 ChatGPT 账号发送请求。风险