Skip to content

Commit 7f36891

Browse files
Add line limit parsing and output retrieval mechanism (#26)
* Add line limit parsing and output retrieval mechanism - Add server-side output storage with unique IDs - Modify execute_code to support line_limit parameter (default: 30) - Modify install_packages to support line_limit parameter (default: 30) - Implement read_output tool for paginated access to stored outputs - Add warnings for unlimited output requests (-1 line_limit) - Add comprehensive test suite for new functionality - Store full outputs and provide truncated responses when needed - Support line range retrieval (start/end parameters) in read_output Resolves #24 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Ilan F. S. Theodoro <ilan-theodoro@users.noreply.github.com> * fix(server): include exception summary in truncated stderr from execute_code Append exception summary when output is truncated so tests detect the exception type. Verified via uv run pytest -v (189 passed). Minor formatting cleanups. * chore(server): cap output storage and use ISO8601 UTC timestamps Implements _MAX_OUTPUT_ITEMS (env NAPARI_MCP_MAX_OUTPUT_ITEMS) with oldest-eviction and switches stored output timestamps to timezone-aware ISO8601. Also fixes imports in tests to use init_viewer/close_viewer. All tests pass (uv run pytest). Addresses PR review comments. * feat(server): normalize line_limit and add tests for 0 and < -1 _truncate_output now coerces invalid values to safe defaults and treats line_limit < -1 as unlimited (-1). Added tests for 0 and -2. All tests pass (191). * fix(server): normalize start/end in read_output and avoid double newlines Cast start/end to int with defaults and only insert a separator newline between stdout/stderr when needed. All tests passing (191). --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Ilan F. S. Theodoro <ilan-theodoro@users.noreply.github.com>
1 parent 08e33be commit 7f36891

6 files changed

Lines changed: 649 additions & 22 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213
- name: Install dependencies
214214
run: |
215215
uv sync --extra test
216-
216+
217217
- name: Setup Qt libraries (Linux only)
218218
uses: tlambert03/setup-qt-libs@v1
219219

0 commit comments

Comments
 (0)