Skip to content

codex-local 14: H9 local wire codec; retire H8 - #19

Closed
ehrvs wants to merge 4 commits into
pr/13-enginefrom
pr/14-codec
Closed

ehrvs wants to merge 4 commits into
pr/13-enginefrom
pr/14-codec

Conversation

@ehrvs

@ehrvs ehrvs commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Problem: LM Studio silently drops namespace tools (MCP servers, multi-agent) and top-level custom tools (freeform apply_patch). It answers 200 with an empty tool list. Ollama returns namespaced calls as dotted ns.tool names. H8 patched upstream router.rs to cope with the latter.

Fix: H9, a local wire codec that is registered only by codex-local.

  • Outbound (1 hook in client.rs): namespace and custom tools become plain function tools, and the whole input history is translated the same way, so resumed sessions work.
  • Inbound (1 hook each in stream_events_utils.rs and session/turn.rs): items are canonicalised before they are recorded or dispatched, so rollouts and history only ever hold real names.
  • Aliases are a pure function of (namespace, name). Plain aliases and hashed aliases (…_h<8hex>) live in disjoint name spaces, so mapping is injective; the proof is in codec.rs. Literal top-level names are never reverse-mapped.
  • Mode by engine: Flatten for LM Studio and llama.cpp; DottedInbound for Ollama, which replaces H8.
  • H8 retired: router.rs and router_tests.rs are back to pure upstream. Stock codex is unchanged: with nothing registered, the hooks are no-ops.

Fork surface: 131 lines over 12 files, within the 135/12 budget. FORK_SURFACE.md is updated.

Verified live:

  • Ollama: a shell tool call dispatches.
  • LM Studio MLX (qwen3.8-27b-mlx) via --engine lmstudio: an MCP namespace tool (smoke/ping) dispatches and returns pong, and the record keeps server:smoke, tool:ping. Without the codec, LM Studio drops that tool.

Known limitations (documented):

  • Flattened custom calls get no live diff preview.
  • Telemetry sees alias names.
  • One engine per process.

Review: three Codex gpt-6.1-sol rounds. Final verdict: APPROVE.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR

ehrvs and others added 4 commits October 16, 2026 15:53
Flatten (LM Studio) / DottedInbound (Ollama) codec in codex-local-models,
OnceLock hooks in model-provider, client.rs and stream_events_utils.rs.
router.rs/router_tests.rs reverted to rust-v0.162.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
…lise OutputItemAdded

Alias is a pure function of (ns,name) shared by tool defs and history; literal
top-level names are never reverse-mapped. Document known limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
Ollama -> DottedInbound; LM Studio and llama.cpp -> Flatten (llama.cpp
namespace handling is unverified; flatten is always safe). Action::Run
carries the engine so the single registration point in main covers
exec, tui and resume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPCzgwU247gMtjybR5v4iR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ehrvs

ehrvs commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: merged into codex-local/main via the integration PR #21 (3908b3d).

@ehrvs ehrvs closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant