Skip to content

Release 0.5.0: sync main, port TS 1.1.3 changes, E2E fixes and performance - #138

Merged
manish-wekan merged 46 commits into
developfrom
feat/ts-sync-1.1.3
Nov 26, 2026
Merged

manish-wekan merged 46 commits into
developfrom
feat/ts-sync-1.1.3

Conversation

@manish-wekan

@manish-wekan manish-wekan commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Release 0.5.0. This PR merges main into develop, ports the latest TypeScript SDK changes, fixes the bugs that a full end-to-end run found, and adds measured performance work.

 develop
+  merge main (0.4.2 release, pack --include-env, validate skips vendored SDK,
+              upgrade fix, release.sh, process env beats .env)
+  restore publish.yml / bump-version.yml / bump_version.py (deleted by revert c625ff8)
 TS SDK ports
+  NITROSTACK_APP_MODE defaults to openai, APP_MODE alias      (TS 1.1.3)
+  ExecutionContext.input = validated tool arguments           (TS #373)
+  JSON body limit, default 1mb, 413 when over                 (TS #366)
+  hardened starter calculator (finite operands, safe fields)  (TS #368)
 E2E fixes
+  dev hot reload actually restarts and serves new code
+  dev --port wins over PORT in .env
+  starter/pizzaz/flight-booking packed wheels ship main.py + app_module.py
+  generated/packed projects require nitrostack>=<running SDK>
+  tools/list order is declaration order, not PYTHONHASHSEED-dependent
 perf
+  lazy `import nitrostack` (PEP 562) + light `nitrostack-py` entry point
+  tool inputSchema built once at bootstrap instead of per tools/list

Notes on the ports:

  • JSON body limit: the default is 1mb, not TypeScript's 100kb. Python had no limit before, so 100kb would break tools that take base64 payloads. Override it with ServerConfig.json_body_limit, NITROSTACK_JSON_BODY_LIMIT or MCP_JSON_BODY_LIMIT.
  • App mode: init still writes NITROSTACK_APP_MODE=universal into generated .env files, and the Inspector hint keeps it, so widgets still render in the Inspector Apps tab.
  • Aliases: mcp and mcpapps still select mcp-app.

Evidence

  • Tests:

    • Before: 1370 tests pass on develop (199e40a).
    • After: 1500 tests pass (CI green on 3.10–3.12), and scripts/check_file_lengths.py reports SUCCESS.
  • End-to-end run (a temp project per module, real stdio and Streamable HTTP clients in the legacy, auto and 2026 protocol versions, every CLI command, and the SDK wheel built and installed in a clean venv):

    • Before: the pack wheel was missing main.py, dev didn't hot reload, dev --port was ignored, and packed enterprise-search and code-mode projects crashed against nitrostack 0.4.2 from PyPI.
    • After: each of these has a regression test: tests/test_project_templates.py::test_packed_wheel_includes_main_and_app_module, tests/test_dev_hot_reload.py, tests/test_vendor.py and tests/test_list_registration_order.py.
  • Performance (median of 5 runs on the same machine):

    Metric Before After
    import nitrostack ~502 ms ~59 ms
    nitrostack-py --help ~505 ms ~63 ms
    tools/list throughput, 50 tools 130 rps ~414 rps
  • Wire output: tools/list and tools/call responses are byte-identical before and after for single-tool apps in both the modern and legacy protocol versions. For multi-module apps the tools/list order is now fixed to declaration order. Before, it depended on the Python hash seed.

Merge Danger

Door: two-way. It's a normal merge commit with no data migrations.

Blast Radius: wide. Behaviour changes users may notice:

  • Widget metadata now defaults to openai. Existing projects without NITROSTACK_APP_MODE set lose MCP Apps metadata until they set universal.
  • HTTP JSON bodies over 1mb now get a 413.
  • import nitrostack is lazy. Public names and nitrostack.<subpackage> access keep working, and tests/test_lazy_imports.py covers this.
  • Generated and packed projects pin nitrostack>=0.5.0, so 0.5.0 must be on PyPI before packed wheels are installed from a clean environment.
  • After this merges, develop into main is a clean merge (checked with git merge-tree).

🤖 Generated with Claude Code

KeuqS and others added 30 commits October 13, 2026 13:29
.env values were written over os.environ unconditionally, so the PORT=3000
that `nitrostack init` puts in .env overrode the PORT a host passes when
starting the server. NitroStudio starts a second project on 3001; it bound
3000 anyway and died with "address already in use" (NITSTD-222).

Keys already in the process environment are now kept, as with
python-dotenv and Node's dotenv. .env still fills keys the process
doesn't set, and defaults stay lowest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ver-dotenv

ConfigService: process environment wins over .env
publish.yml only uploads through PyPI trusted publishing, which has never
run here, and the Bump version workflow can't open its release PR (the org
doesn't allow GitHub Actions to create pull requests). The script covers
both: optionally makes release/<next> from origin/main (--bump), checks the
branch matches origin, the lockfile matches and the version is new, runs the
tests, builds, twine-checks, uploads after asking, verifies a clean install
from PyPI, and opens the release PR. `--tag` tags origin/main after the merge.
`--dry-run` stops before anything leaves the machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run from a temp copy: --bump switches branches, which can rewrite the
  script while bash is still reading it.
- --bump plans from origin/main's files in a scratch folder and checks
  everything before switching, so a failed check no longer leaves you on a
  detached origin/main.
- Only a 404 counts as "not on PyPI"; offline or PyPI errors stop the run
  instead of passing the "version is new" check.
- No terminal and no --yes means "no" instead of a silent exit.
- Tag the uploaded commit right after the upload (no separate step that
  could tag later, unreleased merges on main). --tag stays for catching up
  untagged releases and prefers the release branch head.
- A failed PR creation after the upload prints the manual step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README is the PyPI project page. Rewrite it for 0.4.x: building
blocks (tools, resources, prompts, guards, auth, caching, rate limits,
tasks, events, health), env precedence, templates, clients.

tests/test_readme_examples.py compiles every python block, checks every
nitrostack import exists, and runs the Quick Start and Building Blocks
examples through the testing harness so the page can't drift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add scripts/release.sh for releasing to PyPI by hand
docs: refresh README (PyPI page) for the current SDK
`nitrostack-py upgrade` failed on every project `init` creates: the
dependency pattern also matched `nitrostack = { path = "vendor/nitrostack" }`
in [tool.uv.sources] and produced an invalid pyproject.toml. Spec rewrites
are now limited to [project].dependencies, and the pattern skips paths
ending in /nitrostack.

Fixing that alone isn't enough: a vendored project runs vendor/nitrostack
whatever spec it declares, and uv accepts a spec the vendored copy doesn't
satisfy. For vendored projects, upgrade now replaces vendor/nitrostack
with the target release (copied from the running CLI when it is that
release, otherwise the PyPI wheel, checked against its sha256). The new
tree is built beside the old one and swapped in, so a failed download
leaves the project as it was.

init's next steps said NitroStudio can't open Python projects; it can.
The pizzaz open-shops hint is printed only for the pizzaz template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix upgrade on vendored projects; correct init's NitroStudio note
`init` vendors the SDK into vendor/nitrostack. `validate` walked it as
project code, and nitrostack/testing applies @mcp_app to a class defined
inside a function, so every vendored project that imported
nitrostack.testing failed with "uses @mcp_app but no decorated
application class was found after import". Compose's typecheck runs
`validate`, so a NitroStudio build could not get past it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ored-sdk

validate: skip the vendored SDK
Align Python pack with the TypeScript CLI: optional inclusion of .env
files in the wheel, with a warning that lists paths without printing values.
docs: add Product Hunt featured badge to README
…ost-badge

docs: update Product Hunt badge to #1 Product of the Day top-post badge
docs: document widget data and CSP handling
Resolve merge conflicts keeping develop's split CLI modules while
re-applying main's pack --include-env, vendored upgrade, validate
skip, and 0.4.2 release assets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
manish-wekan and others added 16 commits November 25, 2026 16:32
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…487 rps @ 50 tools)

Precompute per-tool inputSchema during bootstrap so tools/list skips repeated
model_json_schema() work while preserving APP_MODE-dependent list metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dicts

Compute has_spillover and input JSON schema on first list build, wire spillover
when tools register after bootstrap, and deep-copy cached schemas per response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ms -> ~20ms import)

PEP 562 lazy exports for `import nitrostack`; CLI console script routes through
`nitrostack.cli.entry` so --help avoids telemetry and heavy command imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Iterate resolved modules in DFS declaration order instead of a set so
multi-module bootstrap order no longer depends on PYTHONHASHSEED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terminate the MCP child as a process group, wait for uvicorn shutdown,
and keep child logs off the parent pipe so reload is not blocked.
Add an integration test that edits a tool description and asserts
tools/list updates within 10s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Emit nitrostack>=<running-sdk> in vendored pyproject/requirements and
wheel metadata so clean venv installs cannot resolve ancient PyPI builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hot reload had started sending the child server's stdout and stderr to
/dev/null, which hid tracebacks and request logs during development.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The revert of #41 on develop also deleted publish.yml, bump-version.yml,
scripts/bump_version.py and its test. Without them, merging develop into
main would remove the PyPI publish workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_stop_child called os.killpg(process.pid) unconditionally. With a fake
process in tests, pid became 1 and Linux CI signalled init's process
group, shutting the runner down. Signal a group only when the child leads
its own group and it is not ours; otherwise fall back to terminate/kill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@manish-wekan
manish-wekan merged commit 20fe2c1 into develop Nov 26, 2026
3 checks passed
@manish-wekan manish-wekan mentioned this pull request Nov 26, 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.

3 participants