[codex] Extract root upstream runtime#1028
Merged
Merged
Conversation
Merge the useful stash wording into the current MCP PTC-Lisp reference while keeping rendered prompt descriptions under their byte budget. Verified with: - mix test test/ptc_runner/lisp/format_test.exs - cd mcp_server && mix test test/ptc_runner_mcp/prompt_registry_test.exs test/ptc_runner_mcp/prompt_files_test.exs
Extract upstream tool runtime into the root ptc_runner app and wire ptc_runner_mcp through it. Adds root REPL upstream support, shared transport/config/result handling, redaction bridging, catalog/discovery snapshot modes, and updated docs/tests. Verified with mix precommit and cd mcp_server && mix precommit.
Point real-provider MCP benchmarks at the root upstream runtime and emit explicit mcp_stdio upstream configs after the extraction. Verified with mcp_server mix format --check-formatted, mix compile --warnings-as-errors, and real OpenRouter benchmark runs.
Owner
Author
Real-LLM MCP benchmark runRan the real-provider MCP benchmarks on this branch with Commands: cd mcp_server
mix run --no-start bench/agentic_real_eval.exs \
--runs=1 \
--models=gemini-flash-lite \
--catalog-modes=inline,lazy \
--json-out=../tmp/agentic_real_eval_root_upstream.json \
--md-out=../tmp/agentic_real_eval_root_upstream.md \
--fail-on-skip
mix run --no-start bench/lisp_eval_real_client_eval.exs \
--runs=1 \
--models=gemini-flash-lite \
--profiles=no-upstreams,with-upstreams \
--catalog-modes=inline,lazy \
--json-out=../tmp/lisp_eval_real_client_eval_root_upstream.json \
--md-out=../tmp/lisp_eval_real_client_eval_root_upstream.md \
--fail-on-skip
mix run --no-start bench/lisp_session_real_client_eval.exs \
--runs=1 \
--models=gemini-flash-lite \
--profiles=no-upstreams,with-upstreams \
--catalog-modes=inline,lazy \
--json-out=../tmp/lisp_session_real_client_eval_root_upstream.json \
--md-out=../tmp/lisp_session_real_client_eval_root_upstream.md \
--fail-on-skipResults:
Notes:
|
Owner
Author
|
Root E2E verification passed on this branch: mix test --only e2eResult: 52 tests, 0 failures, 5841 excluded. Runtime: 109.3s. This used the real provider config loaded from the local environment/.env; ReqLLM printed the expected unverified-model warning for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements
docs/plans/root-upstream-runtime.mdby moving upstream tool execution out ofptc_runner_mcpand into the rootptc_runnerlibrary.Key changes:
PtcRunner.Upstream.*runtime modules for config parsing, credentials, transport-neutral results, catalog rendering, discovery, run contexts, collectors, OpenAPI, MCP stdio, and MCP HTTP transports.mix ptc.replwith--upstreams-config/PTC_RUNNER_UPSTREAMS, upstream call limits, catalog limits,--catalog-mode, and--catalog-snapshot-mode.ptc_runner_mcpthroughPtcRunnerMcp.RootUpstreamRuntimeand deletes the duplicated MCP-owned upstream registry/connection/transport stack.docs/upstream-runtime.mdand refreshes aggregator/MCP docs for frozen vs live catalog behavior.Why
Upstream tools are useful outside the MCP server. The old implementation kept the runtime, config, transports, catalog, and discovery machinery inside
mcp_server, which meant local REPL and embedded root callers could not use upstreams without going through an MCP server process.This extraction makes upstreams a root library feature while keeping MCP server behavior as an integration layer.
Review Notes
Expected large deletion count: this intentionally removes the old
PtcRunnerMcp.Upstream.*,AggregatorTools,CatalogBuiltins,UpstreamCalls, and related MCP-local test suites after replacing them with root runtime tests and MCP boundary tests.Important behavior points to review:
openapi,mcp_stdio,mcp_http; oldstdio/httpnames are rejected.catalog_snapshot_mode: :frozen; rootmix ptc.repldefaults to:liveand can opt into:frozen.Validation
Local checks passed:
mix precommitcd mcp_server && mix precommitmcp_serverformat, compile with warnings as errors, Credo, scoped testsmcp_serverfull suite: 510 tests, 0 failures; Dialyzer passedptc_viewerfull suite: 9 tests, 0 failures