Repository navigation
Custom engine: connect an OpenAI-compatible Responses endpoint - #238
Conversation
|
Fixed Custom context reporting in c998408. /context, browser /status, the CLI account view and terminal meter now show token usage without treating Codex's fallback as the provider's context limit or compaction threshold. The PR head passes 511 core tests with Chrome required, core and CLI type checks, and the webview build. A local integration of #238 through #242 passes 519 tests (five Windows-only skips on macOS), core/panel/CLI/localhost/VS Code type checks, and webview/CLI/VS Code builds. Fresh desktop and mobile-width screenshots use the actual webview with controlled transport; this was not another live provider test. The smaller fixes can land first. The integration branch records the conflict resolutions; I will update #238 against the resulting main and rerun the affected checks. No upstream merge is included in these results. |
|
for custom, i kept the reported token count but hid the percentage since we don't reliably know the provider's limit. another option is to hide the indicator entirely if it's more confusing than useful. happy to do that, or follow a better approach you have in mind. i figured provider lookups and manual settings could stay out of this PR for now. |
|
I tested #238 together with #239–#243 and the comment-draft fix in #244 against main The combined result passed 521 core tests (5 skipped), including the required browser panel tests, all 4 webview comment-recovery tests, and the production webview build. Typechecking still has the same 10 existing unused-symbol errors. No live posts or wallet transactions were submitted. Combined branch and test output. This is a validation branch, so it does not replace the focused PRs or mean these changes are deployed. Suggested order: #239–#243 and #244 first, then refresh #238 with these tested resolutions. I can carry that refresh once the smaller PRs land. |
|
Reviewed and cleared to merge on my side — API-key handling matches the stated contract (device-local However, after the sibling PRs landed on main (#240 Windows npm engines, #241, #242), this branch now conflicts and GitHub marks it Could you rebase onto the latest |
…ough the Codex provider passthrough Ported onto main after IQCoreTeam#218 and the engineBin refactor: the registry's binary lookup goes through engineBin.ts (custom resolves the codex binary), customEngineStatus reuses detectCli as its binary probe, and the panel's custom tab (hidden until the host announces a saved endpoint config), engine mark and slash guards live in the panel modules with jsdom coverage; the bundle is regenerated.
Reject whitespace-only model ids at save time, keep invalid-URL errors from echoing the pasted input (it can contain a key), and correct the keyless-auth comments. The approval policy change that shipped alongside this in the spike now lives in IQCoreTeam#221 and is not part of this commit.
customEngineStatus answers in CliReport's own vocabulary (missing, no-login, ok) so the CLI, the VS Code host and the chat session stop re-deriving "codex present AND config saved" each on their own; the unread binaryOk/configured fields and the unused keyless-placeholder export are gone, and the VS Code host reuses the boot probe instead of running a second one.
This reverts commit be31653.
c998408 to
f855fbb
Compare


Continues #209 and replaces the branch proposed in #227 under NubsCarson. Adds a device-local custom endpoint, API key and model configuration shared by the browser, CLI and VS Code surfaces. Custom appears only after configuration; the browser setup lives in AI Connections. OpenRouter and Manual are the available presets.
The custom engine uses the existing Codex runtime and approval channel. Starting and resuming a turn explicitly select the custom provider. The key is kept in the local token file and child environment, outside command arguments. MCP tool-consent requests use the existing approval UI. Current-turn token usage replaces cumulative totals; the browser shows a token count for Custom because Codex fallback limits are not verified provider limits.
Validation at c750591: 66 test files / 502 tests passed with Chrome required. Core, panel, CLI, localhost and VS Code type checks passed; CLI, MCP, VS Code and webview builds passed. The additional strict webview check has the same 11 diagnostics as unchanged upstream f1716cc, confirmed in an isolated checkout.
Assistant-operated live OpenRouter checks covered browser replies, reload/resume, shell reads, denied and approved writes, streaming, Stop and recovery; CLI MCP execution; and VS Code replies, conversational recall, denied write, MCP approval/execution, Stop and recovery. Browser and VS Code returned the synthetic MCP nonce and correct sum after direct follow-ups. Initial model attempts selected the resource reader instead of the tool; those failures are retained with the successful evidence. Live evidence was captured on the integrated local branch before the latest upstream merge and publication split; automated checks were rerun on this candidate.
Other custom providers and physical mobile devices are not verified. This PR excludes the independent pager-overflow fix. No claim is made that every provider supports the Responses API or reliably selects every tool.
Reviewed screenshots