Skip to content

[Tracker][LM] Integrate local models through native harnesses with verified compatibility #376

Open

Description

@BunsDev

Outcome

Let a person select a model served on their own machine in Modex and use the existing native coding harness, with accurate compatibility, permissions, inference destination and recovery behavior. This tracker coordinates seven core implementation slices and one optional experiment. It does not authorize code execution, merging, publication, model downloads or changing feature defaults.

Initiative: Local models v1. Priority: P1. State: LM-1 contract/native feasibility and LM-2 secure metadata discovery accepted; remaining core integration and qualification gates are open. Start here: #377. Ownership: one accountable implementer per child; one integrator for shared runner/backend/type changes. Issues are initially unassigned; claim ownership explicitly before implementation and do not run overlapping workers against shared files.

Repository ownership and refreshed baseline

The approved implementation packet was audited at 0e674e75237f393b8a1ba712061f5b303a61d5b4. Publication-time main was refreshed to ec7be578765f9ce54976882853e57ca190252361 on 2026-10-22. These are evidence snapshots, not instructions to revert newer work. Read current source and open PRs before implementation.

The implementation owner is TypeSafeAI/modex: desktop main/renderer, native CLI integration, shared contracts, Store desktop, iPhone companion, tests, documentation and site are surfaces in this monorepo. Related TypeSafe repositories are not required production dependencies of the approved feature. Do not manufacture cross-repository issues merely to distribute this backlog. When a real upstream/shared-repository defect is reproduced, link its exact owner, version, minimal reproducer and blocking behavior here before adding a scoped external issue.

Reuse #273 and its delivered identity, human-request, evidence, replay and Notes contracts; coordinate with #276, #279 and #281 rather than copying their systems. The iPhone question-broker integration in #373 is already on the refreshed main. Native-plan configuration changes must not override a local target unnoticed.

Source references: AGENTS.md, workspace scripts, desktop dependencies, native Codex backend, runner.

Architecture and non-goals

Keep codex app-server as the primary executor. Add main-owned connection/model discovery and scoped configuration to the existing native backend. Keep claude -p as an optional separately qualified experimental route. Preserve native approvals, sandbox modes, transcript/event identity and recovery. No direct coding-inference SDK, new agent loop, tool executor or protocol proxy.

Separate harness, connection, exact opaque model identifier, credential reference and run provenance. Each run snapshots its connection revision/model/effective settings; process and resume identity also bind credential/account generation and process configuration. Secrets never enter public identities.

“All local models” means no model-family allowlist: accept compatible runtime-served identifiers. It does not mean embedding/decision/diffusion models or text models without required tool behavior become coding agents. Discovery, advertised capability, tested compatibility and task quality are different facts.

Initial coverage: first-class Ollama and LM Studio profiles; lightweight llama.cpp/vLLM presets over the shared Responses route; a custom compatible local endpoint/manual model ID; optional experimental Claude Code integration. Verify the installed native CLI schema and exact runtime/model combination rather than assuming an OpenAI-compatible label proves support. Raw model files and inference lifecycle remain the user's runtime's responsibility.

Excluded: automatic runtime/weight installation, raw-weight scanning/import, model marketplace, general scheduler, new graph/vector store, inference-engine embedding, protocol translation, LAN/remote inference configuration, fine-tuning, universal GPU tuning and complete mobile Settings parity.

Privacy invariants

  • Local endpoint, local inference and offline-verified are distinct. Loopback does not prove a server is not forwarding traffic.
  • No cloud inference fallback applies to the turn and auxiliary work. Default local v1 uses a pinned model, deterministic titles, no automatic model-generated follow-ups, no network Jev judging and no unqualified remote tools.
  • Preserve existing cloud behavior. Keep app identity/update traffic and explicitly enabled tools distinct from the inference-locality claim.
  • Offline qualification requires a pre-provisioned network-denied run covering the inference service as well as Modex. Unknown locality stays unverified. Model output and compatibility results never grant tool authority.

Published issue graph

