@0perator/operator 0.1.284 → 0.1.285

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/acp/agent.js CHANGED
@@ -14,7 +14,7 @@ import { readFileSync, rmSync, statSync } from "node:fs";
14
14
  import { isAbsolute } from "node:path";
15
15
  import { PROTOCOL_VERSION, RequestError } from "@zed-industries/agent-client-protocol";
16
16
  import { createAutonomySession } from "../autonomy/session-factory.js";
17
- import { modelRegistry, visibleModels } from "../router/models.js";
17
+ import { modelRegistry } from "../router/models.js";
18
18
  import { hasByoToken } from "../auth/byo.js";
19
19
  import { operatorPath } from "../config/home.js";
20
20
  import { redactSecrets } from "../engine/redact.js";
@@ -183,7 +183,7 @@ export class OperatorAcpAgent {
183
183
  modelOption(sessionId) {
184
184
  const live = this.sessions.get(sessionId);
185
185
  const moa = this.settings.moa;
186
- return buildModelConfigOption(visibleModels(modelRegistry(this.settings.models), hasByoToken), live?.session.currentModel() ?? "", !!moa?.proposers?.length);
186
+ return buildModelConfigOption(modelRegistry(this.settings.models), live?.session.currentModel() ?? "", !!moa?.proposers?.length, hasByoToken); // filtered there, active-but-hidden re-admitted there (never a lying currentValue)
187
187
  }
188
188
  /** SDK-0.4.5 legacy path (wire: session/set_model) — what Zed ships today. The spec-stable
189
189
  * session/set_config_option is translated onto this method by the run.ts shim; both client
@@ -2,14 +2,26 @@
2
2
  * MOA is omitted unless a moa block exists in settings (setModel refuses it otherwise, and a
3
3
  * dropdown that can fail is the dishonesty SPEC/providers.md §1 bans). Descriptions carry ctx
4
4
  * size and kind so the user can price a switch with their eyes. */
5
- export function buildModelConfigOption(registry, currentId, moaAvailable) {
5
+ export function buildModelConfigOption(registry, currentId, moaAvailable, hasByo) {
6
6
  const options = [];
7
7
  for (const p of registry) {
8
+ if (p.hidden)
9
+ continue; // picker truth: down slots aren't offered…
10
+ if (p.byo && !(hasByo ? hasByo(p.byo) : false))
11
+ continue; // …nor unconnectable connectors
8
12
  if (p.kind === "orchestrated" && !moaAvailable)
9
13
  continue;
10
14
  const bits = [p.desc, p.kind === "single" && p.ctx ? `${Math.round(p.ctx / 1000)}k ctx` : null, p.kind === "orchestrated" ? "mixture-of-agents" : null].filter(Boolean);
11
15
  options.push({ value: p.id, name: p.label, description: bits.join(" · ") || undefined });
12
16
  }
17
+ // …but a selector that misreports the session's REAL model is the deeper dishonesty: if the
18
+ // active profile is hidden (switched-to before it went down, scripted, or aliased), it joins
19
+ // the list labeled as such — selectModel resolves hidden ids, so the option is never a dead end.
20
+ if (currentId && !options.some((o) => o.value === currentId)) {
21
+ const cur = registry.find((p) => p.id === currentId);
22
+ if (cur)
23
+ options.push({ value: cur.id, name: cur.label, description: "active — hidden from the picker" });
24
+ }
13
25
  return {
14
26
  id: "model",
15
27
  name: "Model",
@@ -1,4 +1,8 @@
1
- const PROPOSER_TIMEOUT_MS = 60_000;
1
+ // Fan-out budget per proposer. 60s default: generous for a draft, hard enough that a contended
2
+ // JL1 slot times out gracefully instead of stalling the aggregator (measured 2026-10-12: same
3
+ // task 1.1s local vs 60s+ timeout on the shared lane). Env-overridable — heavy offline drafts on
4
+ // a slow link want more; JSC/mobile has no process, so this reads the same way agent.ts reads env.
5
+ const PROPOSER_TIMEOUT_MS = Math.min(600_000, Math.max(5_000, Number(globalThis.process?.env?.KODE_PROPOSER_TIMEOUT_MS) || 60_000));
2
6
  /** One proposer call: a plain (non-streaming, tool-free) OpenAI-compatible chat completion. Never
3
7
  * throws — a failure or timeout comes back as a draft with empty content + an `error`, so the
4
8
  * caller can drop it without the whole fan-out failing (a proposer is a nice-to-have, not a
@@ -9,22 +9,21 @@ export const MODEL_ALIASES = {
9
9
  "spectre": "cortana", // flagship renamed Spectre -> Cortana 35B (2026-10-07); old id keeps resolving
10
10
  };
11
11
  export const BUILTIN_MODELS = [
12
- { id: "operator-1m", label: "Operator 128K", kind: "single", desc: "131,072-token (128K) context (:8097) — matched to the server's --ctx-size so the engine compacts BEFORE the wall (no overflow/interruption on long autonomous turns)", endpoint: "http://127.0.0.1:8097/v1", model: "aurora-code-1", ctx: 128000 },
13
- { id: "operator-128k", label: "Operator 128K", kind: "single", desc: "128K context, lighter RAM (:8096)", endpoint: "http://127.0.0.1:8096/v1", model: "aurora-code-1", ctx: 131072 },
12
+ { id: "operator-1m", label: "Operator 1M (local)", kind: "single", desc: "RECOMMENDED DEFAULT — local Aurora code model on this box's GPU (:8097, 24-47 tok/s measured, warm prefix-cache, no shared-slot contention); ctx 300K matched under the served 307,200 wall so compaction lands BEFORE the edge", endpoint: "http://127.0.0.1:8097/v1", model: "aurora-code-1", ctx: 300000 },
13
+ { id: "operator-128k", label: "Operator 128K", kind: "single", desc: "128K context, lighter RAM (:8096) — slot not served on this fleet today; hidden from the picker, resolves by id when the slot comes up", endpoint: "http://127.0.0.1:8096/v1", model: "aurora-code-1", ctx: 131072, hidden: true },
14
14
  // QwenCloud Token Plan BYO connectors (SPEC/providers.md §2 "API-key connectors"). Same keychain
15
15
  // account ("qwen") serves both; the picker hides them until connected (§1 honest availability), and
16
16
  // authHeaders NEVER sends the Operator token to this host. ctx starts conservative and self-clamps
17
17
  // to the served truth (observeContext).
18
18
  { id: "qwen3.8-max", label: "Qwen 3.8 Max", kind: "single", desc: "BYO QwenCloud Token Plan — credits from your plan", endpoint: "https://token-plan.maas.qwencloudapi.com/compatible-mode/v1", model: "qwen3.8-max", ctx: 262144, byo: "qwen", transport: "openai" },
19
19
  { id: "qwen3.8-flash", label: "Qwen 3.8 Flash", kind: "single", desc: "BYO QwenCloud Token Plan — fast tier, your credits", endpoint: "https://token-plan.maas.qwencloudapi.com/compatible-mode/v1", model: "qwen3.8-flash", ctx: 262144, byo: "qwen", transport: "openai" },
20
- // AXE Token Plan connector — the INVERSE of the QwenCloud entries: here AXE is the vendor
21
- // (_ai-docs/architecture/axe-model-vendor.md, phase V1). api.axe.onl is AXE's own gateway
22
- // (nginx + LiteLLM); third-party users paste an `sk-axe-…` virtual key (`operator auth byo axe`),
23
- // stored under keychain account "axe" — a separate account from the operator token, so the two
24
- // can never be confused (auth/byo.ts separation guard). Gateway-side sk-axe acceptance is the V0
25
- // deployment step; until then the connector stays hidden (honest availability). A ghost-32b API
26
- // SKU joins once the gateway routes JL1:8101 (reverse tunnel owed — api/README "524" note).
27
- { id: "axe-aurora-300k", label: "AXE Aurora 300K (API)", kind: "single", desc: "BYO AXE Token Plan — agent-tuned 300K reasoner via api.axe.onl", endpoint: "https://api.axe.onl/v1", model: "aurora-code-1", ctx: 307200, byo: "axe", transport: "openai" },
20
+ // AXE Token Plan: api.axe.onl is AXE's OWN gateway (nginx + LiteLLM) and the Operator token is its
21
+ // native auth (authHeaders scoping sends it to *.axe.onl — aurora.ts). Third-party `sk-axe-…` virtual
22
+ // keys are the V1 vendor plan (_ai-docs/architecture/axe-model-vendor.md); until the gateway actually
23
+ // issues them, gating this profile behind an unconnectable BYO account hid our OWN flagship remote
24
+ // lane from our own picker (2026-10-12 picker-truth audit) — so it is a plain profile today. When V1
25
+ // ships, reintroduce the byo:"axe" SKU as a SEPARATE connector id, never by re-gating this one.
26
+ { id: "axe-aurora-300k", label: "Aurora 300K (AXE cloud)", kind: "single", desc: "remote shared slot via api.axe.onl — big-context fallback, NOT default: contended decode measured 1-4.6 tok/s vs local 24-47 (JL1 serves everyone); cold >~100K prefills can also hit the Cloudflare ~125s edge cutoff", endpoint: "https://api.axe.onl/v1", model: "aurora-code-1", ctx: 307200, transport: "openai" },
28
27
  // Spectre — the flagship, replacing Ghost (2026-10-07). Ghost 32B was the prior self-hosted abliterated
29
28
  // Qwen3-VL-32B on this slot; retired when Spectre proved 4× faster at equal capability (its weights + restore
30
29
  // command are kept at ~/.axe/logs/ghost-restore-cmd.txt — reversible). Spectre = Huihui-Qwen3.6-35B-A3B-
@@ -36,7 +35,7 @@ export const BUILTIN_MODELS = [
36
35
  // truncated a round at token 32767 (finish=length) mid-tool-call, and that cut call poisoned the session (0.1.259).
37
36
  // 32000 sits just UNDER the real wall (margin) AND under LEAN_HARNESS_CTX so Cortana drops the heavy memory/handoff
38
37
  // (which alone was ~16K = half the window) — persona + unrestricted layer kept. Raise ONLY if the server's --ctx-size does.
39
- { id: "cortana", label: "Cortana 35B", kind: "single", desc: "flagship — abliterated Qwen3.6-35B-A3B MoE (~3B active, ~40 tok/s), uncensored + vision (JL1:8112, llama.cpp, 256K ctx)", endpoint: "http://192.168.1.103:8112/v1", model: "/Volumes/Ai Storage/jl1-local/models/aurorax/Huihui-Qwen3.6-35B-A3B-abliterated.Q4_K_M.gguf", ctx: 262144 },
38
+ { id: "cortana", label: "Cortana 35B (JL1)", kind: "single", desc: "flagship MoE — abliterated Qwen3.6-35B-A3B (~3B active; ~40 tok/s ONLY when JL1 is quiet — shares the box with the 300K cloud slots and fell to 1-4 tok/s under fleet load; pick for vision/uncensored jobs, prefer Operator 1M local otherwise)", endpoint: "http://192.168.1.103:8112/v1", model: "/Volumes/Ai Storage/jl1-local/models/aurorax/Huihui-Qwen3.6-35B-A3B-abliterated.Q4_K_M.gguf", ctx: 262144 },
40
39
  // Qwen3-4B — fast LOCAL tier (stock qwen3-4b-mlx-q4, 2.26GB MLX 4-bit, ctx 40960) served via mlx_lm.server
41
40
  // on JL1:8110. Qwen3 vocab (151936) — the same family as ghost-32b, so it's the review-recommended quick tier
42
41
  // AND the vocab lineage for ghost spec-decode (the actual draft is Qwen3-0.6B, too small to list here). Runs
@@ -47,15 +46,18 @@ export const BUILTIN_MODELS = [
47
46
  // (Q4_K_M, ~14GB) with a bolted-on Mistral-Small-3.1 mmproj for vision. Dense 24B (not MoE), served on
48
47
  // JL1:8114 via llama.cpp (--jinja, q8 KV). ctx 32768 ≥ LEAN_HARNESS_CTX → full harness. A quick drop-in to
49
48
  // test a smaller/different flavour alongside Spectre without the 35B footprint.
50
- { id: "venice-24b", label: "Venice 24B", kind: "single", desc: "lighter uncensored tier — Dolphin-Mistral-24B-Venice + vision (JL1:8114, llama.cpp)", endpoint: "http://192.168.1.103:8114/v1", model: "/Volumes/Ai Storage/exotic-models/dolphin-mistral-24b-venice-gguf/cognitivecomputations_Dolphin-Mistral-24B-Venice-Edition-Q4_K_M.gguf", ctx: 32768 },
49
+ { id: "venice-24b", label: "Venice 24B", kind: "single", desc: "lighter uncensored tier — Dolphin-Mistral-24B-Venice + vision (JL1:8114) — slot stopped today; hidden from the picker, resolves by id once launched", endpoint: "http://192.168.1.103:8114/v1", model: "/Volumes/Ai Storage/exotic-models/dolphin-mistral-24b-venice-gguf/cognitivecomputations_Dolphin-Mistral-24B-Venice-Edition-Q4_K_M.gguf", ctx: 32768, hidden: true },
51
50
  // Code tier for the coding/Replit-clone surface — Qwen2.5-Coder-3B has a real chat template + tool-calling
52
51
  // + FIM (ollama reports "completion, tools, insert"), unlike StarCoder2/replit-code (completion-only, can't
53
52
  // drive an agent loop). Ollama on JL1, on-demand (loads ~3GB, so SELECT only when JL1 swap has headroom).
54
53
  // ctx 32000 stays just under the 32768 train wall (the 0.1.259/260 overrun bug) and below LEAN_HARNESS_CTX
55
54
  // so a 3B gets the lean harness. LICENCE: Qwen Research Licence (non-commercial) — fine for owner/eval use;
56
- // the paid product should use an Apache-2.0 size (qwen2.5-coder 1.5b/7b). transport:"openai" = Ollama /v1.
57
- { id: "qwen-coder", label: "Qwen Coder 3B", kind: "single", desc: "code tier — Qwen2.5-Coder-3B Q4_K_M (chat + tool-calling + FIM), Ollama on JL1 (on-demand ~3GB); Qwen Research Licence, non-commercial", endpoint: "http://127.0.0.1:11434/v1", model: "qwen2.5-coder:3b", ctx: 32000, transport: "openai" },
58
- { id: "moa", label: "MOA (Mixture of Agents)", kind: "orchestrated", desc: "fan out to proposers, synthesize with an aggregator" },
55
+ // the paid product should use an Apache-2.0 size (qwen2.5-coder 1.5b/7b).
56
+ // transport:"openai" = Ollama /v1. ENDPOINT FIX 2026-10-12: was 127.0.0.1:11434, which only resolves
57
+ // ON JL1 — every laptop picker entry pointed at its own dead loopback. LAN address like the other
58
+ // JL1 slots.
59
+ { id: "qwen-coder", label: "Qwen Coder 3B (JL1)", kind: "single", desc: "code tier — Qwen2.5-Coder-3B Q4_K_M (chat + tool-calling + FIM), Ollama on JL1:11434 (on-demand ~3GB); Qwen Research Licence, non-commercial", endpoint: "http://192.168.1.103:11434/v1", model: "qwen2.5-coder:3b", ctx: 32000, transport: "openai" },
60
+ { id: "moa", label: "MOA (Mixture of Agents)", kind: "orchestrated", desc: "the team slot — fans each turn to aurora-local + Cortana 35B + Qwen-Coder 3B proposers (settings.moa, 60s fan-out, graceful per-draft failure) and synthesizes with local Aurora as agent-loop aggregator; roster + benchmark in _ai-docs" },
59
61
  ];
60
62
  /** The runtime registry: the built-ins, with any settings.models entries merged in (overriding a
61
63
  * built-in by id, or adding a new one) — same shape either way, so /model doesn't care which. */
@@ -102,7 +104,7 @@ export function selectModel(registry, id, hasByo) {
102
104
  /** The picker-truth view of a registry: drops BYO profiles whose key isn't connected (and ALL
103
105
  * unresolvable ones when the resolver is absent — a picker must never offer what setModel refuses). */
104
106
  export function visibleModels(registry, hasByo) {
105
- return registry.filter((p) => !p.byo || (hasByo ? hasByo(p.byo) : false));
107
+ return registry.filter((p) => !p.hidden && (!p.byo || (hasByo ? hasByo(p.byo) : false)));
106
108
  }
107
109
  /** Strip a trailing /v1 so a ModelProfile/MoaAggregator endpoint can feed the AuroraRouter, whose
108
110
  * base is bare (engine/aurora.ts's chat() appends /v1/chat/completions itself). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0perator/operator",
3
- "version": "0.1.284",
3
+ "version": "0.1.285",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "operator": "dist/cli.js",