Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Current honest state:
- the stock public build now ships `moonshotai/Kimi-K2.6` as the recommended
validated curated default, with installer-managed
`limit.output = 8192` for Kilo `7.2.0` compatibility
- the managed GonkaGate provider config now writes the validated
chat-completions catalog, currently Kimi K2.6 plus Qwen3 235B A22B Instruct
2507 FP8, so Kilo's OpenCode-style `/models` picker can switch between
validated GonkaGate models
- Kilo detection now accepts `@kilocode/cli >=7.2.0` without pre-blocking
future Kilo releases, while the audited compatibility baseline remains
`@kilocode/cli@7.2.0`
Expand Down Expand Up @@ -131,7 +135,8 @@ These are implementation facts today:
intake, managed config writes, rollback, effective-config verification, and
orchestration
- `src/constants/models.ts` now exposes Kimi K2.6 as the recommended validated
production default with installer-managed `limit.output = 8192` in the
production default plus the validated Qwen3 235B A22B Instruct 2507 FP8
catalog entry, each with installer-managed `limit.output = 8192` in the
written Kilo provider config
- `docs/specs/kilo-setup-prd/spec.md` is the copied Kilo setup PRD
- `docs/release-readiness.md` records the current production-readiness audit
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Wrote the validated GonkaGate chat-completions catalog into the managed
provider config so Kilo's OpenCode-style `/models` picker can switch between
Kimi K2.6 and Qwen3 235B A22B Instruct 2507 FP8.
- Accepted Kilo versions at or above `@kilocode/cli >=7.2.0` instead of
pre-blocking future Kilo releases with the previous `7.2.0`-only gate.
- Kept local verification blockers and mismatches visible in rollback output
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ Current public baseline:
- current transport target: `chat/completions`
- curated default:
`moonshotai/Kimi-K2.6`
- managed validated catalog for Kilo's OpenCode-style `/models` picker:
`moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`
- installer-managed `limit.output = 8192` for Kilo compatibility
- no native Windows production claim yet

Expand All @@ -92,12 +95,14 @@ The installer will:
1. detect `kilo`, or fall back to `kilocode`
2. verify local Kilo is at least `@kilocode/cli >=7.2.0`
3. show the curated model choice
4. choose the recommended scope automatically:
4. write the validated GonkaGate provider model catalog for Kilo's `/models`
picker
5. choose the recommended scope automatically:
- inside a git repository: `project`
- outside a repository: `user`
5. collect your API key through a hidden prompt
6. write the managed config and verify the result
7. return you to normal `kilo` usage
6. collect your API key through a hidden prompt
7. write the managed config and verify the result
8. return you to normal `kilo` usage

On interactive reruns, the installer asks about scope only if the last
installer-managed scope differs from the new recommendation.
Expand Down Expand Up @@ -201,6 +206,9 @@ This repository intentionally stays narrow today:
- current transport target: `chat/completions`
- current curated default:
`moonshotai/Kimi-K2.6`
- validated GonkaGate models exposed to Kilo's `/models` picker:
`moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`
- real-path Kilo verification is not the production default
- native Windows production support is not claimed yet
- future Kilo releases are not pre-blocked by version, but observed
Expand Down
9 changes: 5 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Current contract documents:
- [`specs/kilo-setup-prd/spec.md`](./specs/kilo-setup-prd/spec.md): copied Kilo
setup PRD from the planning repository

This repository ships the Kilo installer runtime with a validated curated Kimi
K2.6 default, installer-managed `limit.output = 8192` for Kilo compatibility,
and a minimum accepted Kilo floor of `@kilocode/cli >=7.2.0` without a preset
upper version bound.
This repository ships the Kilo installer runtime with a validated curated
GonkaGate chat-completions catalog, Kimi K2.6 as the recommended default,
installer-managed `limit.output = 8192` for Kilo compatibility, and a minimum
accepted Kilo floor of `@kilocode/cli >=7.2.0` without a preset upper version
bound.
3 changes: 3 additions & 0 deletions docs/gonkagate-x-kilo.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ Right now the public default is deliberately small:
- transport: `chat/completions`
- minimum Kilo floor: `@kilocode/cli >=7.2.0`
- recommended validated model: `moonshotai/Kimi-K2.6`
- validated catalog exposed to Kilo's OpenCode-style `/models` picker:
`moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`
- managed limits: `limit.context = 262144`, `limit.output = 8192`

We are treating model support as a curated list, not as a vague "it probably
Expand Down
13 changes: 9 additions & 4 deletions docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ Current public limit:
- the curated default is
`moonshotai/Kimi-K2.6` with `limit.context = 262144` and
`limit.output = 8192`
- broader model claims still require additional proof before they should be
added to the validated public choice set
- the written provider config includes the validated chat-completions model
catalog, currently `moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`, so Kilo's OpenCode-style
`/models` picker can switch between validated GonkaGate models
- broader model claims still require additional proof before models should be
added to the validated catalog

## Install Flow

Expand All @@ -50,7 +54,8 @@ Current public limit:
- `GONKAGATE_API_KEY`
- `--api-key-stdin`
7. Save the secret only under `~/.gonkagate/kilo/api-key`.
8. Write or update the user-level provider definition.
8. Write or update the user-level provider definition, including the validated
GonkaGate model catalog for Kilo's `/models` picker.
9. When `project` scope is chosen, write only activation settings into
`.kilo/kilo.jsonc`.
10. On rerun, remove only installer-owned stale GonkaGate activation from the
Expand Down Expand Up @@ -118,6 +123,6 @@ The repository must stay explicit about what is not yet claimed:
- no GonkaGate `responses` transport claim
- no production-ready native Windows claim before the native oracle-safety
proof exists
- no implication that every future Kilo behavior, broader model catalog, or
- no implication that every future Kilo behavior, live GonkaGate model, or
native Windows path is already proven just because the current default is
public
20 changes: 13 additions & 7 deletions docs/release-readiness.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ docs, and tests for these facts:
- current GonkaGate transport claim: `chat/completions`
- curated public default:
`moonshotai/Kimi-K2.6`
- curated model limits:
- validated provider catalog exposed to Kilo's OpenCode-style `/models` picker:
`moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`
- curated model limits for the validated catalog:
`limit.context = 262144`; `limit.output = 8192`
- managed secret path: `~/.gonkagate/kilo/api-key`
- project scope stays secret-free and still depends on a compatible
Expand All @@ -37,9 +40,12 @@ Moonshot metadata checked on 2026-04-29:
- the model card documents OpenAI-compatible chat completions access through
Moonshot's API
- the API docs describe the supported request path as `POST /v1/chat/completions`
- the package writes `limit.output = 8192` as the installer-managed Kilo
compatibility clamp because Kilo `7.2.0` requires a numeric output limit in
custom model config
- the package writes `limit.output = 8192` for validated catalog entries as
the installer-managed Kilo compatibility clamp because Kilo `7.2.0` requires
a numeric output limit in custom model config
- the April 14, 2026 Kilo compatibility spike captured
`qwen/qwen3-235b-a22b-instruct-2507-fp8` as a validated
chat-completions model with a 262K context window and `maxTokens` 8192
- npm registry metadata checked on 2026-04-29 showed `@kilocode/cli` patch
releases in the `7.2.x` line, including `7.2.14`, with both `kilo` and
`kilocode` binaries still exposed by the wrapper package
Expand All @@ -53,7 +59,7 @@ The repository must continue to avoid these claims:
- no claim that GonkaGate `responses` transport works today
- no claim that real-path Kilo verification is the production default
- no claim that native Windows production support is proven
- no claim that every future Kilo behavior or additional GonkaGate model is
- no claim that every future Kilo behavior or live GonkaGate model is
proven just because the current curated default is shipped

## Remaining Follow-Up Items
Expand All @@ -69,5 +75,5 @@ repository-only pass:

Those items do not change the current package contract: the publishable surface
remains the minimum Kilo `7.2.0` floor without an upper version bound, the
validated Kimi curated default, and the current non-Windows verification policy
documented above.
validated GonkaGate chat-completions catalog with Kimi as the recommended
default, and the current non-Windows verification policy documented above.
13 changes: 13 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ If you see a config error mentioning
you are likely running a stale build that predates the required Kilo 7.2.0
output-limit fix.

## Why Does `/models` Show Only One GonkaGate Model?

Current builds write the validated GonkaGate chat-completions catalog into
`provider.gonkagate.models`, so Kilo's OpenCode-style `/models` picker should
show both `moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`.

If `/models` still shows only one GonkaGate model, rerun the installer from a
current build so the user-level `provider.gonkagate` definition is refreshed.
Also check for a higher-precedence Kilo layer such as project config,
`KILO_CONFIG`, `KILO_CONFIG_DIR`, or `KILO_CONFIG_CONTENT` defining its own
`provider.gonkagate.models` object.

## The CLI Says Setup Is Blocked

Common reasons:
Expand Down
13 changes: 9 additions & 4 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Today the public package is intentionally narrow:
- current transport target: `chat/completions`
- current curated default:
`moonshotai/Kimi-K2.6`
- validated GonkaGate catalog for Kilo's OpenCode-style `/models` picker:
`moonshotai/Kimi-K2.6` and
`qwen/qwen3-235b-a22b-instruct-2507-fp8`
- managed model limits: `limit.context = 262144`, `limit.output = 8192`
- no native Windows production claim yet

Expand Down Expand Up @@ -57,12 +60,14 @@ The installer will then:
1. Detect `kilo`, or fall back to `kilocode`.
2. Check the minimum supported Kilo floor.
3. Offer the curated GonkaGate model choice.
4. Choose the recommended scope automatically:
4. Write the validated GonkaGate provider model catalog for Kilo's `/models`
picker.
5. Choose the recommended scope automatically:
- inside a git repository: `project`
- outside a repository: `user`
5. Prompt for the GonkaGate API key using a hidden input.
6. Write the managed config and verify the result.
7. Return you to normal `kilo` usage.
6. Prompt for the GonkaGate API key using a hidden input.
7. Write the managed config and verify the result.
8. Return you to normal `kilo` usage.

Interactive reruns ask about scope only when the previous installer-managed
scope differs from the new recommendation.
Expand Down
2 changes: 1 addition & 1 deletion src/constants/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const CONTRACT_METADATA = {
packageName: "@gonkagate/kilo-setup",
publicEntrypoint: "npx @gonkagate/kilo-setup",
publicState:
"Installer runtime is shipped with a validated curated Kimi K2.6 default for @kilocode/cli >=7.2.0 installs, with installer-managed limit.output = 8192 for compatibility.",
"Installer runtime is shipped with a validated curated GonkaGate chat-completions catalog for @kilocode/cli >=7.2.0 installs, with Kimi K2.6 as the recommended default and installer-managed limit.output = 8192 for compatibility.",
secondaryBinName: "gonkagate-kilo",
upstreamKilo: {
checkedAt: "2026-04-29",
Expand Down
11 changes: 7 additions & 4 deletions src/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ Start here:
seams testable
- `secrets.ts`, `scope.ts`, and `state.ts` own managed secret/config/install-
state writes
- `managed-provider-config.ts` writes the validated GonkaGate
chat-completions model catalog into the Kilo/OpenCode-compatible provider
shape while keeping activation in the top-level `model` setting
- `managed-write-transaction.ts` and `rollback.ts` restore installer-owned
writes when durable verification fails
- `verify-effective.ts`, `verify-layers.ts`, and related helpers implement the
durable/current-session Kilo proof path with redacted diagnostics

The current stock runtime is still honestly blocked before writes because the
default curated Kilo registry has no validated production model yet. Keep
Kilo-specific behavior here and do not import OpenCode env vars or config
targets as runtime defaults.
The current stock runtime ships a validated curated Kimi K2.6 default plus the
validated Qwen3 235B A22B Instruct 2507 FP8 catalog entry. Keep Kilo-specific
behavior here and do not import OpenCode env vars or config targets as runtime
defaults.
52 changes: 44 additions & 8 deletions src/install/managed-provider-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import {
} from "../constants/gateway.js";
import {
getCuratedModelByKey,
getValidatedModels,
type CuratedModel,
type CuratedModelCompatibility,
type CuratedModelKey,
type CuratedModelLimits,
type ValidatedCuratedModel,
} from "../constants/models.js";
import type { JsonObject } from "../json.js";

Expand All @@ -27,6 +29,40 @@ export function buildManagedProviderConfig(
modelKey: CuratedModelKey,
): JsonObject {
const model = resolveCuratedModel(modelKey);
const providerModels = createManagedProviderModels(model);
const models: JsonObject = {};

for (const providerModel of providerModels) {
models[providerModel.key] = createManagedModelConfig(providerModel);
}

return {
models,
name: GONKAGATE_PROVIDER_NAME,
npm: model.adapterPackage,
options: createManagedProviderOptions(model),
};
}

function createManagedProviderModels(
selectedModel: CuratedModel,
): readonly ValidatedCuratedModel[] {
const providerModels = getValidatedModels().filter(
(model) =>
model.transport === selectedModel.transport &&
model.adapterPackage === selectedModel.adapterPackage,
);

if (providerModels.some((model) => model.key === selectedModel.key)) {
return providerModels;
}

throw new Error(
`Validated model catalog does not include selected model: ${selectedModel.key}`,
);
}

function createManagedModelConfig(model: ValidatedCuratedModel): JsonObject {
const runtimeCompatibility = model.runtimeCompatibility as
| CuratedModelCompatibility
| undefined;
Expand Down Expand Up @@ -60,6 +96,13 @@ export function buildManagedProviderConfig(
Object.assign(modelConfig, modelOptions);
}

return modelConfig;
}

function createManagedProviderOptions(model: CuratedModel): JsonObject {
const runtimeCompatibility = model.runtimeCompatibility as
| CuratedModelCompatibility
| undefined;
const providerOptions: JsonObject = {
apiKey: GONKAGATE_SECRET_FILE_REFERENCE,
baseURL: GONKAGATE_BASE_URL,
Expand All @@ -69,14 +112,7 @@ export function buildManagedProviderConfig(
Object.assign(providerOptions, runtimeCompatibility.providerOptions);
}

return {
models: {
[model.key]: modelConfig,
},
name: GONKAGATE_PROVIDER_NAME,
npm: model.adapterPackage,
options: providerOptions,
};
return providerOptions;
}

function resolveCuratedModel(modelKey: CuratedModelKey): CuratedModel {
Expand Down
2 changes: 2 additions & 0 deletions test/install/scope.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ test("user scope writes provider and activation to user config and removes owned
userConfigText,
/"model": "gonkagate\/qwen3-235b-a22b-instruct-2507-fp8"/,
);
assert.match(userConfigText, /"kimi-k2\.6"/);
assert.match(userConfigText, /"qwen3-235b-a22b-instruct-2507-fp8"/);
assert.doesNotMatch(userConfigText, /small_model/);
assert.doesNotMatch(projectConfigText, /"model": "gonkagate\//);
assert.match(projectConfigText, /"small_model": "custom\/small"/);
Expand Down
16 changes: 16 additions & 0 deletions test/package-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,19 @@ test("managed provider config includes the required Kilo output token limit", ()
assert.equal(providerConfig.models["kimi-k2.6"]?.limit?.context, 262144);
assert.equal(providerConfig.models["kimi-k2.6"]?.limit?.output, 8192);
});

test("managed provider config exposes the validated catalog for model switching", () => {
const providerConfig = buildManagedProviderConfig("kimi-k2.6") as {
models: Record<string, { id?: string; name?: string }>;
};

assert.deepEqual(Object.keys(providerConfig.models), [
"kimi-k2.6",
"qwen3-235b-a22b-instruct-2507-fp8",
]);
assert.equal(providerConfig.models["kimi-k2.6"]?.id, "moonshotai/Kimi-K2.6");
assert.equal(
providerConfig.models["qwen3-235b-a22b-instruct-2507-fp8"]?.id,
"qwen/qwen3-235b-a22b-instruct-2507-fp8",
);
});
Loading