All issues have enhancement and area:local-models. #378/#380 additionally have security; #384 additionally has experimental. Priority is carried in each title/body rather than duplicated as another label taxonomy.

Slice Issue / deliverable Priority Completion prerequisites
LM-1 #377 — contract and native app-server feasibility P1 None
LM-2 #378 — secure connections and bounded discovery P1 #377
LM-3 #379 — isolated native Codex profiles P1 #377, #378
LM-4 #381 — capability-aware Modex interface P1 #378, #379, #380
LM-5 #380 — privacy, bounded capacity/context and recovery P1 #377, #379
LM-6 #382 — broader Responses-runtime qualification P2 #378, #379, #380
LM-7 #383 — integrated evidence and compatibility matrix P1 #377, #378, #379, #381, #380, #382
LM-8 #384 — optional experimental Claude local route P3 #378, #380; outside core gate

Core completion checklist

Optional, not part of core closure: #384. Its failure or deferral cannot block #383 or the Codex local release.

Dependencies mean accepted artifacts/behavior, not merely issue closure. #381 fixture preparation and #383 test design may begin after #377. Producers own their tests and never depend on the final acceptance issue. Parent tracking is not a child prerequisite.

Execution order: #377 → #378 → #379 → #380 → (#381 and #382 in disjoint ownership lanes) → #383. #384 is an optional separate lane after #378/#380. Shared runner/types/backend files require one integrator even when issue-level prerequisites permit parallel preparation.

Delivery gates

A — feasibility: #377's real app-server/tool/Stop probe and accepted contract.

B — controlled local pilot: #378/#379/#380/#381 plus applicable #383 evidence for Ollama/LM Studio.

C — broad runtime readiness: #382 and full #383 evidence.

“Local models v1” is the delivery grouping for the seven core children. No native GitHub milestone object has been created or attached. Parent/dependency relationships are explicit issue-body links and task checklists; native GitHub blocking/sub-issue metadata is not configured. No automatic execution or merge authorization is implied. No arbitrary due dates or agent assignments were added.

Shared execution contract

  1. Read current AGENTS.md, scoped instructions, status, issue discussions, current main and prerequisite PRs. Reconcile landed work; preserve other sessions' changes.
  2. Use an owned worktree via scripts/worktree.sh new <slug> and check; resume only after ownership validation. Never edit primary checkout or force-delete another session's work.
  3. Work one reviewable acceptance slice at a time: failing regression → confirm failure → smallest implementation → targeted and applicable full checks. Split substantial backend work into reviewable PRs without inventing administrative issues.
  4. Use pinned pnpm. Run pnpm build && pnpm test; UI changes also pnpm test:e2e. Inspect current scripts for focused/typecheck commands. Keep mock, Electron, native/hardware, network-denied and human evidence separate; unrun tests are not passes.
  5. Use signed commits, update docs/status.md, and record evidence under the existing docs/reviews/ convention. Do not merge/tag/release/publish, install/download models, rewrite global CLI configuration or enable flags without separate authority.
  6. Checkpoint issue/PR, owner/worktree, branch, full base/head SHA, accepted decisions, changed interfaces, exact commands/results, failures/skips, CLI/runtime/model versions, remaining gates and one next executable step. Exclude secrets/private payloads. Checkpoints do not imply background execution.
  7. Missing native capability, unresolved privacy, unknown ownership or an ambiguous prior side effect are stop conditions. Diagnose repeated failures instead of blind retries. Approval, model claims and observed execution are distinct facts.

Definition of done

  • Every core child links its implementation PR and criterion-level evidence.
  • A real local edit/test task preserves native authority, actual diff/check evidence and Stop/recovery semantics.
  • Connection/model identity remains safe through persistence, endpoint changes and supported paired clients.
  • No implicit cloud inference or auxiliary disclosure occurs in the qualified local policy.
  • Runtime/model/tool-parser/context/native-CLI versions and unsupported capabilities are recorded reproducibly.
  • Existing cloud/native regressions pass; native/hardware/human gaps remain explicit.
  • Documentation and site claims match the tested scope. Rollback preserves profiles/history and executes nothing.

Long-running coordinator prompt

Deliver Local models v1 for TypeSafeAI/modex using #376 and its children. Read current AGENTS.md, docs/status.md, the live issue/PR graph and native backend source. Confirm repo, main SHA, owned worktree and already-landed work. Start with #377's native app-server feasibility gate, then select the earliest unblocked review-sized slice. Follow the shared execution contract and each child's acceptance criteria.
Preserve codex app-server and claude -p as coding executors. Add connection/model identity, bounded discovery, scoped configuration and truthful capability UI, not another agent loop, inference SDK or protocol proxy. Never equate model discovery with coding qualification or localhost with offline operation. Enforce no-cloud-fallback across auxiliary work and preserve native approval authority and profile/session isolation.
Use failing-first tests and signed reviewable commits. Separate mock, real Electron, native runtime, network-denied and human acceptance evidence. Checkpoint exact SHAs, commands, evidence, remaining gates and one next action. Keep #384 experimental and outside the critical path. Finish with review-ready PRs and a supported-scope readiness report; no merge, release or universal-model claim.

Follow-up coordinator prompt

Resume #376 from current repository and issue evidence, not an earlier success summary. Verify worktree ownership, current main and actual diff. Reconcile prerequisite artifacts, native versions, connection revisions and the checkpoint; rerun the smallest smoke test before trusting prior state. Classify children as verified, implemented-unverified, partial, blocked or not started.
Select the earliest unmet core dependency or highest-impact failing boundary. Repair the smallest slice with a failing regression first, preserving native execution, local policy and cloud workflows. Never replay an uncertain side effect or switch providers to hide failure. Invalidate stale qualification when model/runtime/configuration changes. Record fresh results and leave native/human gates open where unrun. Stop with a precise handoff on an external blocker. No merge, release or background-work claims.

Independent review prompt

Audit actual source and fresh evidence against #376 and its core children, independently of implementer summaries. Inspect native args/environment/configuration precedence, credentials, process/session identity, main admission and every auxiliary inference destination. Test duplicate model names across endpoints, profile changes during runs, forged IPC, stale qualification, chat-only servers, malformed tools, Stop after execution begins, reconnect after unknown results, small context and OOM. Confirm cloud regressions and no global configuration rewrites. Offline evidence must include the inference service. Classify every criterion as verified, failed, explicitly deferred or unverified, with a reproducer and smallest repair. Do not merge, publish or certify untested combinations.

Primary implementation references

Revalidate version-specific fields during #377/#382: Codex configuration, Ollama Codex, LM Studio Codex, llama.cpp server, vLLM Codex, Claude gateway support boundary. These are compatibility references, not completed Modex acceptance evidence.

Activity

  1. BunsDev commented on Oct 23, 2026

    @BunsDev
    ContributorAuthor

    Refreshed goal prompts — 2026-10-23 (main at 203a350)

    On main already:

    • no local-model code, docs or status entry. The issue and receipt work so far lives only on branches;
    • Codex Plan mode now runs in Codex's native plan collaboration mode (Run Plan mode on Codex in Codex's native plan collaboration mode (CF-3) #385). That is the "native-plan configuration" this tracker warns about: the collaboration-mode model overrides the turn model, so LM-3 must pin both to the local target.

    Still open (core children, none accepted):

    Leftover local worktrees: lm1-contract, lm2-discovery, lm3-isolation, lm-foundation (dirty with untracked docs) and lm6-runtimes. The codex-native-plan worktree is also still checked out after #385 merged.

    Long-running goal prompt

    Coordinate Local models v1 (#376) in TypeSafeAI/modex. Do not implement children yourself; keep the graph moving and honest. Read AGENTS.md, #376's architecture, privacy invariants and shared execution contract, every child (#377–#384), PR #386, docs/status.md and the LM branches' receipts (lm1-contract, lm2-discovery, lm3-isolation, lm-foundation). Then verify main's SHA. Never edit the primary checkout, and never claim, release or remove another session's worktree. Step 1: get Gate A decided. Ask whoever owns lm1-contract to rebase 048d1e8 onto main, reconcile it with #385's native Plan mode, push it and open a PR. Ask Val to accept or reject LM-1 on #377. Step 2: settle one shared identity between LM-1 and LM-2 (schema: 1, who owns ConnectionRef, the runtime-kind mapping). Make sure #386's two review defects get failing-first fixes before anything consumes its store. Step 3: propose on #376 one integrator for runner, backend and shared-type changes across LM-3 and LM-5, and get Val's answer before either starts. Step 4: propose the AGENTS.md wording for loopback metadata discovery and get Val's sign-off. Real models run only through the codex and claude CLIs, with no API mode. Step 5: once Gate A is accepted, keep #381 fixture work and #383 test design moving in lanes that don't touch shared files. Keep #384 off the critical path. For each child, record its state as verified, implemented-unverified, partial, blocked or not started, with SHAs and the exact evidence. Keep mock, Electron, native, network-denied and human evidence apart. Native probes and model reads need Val's authorization, with no downloads and no global CLI config changes. Keep docs/status.md accurate. Every change lands through signed PRs, and nothing merges without Val's go-ahead.
    

    Follow-up / resume prompt

    Resume #376. Fetch main and read the latest comments on #376–#384 and every open LM PR. Check the LM worktrees (scripts/worktree.sh audit) without touching ones you don't own. Update each child's state from fresh evidence rather than earlier summaries, and treat any earlier qualification as void if the codex-cli, runtime or model changed. Find the earliest unmet core dependency (Gate A first) and the one decision Val owes. Post a checkpoint: main SHA, each child's state with PR or branch SHA, open decisions for Val, and one next action.
    
  2. BunsDev commented on Oct 24, 2026

    @BunsDev
    ContributorAuthor

    LM-3 (#379) prerequisite refresh: remote main, local main and origin/main are 70123b966aaad0377311a105ae3fa739c0d63179; installed CLI is codex-cli 0.164.0. No LM-3 implementation or native turn has started.

    LM-1 is now #397 at c30633d797a11e80046bc7f2b856f1053c094e5f, with its refreshed 0.164.0 native receipt. LM-2's review fixes are #398 at 954cd5b7d0627333835db41f9b0dfb477b72176f; #386 remains draft. Neither producer has a recorded acceptance decision. #398 still explicitly defers LM-1 identity reconciliation: source retains a separate ConnectionRef, and its model references lack schema: 1. These are proposed artifacts, not yet the accepted prerequisites that #379 requires.

    Val: please record the Gate A decision and exact accepted LM-1 SHA on #377, then have the LM-2 producer reconcile the shared contract and obtain acceptance at an exact SHA. Please also decide who integrates the shared runner/backend/type files before LM-3 starts. I propose this LM-3 session (01a16c76-d579-75d0-a0f9-db5066ff84f5) as that integrator, with LM-5 coordinating shared edits through it, using a fresh owned worktree after the prerequisite handoff. lm3-isolation and lm-foundation remain claimed by other sessions; I have not claimed or changed them.

    All LM-3 AC1–AC6 remain unverified. This refresh inspected the producer and prerequisite receipts; it did not rerun tests or native probes. After the accepted SHAs and ownership decision are recorded, the next implementation step is failing configuration, process-isolation and immutable-resume-binding tests against the accepted interfaces, including both ordinary and native Plan model pinning. No merge or release is requested.

  3. self-assigned this
    on Oct 24, 2026
  4. BunsDev commented on Nov 11, 2026

    @BunsDev
    ContributorAuthor

    Local Models closeout checkpoint — 2026-11-11. Refreshed main is 85143ee4cf9cf3760c5552e2226950a7cbbeb7f1. This updates the October 24 checkpoint; it does not close any child or authorize execution, activation, or release.

    Main now contains the connection/discovery service, native execution modules and local-run policy. The main-process wiring constructs LocalModelsService but deliberately does not construct LocalExecution; ordinary product turns remain unadmitted. #377 is closed as completed. Claims that the foundations have not started are historical.

    PR #498 is open and draft at signed head 7d2d6c89de5a262d08876777a907568acd4a4405, tree 2bd27e068003bc7306645f56dab368ab66399594. It integrates the connection/model interface, workflow fixtures, privacy/recovery repairs and updated evidence. Its exact-head reported checks are terminal success, including macOS build/unit/Electron/site qualification. Green checks do not establish protected delivery, product admission, installed acceptance or human acceptance. The candidate evidence map keeps evidence levels separate.

    Child Current boundary Remaining gate
    #378 LM-2 Foundations on main; UI and strengthened token/export coverage in #498 Protected delivery and full criterion reconciliation; metadata is not inference compatibility
    #379 LM-3 Native execution modules on main; actual candidate native fixtures retained Protected delivery, full native policy/configuration acceptance and admission
    #380 LM-5 Refusal policy on main; integrated fixture and native recovery evidence in #498 Full privacy/resource/failure matrix and admission; #475 remains open and owner-controlled
    #381 LM-4 Interface and Electron workflow fixtures in #498 Delivery, admission and remaining human/paired-client acceptance; it is no longer only a design brief on the candidate
    #382 LM-6 One narrow bundled llama-server/native Codex fixture qualified on the current candidate Remaining protocol/runtime/staleness matrix; no blanket llama.cpp, vLLM or generic-server support
    #383 LM-7 Versioned candidate evidence map and integrated checks in #498 All producer requirements, full native/paired/human matrix and delivery
    #384 LM-8 Optional experiment outside core completion Existing scope decision and separate qualification; it does not block the core gate

    The new #382 native receipt records an owned bundled llama-server, the already authorized coding-model weights, Codex 0.167.0 and a configured Metal profile with one slot and observed 65,536 context. The actual existing native path completed read, explicitly approved edit and test with literal file/check evidence. The retained CPU-only attempt failed at the native SSE idle timeout. This narrow instrumented result does not prove compaction, Stop, crash/OOM recovery, installed UI, other runtimes/platforms or product admission; configured GPU layers are not a measured offload count.

    Earlier native/offline and lifecycle receipts retain their own source and runtime identities; they are not silently promoted to current-head or all-combinations acceptance. Local-only claims must cover both the native child and inference server, and every unrun combination remains unverified. No model download, server configuration rewrite, global CLI configuration change, feature activation or release was performed by this checkpoint.

    Next: finish #498's draft-to-ready delivery gate, revalidate its exact head/review/signatures/required checks and use the protected merge queue when eligible. Then reconcile child criteria against the actual merged source and their full text. The pending ready-transition transport decision is not approval; no bypass or GraphQL exception is inferred. #475 and all other owners' branches/worktrees remain preserved. Local Models product decisions, missing native/hardware and human/device observations remain explicit gates rather than checkbox completions.

  5. BunsDev commented on Nov 12, 2026

    @BunsDev
    ContributorAuthor

    Accepted LM-2 prerequisite

    #378 is completed at all 13 literal requirements, as documented in its full clause/native credential receipt. Acceptance binds the metadata/credential source audit to signed main 5a580d4f98f5b1c62c5801db4400d5b533634082 and composes the real packaged macOS shared-secret-store proof with connection-specific routing/redaction/export evidence. The first Settings-click timeout is retained and unexplained; it is not relabelled as a Keychain failure or product repair.

    Only the core #378 dependency box advances, taking this tracker from one to two of 14. #379, #380, #381, #382 and #383 and every definition-of-done box remain open. #381 is separately at five of 13 after UI/race and conservative option/pinning acceptance. Native destination-policy, qualification, ordinary admission, paired-client, runtime/model and human/device gates retain their exact remaining requirements. No feature activation, inference compatibility, offline privacy, release or universal platform acceptance follows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:local-modelsenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions