Repository navigation
Description
Outcome and dependencies
Extend the same native Codex path beyond first-class Ollama/LM Studio profiles using protocol- and capability-based configuration, not separate coding engines.
Parent: #376. Blocked for completion by: #378 (LM-2 connections/discovery), #379 (LM-3 scoped native execution) and #380 (LM-5 local policy). Delivery group: Local models v1 / Gate C. Priority: P2: required for the broad compatibility claim, not the initial Ollama/LM Studio pilot. Follow the shared execution contract in #376.
Context and source entry points
Refresh current main, scoped instructions and accepted producer interfaces. Publication baseline: ec7be578765f9ce54976882853e57ca190252361.
Existing/new producer paths: #378's discovery modules and #379's native profile modules.
Proposed: small metadata presets under apps/desktop/src/main/engine/local-models/, apps/desktop/test/local-model-compatibility.test.ts; extend docs/local-models.md with the versioned compatibility matrix. Reuse the same fixtures and actual app-server path.
Consumes: profiles, qualification evidence schema, native execution and privacy/admission policy. Produces: lightweight presets and reproducible qualification results keyed to exact runtime/model/template/tool-parser/context/native-CLI configuration. This is not an all-models guarantee.
Implementation steps
- Add lightweight llama.cpp/vLLM presets and retain the manual Custom Responses option. Prefer shared execution; add provider-specific metadata parsing only where it improves accuracy. Arbitrary identifiers remain supported within the existing explicit-loopback endpoint policy.
- Verify the actual Responses endpoint and native harness tool forms: streamed arguments, tool-result round trips, instructions, reasoning fields and conversation continuation. A Chat Completions endpoint or
/modelsresponse alone does not establish compatibility. Exercise the app-server integration, not only direct HTTP or an interactive terminal demo. - Record model revision/build or digest where exposed, quantization, template/tool parser, effective context, runtime version and native CLI version. Unknown fields remain unknown. Changes invalidate or mark old qualification stale rather than silently reusing a green badge.
- Document server-side prerequisites and actionable remedies without downloading weights or rewriting the user's server configuration. Cover stateless Responses/history handling and unsupported native tool forms. Do not hide gaps behind a translation proxy or weaken permissions to make a fixture pass.
- Let other runtime-served models qualify through the same contract without source edits or model-family allowlists. Local MLX/Transformers/other implementations are not automatically supported; qualify their actual endpoint/tool behavior. Show text-only/embedding/unsupported model states honestly; native chat is offered only when its exact path is verified.
- When a concrete upstream defect blocks an otherwise supported route, record the minimal reproducible failure, exact upstream owner/version and safety impact in [Tracker][LM] Integrate local models through native harnesses with verified compatibility #376. Create/link a narrowly scoped upstream issue only for that evidenced blocker; do not pre-create speculative issues in engine vendors' repos.
Acceptance criteria
- AC1: at least one exact combination for every runtime advertised as supported completes the native coding fixture. Missing hardware remains a named unverified gate, not a fabricated pass.
- AC2: a chat-only API, embedding model and missing-tool model are classified accurately and cannot masquerade as coding-ready.
- AC3: arbitrary custom model IDs work without code edits when the endpoint/tool contract passes.
- AC4: no new coding SDK, inference protocol bridge, engine-specific tool dispatcher or heavyweight provider abstraction is introduced.
- AC5: template/parser/context/model/runtime/CLI changes make previous evidence visibly stale; the published matrix includes observed limits and setup requirements.
Verification and handoff
Use deterministic fake-runtime/native-CLI fixtures for PR CI; keep large model downloads/GPU requirements out of default tests. Separately run authorized native qualification on preinstalled runtimes/models. Run focused compatibility tests, pnpm build && pnpm test, and UI pnpm test:e2e when changed. Record exact SHA, commands, versions, real tool outcomes, failures/skips and locality limits. Update status and dated evidence; no merge/release.
Long-running goal prompt
Implement LM-6 in TypeSafeAI/modex under #376 after consuming #378/#379/#380's accepted artifacts. Read current AGENTS.md, actual source and open PRs; verify main and an owned worktree. Qualify servers against the existing native contract. Add the smallest metadata presets for llama.cpp/vLLM and preserve the generic Responses/manual-ID path. Test real tool/history/Stop behavior rather than inferring support from API branding. Record exact model/template/parser/context/runtime/CLI evidence and invalidate stale qualification. Do not answer protocol gaps by building a new executor/proxy or weakening policy. Use failing-first tests, run targeted/full checks and prepare signed reviewable commits with status/evidence. Checkpoint SHAs, results, remaining hardware/native gates and one next action. No merge, release, global config rewrites or unapproved downloads.
Follow-up / resume prompt
Resume LM-6 from current issue/PR and checkpoint. Verify worktree ownership, actual diff and prerequisite contracts. Refresh the exact runtime/model/template/parser/context/CLI matrix and invalidate stale results. Reproduce the highest-impact failing combination with a bounded fixture; record unsupported semantics precisely. Preserve working shared execution instead of adding speculative adapters for untested engines. A new upstream issue needs a concrete owner/version/reproducer and tracker link. Rerun smoke/full checks, distinguish fixtures from native hardware evidence and leave missing gates open with a next action. No merge, publication or scope expansion.
Activity
BunsDev commentedon Oct 23, 2026
Refreshed goal prompts — 2026-10-23 (
mainat203a350)On
mainalready:local-modelscode, no presets, nodocs/local-models.mdand no LM entry indocs/status.md;collaborationMode.settings.modelmust stay pinned to the local target in any qualified configuration.Still open:
048d1e8on the locallm1-contractbranch. It is not pushed and has no PR. The evidence covers one combination: Codex 0.163.0 against Strata engine 0.1.47 (Metal) servingqwen3.8-flash-next-iq3_sat 32768 context. It shows a read, Stop with background-terminal cleanup, and a same-thread continuation over/v1/responses. Gate A is not accepted, and fresh-process resume, images and offline operation are unqualified.llamacpp,vllmandcustom, and LM-2: secure local connections and bounded model discovery (#378) #386 has no explicit mapping to them yet. A local review (not on GitHub) found two LM-2 defects to fix before anything consumes it.local-model-compatibilitytests and no versioned matrix.Local worktrees
lm1-contract,lm2-discovery,lm3-isolationandlm-foundationare claimed by other sessions. Don't adopt or edit them.Long-running goal prompt
Follow-up / resume prompt
BunsDev commentedon Nov 11, 2026
LM-6 native qualification checkpoint — 2026-11-11
The instrumented native AC1 fixture completed through Modex
LocalExecution→ Codex 0.167.0 → the preinstalled Ollama-bundledllama-server. Tested source is candidate7d2d6c89de5a262d08876777a907568acd4a4405, tree2bd27e068003bc7306645f56dab368ab66399594; protected delivery is pending in #498.The bundled server reports
0.9.0-dev, build 1, commit6c01da627; this identifies the bundled build rather than an independently rebuilt upstream release. Its binary SHA256 is3806b140070f86d9fb4ab6eb90bebeda995bcba313a17590d34d3332d406e951. The approved qwen3-coder:30b GGUF has SHA2561194192cf2a187eb02722edcc3f77b11d21f537048ce04b67ccf8ba78863006a. It was served under the arbitrary IDmodex-lm6-fixture/coder:30bthrough the existing generic Responses connection.The tested configuration requested all-layer offload on enumerated
MTL0(Apple M5 Max), two CPU threads, one slot and 65,536 context tokens, with offline mode and server-owned agent/UI/warmup disabled. The actual server log confirms the loaded 65,536-token slot. Offloaded layer count was not measured.Read completed in 4,135 ms; the following fixture-approved edit and independent check completed in 2,584 ms. Workflow total was 6,736 ms, excluding outer server startup and input hashing. Production typed observations record three unique successful shell commands across two turns:
cat fixture.txt, the exact approved write toresult.txt, andnode check.cjs. Both exact fixture approval callbacks ran; literal fixture/result/check bytes and one recorded check effect were independently verified. These timings are one observation with uncontrolled host caches, without a comparative speedup claim.Model and native workers used the same identified kernel boundary; their external-TCP and outside-write probes returned EPERM. The synthetic HOME fixture retained its bytes, mtime and tree; the real Codex config.toml fingerprint remained unchanged. Before/after model-weight hashes match. Actual Codex/model child close events and owner exits/stream closures are retained. Independent review verified the original receipts, literal files, seven instrumentation-source bindings and all 855 compiled fingerprints.
Counterevidence remains: the two-thread CPU-only profile failed after 300,118 ms waiting for SSE while the server was still prefilling, with no tools or approvals. Codex's timeout was unchanged. An earlier startup-only attempt stopped because the context-log guard omitted this build's
n_ctx_slotfield; that first failure and its strict parser regression are retained separately.This establishes one instrumented native fixture configuration. Raw Codex sessions were removed by production disposal; the evidence is typed observations plus literal effects. No raw HTTP-status count or general exactly-once guarantee is claimed. Compaction, Stop/crash/OOM recovery, normal product UI, installed/human acceptance and product admission remain open. This does not qualify vLLM, LM Studio, every llama.cpp build or arbitrary generic servers, and it does not close #382 or #383.
Full local receipts and immutable source snapshots are retained in the campaign evidence packet. Canonical audit
lm6-metal-terminal-audit.jsonSHA256:4b6fe604f71e17a6e13822431f43a7e6c60915a79febd9f3f61050229721941f. A repository review draft is prepared in the evidence packet for a separate delivery after #498; checklists remain unticked where their full text is unmet.BunsDev commentedon Nov 12, 2026
Additional LM-6 evidence: the same bundled llama-server/approved-weight/native Codex combination from the read/edit/test receipt now has a completed instrumented Stop fixture at application head
7d2d6c89de5a262d08876777a907568acd4a4405, tree2bd27e068003bc7306645f56dab368ab66399594. The profile remained two CPU threads, configured Metal layers all/MTL0, one slot and observed 65,536 context. No application source or product admission changed.The existing production
LocalExecution/Codex path requested approval for exactlynode delayed-write.cjs stop. The seeded script recorded its actual start and ten-second effect deadline. The fixture sent the turn's AbortSignal 13 ms after that marker;runTurnreturnedinterruptedfive milliseconds later. There was one approval, one typed native tool start and a matching interrupted tool completion, one literal command-dispatch record, and zero effect records/files through the deadline plus 1,500 ms. These timings describe one fixture, not a universal latency or cancellation guarantee.The test observed that deadline before disposing its execution. The later owned Codex SIGKILL was fixture cleanup, not the ordinary Stop action. Both native and model owners closed with their output streams; subsequent probes found all five recorded process IDs absent and the owned listener refused connections. The native and inference-server boundary receipts share the same kernel profile and both record external TCP and outside-write denial. Synthetic configuration bytes/mtime/tree and the personal configuration fingerprint stayed unchanged; before/after model-weight digests match. All 1,279 tracked and 855 compiled build bindings remain unchanged.
Preexecution controls passed 19 receipt cases, two literal delayed-script cases and five controller lifecycle cases. A separate default invocation deliberately skipped the opt-in native test; the actual model run executed one test with zero failures, skips or cancellations. Independent preexecution and actual-receipt reviews found no Critical or Important findings in this scope. The inherited retained-copy limitation remains: its
controller.jsonis a pre-finalization snapshot; the canonical external receipt and original root provide terminal state. Raw CLI session files were removed by normal owned execution disposal, so the proof is retained typed observations, literal files and process receipts.Canonical evidence is
/Users/buns/Documents/Codex/2026-11-11/modex-closeout/lm6-stop-model-stop-first.json, withlm6-stop-native-terminal-audit.json,lm6-stop-native-terminal-independent-review.jsonand reviewed helper snapshots alongside it. This qualifies one instrumented production abort-path fixture. Renderer-button/human acceptance, fresh continuation/restart, server/native loss, OOM, overflow, compaction, other runtime/platform combinations, protected delivery and product admission retain their separate gates. No issue checkbox or support-matrix claim is completed by this result alone.BunsDev commentedon Nov 12, 2026
Additional LM-6 evidence at application head
7d2d6c89de5a262d08876777a907568acd4a4405, tree2bd27e068003bc7306645f56dab368ab66399594: the same bundled llama-server/approved weights/Codex combination now passes a two-process native execution restart fixture. This extends the bounded Stop receipt. The same owned inference server stayed running across both phases, with the previously recorded Metal profile, one slot and observed 65,536 context.The first worker performed one approved delayed command, returned interrupted after explicit Stop, observed zero effects through its ten-second deadline plus 1,501 ms, disposed its native execution, and exited with its streams closed. A second Node worker constructed a new production
LocalExecutionusing the persisted fixture target/profile. Its attempt to use the actual old native session failed with “native session is gone” before any native child, observation or approval. Only then did the fixture explicitly start a fresh turn without that handle and approve exactlynode delayed-write.cjs after-stop: one new native tool start/completion, one literal fresh dispatch and one effect. The original Stop dispatch remained one with zero effects. Both stored session handles match their corresponding typed native thread IDs and are distinct; both native processes and worker processes are distinct.The saved Stop receipt and fixture restart state stayed byte-identical, and the connection-profile digest matches before restart, before/after the fresh phase, and final disk bytes. Both synthetic configuration checks and the personal configuration fingerprint across both phases stayed unchanged. Native/server boundary receipts share the same kernel profile with external TCP and outside-write denial; before/after weights match. All 1,279 tracked and 855 compiled build bindings remain unchanged. All three owners and their child/output streams closed; subsequent probes found all eight recorded process IDs absent and the owned listener refused connections.
The validator's 29 synthetic controls and five controller lifecycle controls passed; coordinated session/thread mismatches were first reproduced as failures and then refused after the validator repair. Each actual native phase executed one passing test with zero failures, skips or cancellations. Independent preexecution and actual-receipt audits found no Critical or Important findings within this scope. The inherited archival limitation remains: the copied
controller.jsonprecedes finalization, while the canonical external receipt and original root contain terminal state. Normal owned disposal removes raw CLI sessions; typed observations and literal fixture/process receipts are retained.Canonical evidence is
/Users/buns/Documents/Codex/2026-11-11/modex-closeout/lm6-restart-model-restart-first.json, withlm6-restart-native-terminal-audit.json,lm6-restart-native-terminal-independent-review.jsonand reviewed helper sources alongside it. Acceptance covers native execution restart, stale authority refusal and an explicit fresh action in this instrumented fixture. Electron relaunch, application transcript persistence, renderer controls, human acceptance, inference-server restart, server/native loss, OOM, overflow, compaction, other combinations, protected delivery and product admission remain separate requirements. No issue checkbox was changed.