Merge pull request #53 from omariqbalnaru/fix/omp-custom-api-registration

fix(core): register custom api under non-reserved name for omp 17.4.0
This commit is contained in:
Patrick Wozniak
2026-08-25 13:02:32 +02:00
committed by GitHub
2 changed files with 10 additions and 3 deletions
+1
View File
@@ -9,6 +9,7 @@
- Add optional zero-data-retention headers through `COMMANDCODE_ZDR=1`.
- Refresh GPT-5.6 Terra and Luna display prices after their temporary 50% promotion ended, and display the current DeepSeek V4 off-peak rates for its time-dependent pricing.
- Add isolated live E2E profiles for separate Go-plan and Provider-API credentials, including an explicit selected-transport assertion and packed-package validation.
- Fix extension load failure on newer pi hosts that reject registering a custom API under a built-in name (`openai-completions`); register under `commandcode-custom` instead and restore the real wire API before native compat dispatch.
## 0.5.1 - 2026-08-11
+9 -3
View File
@@ -19,6 +19,7 @@ import { getConfiguredApiKey } from "./src/api-key.ts"
import { createStreamCommandCode } from "./src/core.ts"
import { calculateCommandCodeCost } from "./src/cost.ts"
import {
apiForModelId,
baseUrlForModel,
DEFAULT_MODELS_URL,
DEFAULT_PROVIDER_API_BASE,
@@ -51,7 +52,7 @@ function createProviderConfig(
name: "Command Code",
baseUrl: apiBase,
apiKey: getConfiguredApiKey() ?? "$COMMANDCODE_API_KEY",
api: "openai-completions",
api: "commandcode-custom",
streamSimple: streamCommandCode,
headers,
oauth: {
@@ -63,7 +64,7 @@ function createProviderConfig(
models: models.map((model) => ({
id: model.id,
name: model.name,
api: model.api,
api: "commandcode-custom",
baseUrl: baseUrlForModel(apiBase, model.api),
reasoning: model.reasoning,
...(thinkingMetadataForModel(model.id) ?? {}),
@@ -108,7 +109,12 @@ export default async function (pi: ExtensionAPI) {
})
const transport = createCommandCodeTransportRouter({
createStream: () => new AssistantMessageEventStream(),
streamProvider: streamNativeProvider,
streamProvider: (model, context, options) =>
streamNativeProvider(
{ ...model, api: apiForModelId(model.id), compat: model.compatConfig ?? model.compat },
context,
options,
),
streamGenerate,
})