Skip to content

feat(agent): add local coding agent control plane - #399

Open
PhilipJohnBasile wants to merge 8 commits into
youssofal:mainfrom
PhilipJohnBasile:codex/mtplx-local-agent-system
Open

feat(agent): add local coding agent control plane#399
PhilipJohnBasile wants to merge 8 commits into
youssofal:mainfrom
PhilipJohnBasile:codex/mtplx-local-agent-system

Conversation

@PhilipJohnBasile

@PhilipJohnBasile PhilipJohnBasile commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Adds a durable local coding-agent control plane backed by MTPLX's existing model and runtime.
  • Persists workspaces, parent and child runs, event streams, goals, profiles, approvals, skills, delegations, and restart recovery state.
  • Adds workspace-contained read, search, file, diff, write, command, test, and web tools. Writes and command execution require exact approval by default.
  • Gives delegated work isolated Git worktrees, durable evidence, bounded roles, retry support, and no implicit merge path.
  • Wires the control plane into native chat with a workspace panel, run state, tool output, approval handling, and command autocomplete.
  • Exposes the same system through HTTP and the mtplx agent CLI while keeping MTPLX as the model and runtime source of truth.

Graphs and Loops v1

  • Stores immutable, content-hashed Graph revisions and pins every Graph run to one revision.
  • Validates sequential DAGs built from input, output, model, tool, conditional, human approval, memory, and Loop nodes.
  • Makes Loop the only legal cycle, requires a finite bound, and checkpoints every iteration.
  • Persists node state, events, errors, logs, approvals, Loop counters, model selection, runtime profile, and recovery metadata.
  • Supports pause, resume, cancel, exact one-use approval, failed-node retry, restart recovery, and idempotent replay of recorded side effects.
  • Adds full API and CLI lifecycle control plus a native desktop inspector for definitions, runs, checkpoints, Loop progress, history, and approvals.

This closes the v1 Graph and Loop execution system. A visual authoring canvas, arbitrary parallel branches and joins, advanced scheduling, and model-fanout dreaming remain deliberate follow-ups.

Native chat commands

The command layer covers the high-value desktop controls:

  • Chat: /help, /new, /clear, /fork, /side, /compact, /feedback
  • Model and context: /model, /plan, /reasoning, /goal, /memory, /status, /usage
  • Workspace: /workspace, /files, /diff, /run, /test
  • Agent control: /resume, /stop, /retry, /review, /skills, /mcp

Memory and dreaming

  • Stores portable Markdown memory with JSON frontmatter, scoped ownership, author and session attribution, content hashes, versions, atomic writes, and an audit log.
  • Captures transcripts separately from shared and agent-owned memory.
  • Runs periodic out-of-band curation over stable transcript snapshots.
  • Produces reviewable reports and proposals. Applying a proposal is explicit and fails when its source snapshot has changed.

The current dreaming pass is deterministic and single-worker. It does not yet launch one model worker per transcript.

Validation

  • swift build --product MTPLXApp
  • Swift core: 696 tests passed, 1 skipped
  • Swift host: 8 tests passed
  • Focused agent, Graph, Loop, memory, skill, and workspace Python suite: 72 tests passed
  • Memory-plan CI reproduction with a forced 7 GB Metal cap: 3 tests passed
  • The three stale-venv failures all pass on the required MLX 0.32.2 runtime
  • Full Python suite on MLX 0.32.2 passes outside tests/test_sdpa_nax_tile.py; that untouched file has 8 host MPP compiler failures in the current environment
  • Ruff passed for every touched Python file
  • Python byte compilation passed for every touched Python file
  • git diff upstream/main...HEAD --check

This PR also fixes the inherited no-MLX test-harness failure on current main: simulated 48 GB and 128 GB machines now stub the Metal cap instead of inheriting the CI runner's physical 7 GB cap. Production memory planning is unchanged.

The feature source also completed a live smoke against local model qwen-qwen3.8-27b-mtplx: Graph revision 2 at 03daae5ba1091b58c65c696c952914e8f42c9d19f8d4b112e8fb0e52c06ce447, planning plus two Loop iterations, an approved exact write and sandboxed test with exit 0 and network disabled, restart recovery with approval and counters preserved, and a read-only reviewer delegation with four successful tools.

@youssofal
youssofal force-pushed the main branch 2 times, most recently from 2382dfd to 8bc4d88 Compare September 1, 2026 08:07
@PhilipJohnBasile
PhilipJohnBasile force-pushed the codex/mtplx-local-agent-system branch from 6162627 to 2b30cbf Compare September 1, 2026 13:05

Copy link
Copy Markdown
Contributor Author

@youssofal — now that #399 is rebased/merged cleanly onto current main, I’m happy to adjust the scope if that would make it more useful or easier to merge. Are there any changes, additions, or removals you’d like me to make to this PR? I can trim pieces that feel too broad, split follow-up work out, or add anything you think is missing.

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