Skip to content

fix(runtime): normalize unsupported OpenAI uniqueItems schemas - #2214

Closed
Linuxdazhao wants to merge 34 commits into
vastsa:mainfrom
Linuxdazhao:codex/fix-openai-unique-items-20261109
Closed

Linuxdazhao wants to merge 34 commits into
vastsa:mainfrom
Linuxdazhao:codex/fix-openai-unique-items-20261109

Conversation

@Linuxdazhao

@Linuxdazhao Linuxdazhao commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Draft: the claimed real-provider rejection remains unconfirmed. Related investigation: #2213.

Public OpenAI Responses with gpt-6.1-sol, the pinned patched pi-ai 1.5.0 transport and the actual ScheduledTaskCreate/Update schemas accepted unchanged uniqueItems: true with strict: false. Current tools, additional_tools and tool_search_output each completed normally with HTTP 200, as did normalized controls. Real request IDs and conditions are in the verification comments. Real ChatGPT/Codex requests also accepted the original schemas with default strict: null.

The original serializer assertion established keyword forwarding. The purpose-built schema-rejecting loopback established normalization behavior; neither proves a real service defect. The necessary production-fix claim is withdrawn. Azure, strict-enabled extensions and acceptance for every model remain untested.

The proposed code normalizes uniqueItems at the OpenAI Responses/Codex Responses payload boundary after existing hooks, including current and historical declarations. Canonical schemas, stored transcripts, local duplicate-weekday validation, strict flags, hosted tools and other transports retain their behavior. The current wrapper does not cover Azure or extension-owned agent construction; it has not been expanded without a confirmed need.

Previously published candidate 41ef493cd contains main 4ad0094e87b3 and preserves its original history. Its 65 targeted provider/schema tests, six loopback HTTP cases, agent-runtime TypeScript build, Pi patch audits, documentation checks/build and six GitHub checks passed. These results qualify the proposed transformation only. No new production code is added by this verification; installed-app acceptance is unclaimed.

yg2224 and others added 8 commits November 8, 2026 23:32
系统通知属于当前运行回合,重建时不应作为新提示截断运行子代理选择。与回合状态选择保持相同边界,避免导航后错误显示已停止,普通新提示仍隔离历史工作。

Refs vastsa#1990
普通系统通知不会关闭运行回合,真实重启后 running 为 false 才隔离历史工作。补齐旧回归对该边界的覆盖,避免与生产回合状态规则冲突。
文件管理器修复已由维护者合入主线。使用非破坏性合并保留双方规格和回归场景,使本 PR 包含最新基线并消除文档冲突,不改写已共享提交。
保留原分支历史并整合已合入的 macOS 发布修复,为继续同步最新主线建立完整合并记录。
主线已合入截图粘贴及 steering 修复,保留双方新增规格和测试场景,清除独立子代理修复 PR 的文档冲突,不改写共享分支历史。
保留主线新增的 Goal 能力与本 PR 子代理状态修复,采用普通合并保证已共享历史不变。
Scheduled tools forward uniqueItems into current and historical Responses function declarations, where schema compilation can reject the entire turn. Normalize at the outbound payload boundary so saved declarations recover too, without changing local validation or stored history.

The regression uses synthetic fixtures and the real adapters with an HTTP stub. Native and live-provider acceptance remain pending.

Fixes vastsa#2213

@aiuo-codepilot aiuo-codepilot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIUO CodePilot · Preliminary review

Diff-only preliminary review of PR #2214 (normalize unsupported OpenAI `uniqueItems` schemas). The normalization pass, provider-binding wrapper, regression test, and docs are present. No evidenced functional defects found in the cited added lines. Verification limits: no tools, execution, typecheck, tests, or repository access were used; live-provider/native E2E remains unrun per the PR body, so runtime/provider behavior is not confirmed here.

No evidenced findings in the supplied diff.

Head: 9dde2ac
Base: 3169c21
CI: pending; mergeable: true.

Validation: code/tests NOT EXECUTED. Diff-only preliminary analysis; not approval. Human review and repository gates remain required.

vastsa and others added 20 commits November 9, 2026 18:05
…-rows-1990

fix(chat): 防止系统通知后子代理被错误显示为已停止
app.getFileIcon() returns the same generic bundle placeholder for every
.app on macOS, so every installed application in the launcher rendered
as an identical blank square. Prefer the Quick Look thumbnail of the
bundle (96px, well inside the 32 KiB icon budget) and fall back to the
small native file icon; other platforms keep the existing lookup.

Native application icons now fill the tile instead of sitting inside a
second rounded square, and the active tile is a filled cell rather than
an outlined one.
Users asked to jump from a file named in the conversation straight to
its location on disk. The right-click menu only offered copy actions
since the HTML open-with change, so the reference had to be copied and
located by hand.

Every local reference now offers Show in folder. It resolves through
the same completion a click uses and reveals that exact absolute path
through the contained fs/reveal IPC; a missing reference or a refused
reveal reports itself, and remote workspaces keep the copy actions only.
…older

feat(chat): show a transcript file reference in its folder
fix(launcher): show real macOS application icons
扩展桥接只修改运行时公开值,Pi Agent 仍携带旧档位。同步更新请求状态,保留模型能力校验,避免 getter 和实际 reasoning 参数不一致。

Refs vastsa#1974
历史动作的慢读取可能在新流式消息之后返回,原逻辑无条件替换缓存。仅缓存读取期间未改变的快照,调用方仍得到完整历史用于独立校验。

Refs vastsa#2086
远端连接失败并不能确认会话已停止,原 finally 无条件清除运行状态会隐藏仍运行的会话。请求成功后才更新停止状态,错误继续交给调用方处理并允许重试。

Refs vastsa#1990
fix(sessions): 停止请求失败时保留运行状态
主线已合入停止失败时保留运行状态的修复。保留独立问题的行为说明和新增停止场景,使共享分支继续包含当前主线且不改写历史。
主线已合入停止失败时保留运行状态的修复。保留独立问题的行为说明和新增停止场景,使共享分支继续包含当前主线且不改写历史。
…in-process hang

The Windows paste-image path used spawnSync to probe the clipboard,
which blocks the main process. On machines where PowerShell startup
exceeds the 2s timeout, this manifests as a hard freeze on paste.
Switch to async execFile with a Promise wrapper so the probe no longer
holds up the main process, regardless of paste type.

nativeClipboardPaths and readComposerClipboardDirectories are now
async, so their existing callers and tests await the result. Two
regression tests cover a probe slower than the former 2s bound and a
failing probe, and both assert the event loop keeps running.

closes vastsa#2220
…retention

fix(chat): 防止旧历史读取覆盖新的流式缓存
Exercise the production async child-process boundary with controlled output and failure events. This guards the Windows clipboard probe against blocking the main process while preserving its process timeout and output bounds.
Write the Finder property list to plutil through the child stdin stream. The asynchronous execFile API does not support the synchronous input option, so keep the macOS paste path functional without blocking the main process.
A never-shown window throttles animation frames to roughly 1 Hz and then stops them, so the probe helpers wait on requestAnimationFrame forever and the suite is killed after 45 s with no output. Show the window, as the other frame-dependent suites already do.
vastsa and others added 6 commits November 10, 2026 01:05
fix(runtime): 扩展思考强度调整同步到实际请求
execFile decodes stdout to utf8 strings by default, so Buffer.concat threw ERR_INVALID_ARG_TYPE from inside the data handler and escaped as an uncaught Main-process error. Pin the buffer encoding, accept string chunks defensively, and reject on stream errors.

The mocked child processes emitted Buffers, which is why the macOS run failed while the suite passed. A regression now reads a real child process so the default-encoding boundary is exercised.
…oard-powershell-timeout

fix(composer): replace execFileSync with async execFile to prevent main-process hang
Preserve the existing wire-schema fix on current main and exercise both
provider stream entry points against a real loopback HTTP endpoint.
Keep live-account acceptance separate and synchronize the spec mirrors.

Linuxdazhao commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixes #2213.

Normalize unsupported uniqueItems only at the OpenAI Responses/Codex Responses wire-payload boundary, after existing hooks. Current tool declarations and historical additional_tools / tool_search_output receive the same pass; canonical schemas, persisted transcripts, local duplicate-weekday validation, strict flags, hosted tools and other transports keep their behavior.

Refreshed candidate 41ef493cd contains main 4ad0094e87b3 and preserves the original PR history.

Validation:

  • 65 targeted provider/schema tests passed; agent-runtime TypeScript build and all three installed Pi 1.5.0 patch audits passed.
  • New node scripts/e2e-openai-tool-schema.mjs sends six actual loopback HTTP requests through production provider streams: both stream entry points × current/additional-tools/tool-search replay. A schema-rejecting HTTP endpoint accepts normalized payloads and returns SSE; all cases passed and retained their original context.
  • Documentation pair/page checks, full VitePress build, syntax and whitespace checks passed. Runtime/E2E documentation mirrors are synchronized.
  • Existing regression establishes failure before normalization; fixtures and credentials are synthetic.

This remains Draft pending real-account OpenAI acceptance. Loopback transport success does not establish live service compatibility. No paid model call, installed-app acceptance or release is claimed. All six fresh-head CI checks passed.

@Linuxdazhao
Linuxdazhao marked this pull request as ready for review November 11, 2026 09:43
@vastsa

vastsa commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Holding this until the failure is confirmed against a real provider. #2213's reproduction is a local server written to reject uniqueItems, and the quoted error refers to strict schemas, but pi-ai sends Responses tools with strict: false (openai-responses-shared.js) and Codex with strict: null, and this repo does not opt tools into strict/constrained sampling. If a real OpenAI rejection is captured (request id + response), please attach it. Also note the wrapper at provider-binding.ts only applies inside createProviderModels, so azure-openai-responses and createExtensionAgentModels would remain uncovered. (The 43-file count is a stale-base display artifact; the actual diff is 8 files.)

Copy link
Copy Markdown
Contributor Author

I checked this against the real Codex service on current main d128b12e2cac, using the pinned patched pi-ai 1.5.0 transport and both actual scheduled-tool schemas. The reported rejection did not reproduce.

On macOS arm64 / Node 26.13.0, gpt-6-luna through the official ChatGPT/Codex SSE endpoint returned HTTP 200 and normal completion with both declarations retaining uniqueItems: true:

  • The adapter's default strict: null, including additional_tools declarations.
  • Explicit strict: false on the same service.
  • Current top-level function declarations with strict: null.
  • A replay containing an asserted tool_search_output with strict: null.

The normalized control also returned HTTP 200. All prompts and schemas were synthetic; no scheduled tool was executed. The transport callback did not expose an x-request-id; there is no failing service response/request id to attach.

The public OpenAI Responses endpoint is still untested because no public API credential is configured in this verification environment. These Codex successes do not prove public API/Azure acceptance. The official function-calling guide explicitly documents strict: false as opting out of strict validation: https://developers.openai.com/api/docs/guides/function-calling#strict-mode .

You are right that the serializer assertion and schema-rejecting loopback establish keyword forwarding and the wrapper's behavior, not a real-provider defect. I am keeping this on hold, correcting that distinction, and not expanding the wrapper into Azure/extension paths without a confirmed failure.

Copy link
Copy Markdown
Contributor Author

Public OpenAI API follow-up: I have now tested https://api.openai.com/v1/responses with a separately configured API credential. The schema rejection still does not reproduce.

Environment: main d128b12e2cac, pinned patched pi-ai 1.5.0 Responses transport, actual ScheduledTaskCreate/Update parameter schemas, gpt-6.1-sol, strict: false, supported reasoning.effort: low, synthetic prompts and no tool execution. Both current and replay declarations were asserted at the outbound payload boundary.

Declaration path Original uniqueItems: true Normalized control
Current tools HTTP 200, req_20a86ef106ad47bd9aa75603791b49b0 HTTP 200, req_24f41c167e674612a57003f44f74b5b2
additional_tools HTTP 200, req_cf158efffdc14b619014a4ff55f8d841 HTTP 200, req_192991adbe2941439d717828bf273d44
tool_search_output HTTP 200, req_6b68e7ffad274ab39cb1d835403ff5cc HTTP 200, req_e2c2eee27ce340f683d7df602f1d8bc5

All six completed normally. Earlier real Codex tests also accepted the original schemas. The only initial public-API errors concerned an unsupported reasoning value in the harness; correcting it made both original and control succeed, so those were not schema evidence.

This confirms your concern about the original reproduction: forwarding the keyword and passing a purpose-built local rejecting server do not prove a defect in the application's non-strict request path. I am withdrawing the claim of a confirmed real-provider rejection and keeping the proposed normalization unqualified rather than expanding it. This does not establish acceptance for every model, Azure endpoint, or strict-enabled extension.

@Linuxdazhao
Linuxdazhao marked this pull request as draft November 11, 2026 14:33
@vastsa

vastsa commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Closing based on your own verification, thanks for doing it thoroughly: the reported uniqueItems rejection did not reproduce against the real Codex service (strict null/false) nor the public OpenAI Responses API (six HTTP 200s with the original schemas, request ids listed above). Without a real failing provider response there is no defect to fix, and normalizing schemas would change what every Responses tool sends. Happy to reopen if a real rejection (status + request id) shows up, ideally also covering azure-openai-responses and createExtensionAgentModels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants