Repository navigation
fix(channel): keep desktop_clipboard_write schema a top-level object - #241
Merged
Merged
Conversation
This was referenced Oct 14, 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.
Fixes #192.
OpenAI rejects any function whose parameters lack
type: "object"at the top level or carryoneOf/anyOf/allOf/enum/const/notthere.desktop_clipboard_writedeclared its three exclusive forms (text;format: "image"+path;format: "files"+paths) with a top-leveloneOf, soopenai/gpt-4.1-minifailed every request with HTTP 400 before any tool ran.The schema is now a plain object with all four fields optional and
additionalProperties: false. The handler already accepted only those three exact combinations and threw otherwise, so valid calls behave identically; an invalid combination now fails in the handler with "Supply text, format image with path, or format files with paths." instead of at schema validation. The schema is defined in Ace (packages/channel/src/desktop.ts), not in thedesktop-toolspackage, so no upstream change is needed.Audit. I built every extension the channel installs (
CodingTools,desktop,browser,lanes,Subagent,metadata,messaging) and checked all 36 shipped tool schemas for a non-object top level or a top-leveloneOf/anyOf/allOf/enum/const/not. Before this change onlydesktop_clipboard_writefailed. After it, none do. Unions nested inside properties (desktop_launch.application,desktop_open.item, etc.) stay as they are; OpenAI allows them in non-strict mode, which pi-ai uses by default.Verification.
bun typesandbun run cipass.openai-responsespath with the shell'sOPENAI_API_KEY, both before and after the fix. Both requests failed with 401invalid_organization, so authentication failed before OpenAI checked the schemas. The only other OpenAI credential is in theace-devkeychain, and reading it needs an interactive macOS keychain prompt, so I didn't use it. Someone with a working key should confirm that a gpt-4.1-mini channel's first turn succeeds.Built in Ace
No. Made by a Claude Code subagent in a terminal at the maintainer's choice for this session; not an Ace capability gap. Dogfooding: #5.