Skip to content

Merge optimize → develop#46

Merged
brianlball merged 5 commits intodevelopfrom
optimize
Apr 10, 2026
Merged

Merge optimize → develop#46
brianlball merged 5 commits intodevelopfrom
optimize

Conversation

@brianlball
Copy link
Copy Markdown
Collaborator

Summary

Merges the optimize branch (159 commits) into develop. Key work streams:

  • Tool routing & discovery: search_api, recommend_tools, tags on all 142 tools, description enrichment
  • LLM test suite: 170+ tests, progressive L1/L2/L3, benchmark tracking, cross-model sweeps
  • Geometry tools: create_bar_building, create_new_building, import_floorspacejs
  • Generic object access: get_object_fields, set_object_property, dynamic list_model_objects
  • Measure authoring: full skill with ReportingMeasure support, search_wiring_patterns
  • Response-size guardrails: max_results + filters on all list tools, brief mode
  • Agent guardrails: anti-loop instructions, tool-bypass prevention
  • HVAC: FourPipeBeam, CooledBeam terminals, set_zone_equipment_priority
  • Stdout suppression fix (issue MCP error -32001: Request timed out on all tools — stdout suppression race condition #42): permanent fd redirect replaces racy global middleware
  • CI: 5-shard test matrix, ~450+ integration tests

Stdout fix (Fixes #42)

Commit 2395d95 replaces the global FastMCP middleware (which held os.dup2() on fd 1 for entire tool calls, causing concurrent response loss) with a one-time fd redirect at startup. C-level stdout (SWIG, Polyhedron, etc.) goes to stderr permanently; Python sys.stdout writes JSON-RPC to a private fd. No races, no missed callsites.

Test plan

  • CI shards 1-5 pass
  • test_concurrent_tools.py passes (concurrent slow+fast and fast+fast)
  • test_complex_model_stdout_purity passes (Polyhedron leak on 44-zone model)
  • No SWIG or Polyhedron messages in stdout

🤖 Generated with Claude Code

brianlball and others added 5 commits April 5, 2026 10:28
…tries default 0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
OSMCP_CODE_MODE env var gates fastmcp CodeMode transform; off by
default. Runner/conftest detect code_mode_active, track tools called
inside execute blocks, and report CodeMode ON/OFF in benchmark md.
Bump fastmcp>=3.1.0 for experimental transform. Includes A/B sweep
data (off=95.3%, on=24.0%) and root-cause writeup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move llm-test-benchmark, testing, frameworks-summary, benchmark-
description-guidance under docs/testing/. Add README.md as technical
report with 7 embedded plots (run history, tier pass rates,
progressive L1/L2/L3, token profile, failure modes, cross-model
sweep, codemode A/B) + paragraph explanations and legends. Include
generate_plots.py + march/april sweep data it sources.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New research notes under docs/knowledge/: architecture/testing
patterns, MCP best-practices gap analysis, reddit discovery thread,
APS agent paper, tool-discovery/LLM-testing writeup. Move geometry
research into knowledge/. Drop stale development-process-findings
and tool-discovery-research.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Redirect C-level stdout (fd 1) to stderr once at startup, give
Python sys.stdout a private fd to the real MCP client pipe.
Catches ALL C-level pollution (SWIG GC, Polyhedron geometry,
future unknowns) with zero races and no per-callsite wrappers.

Fixes concurrent tool timeout (issue #42) and Polyhedron stdout
leak on complex models (test_complex_model_stdout_purity).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brianlball brianlball merged commit a517102 into develop Apr 10, 2026
12 checks passed
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.

MCP error -32001: Request timed out on all tools — stdout suppression race condition

1 participant