OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: tree level_limit is unavailable in Python, TypeScript, and Go SDKs

Open HaningZS opened this issue 3 months ago • 1 comments

Issue Origin

Observed and reproduced in a real environment on current main.

Bug Description

GET /api/v1/fs/tree exposes level_limit (default 3), and the English and Chinese filesystem API references document it. The repository's own Python basic-usage example also calls client.tree(..., level_limit=2).

However, none of the three HTTP SDKs expose or forward this parameter:

  • Python: AsyncHTTPClient.tree() and SyncHTTPClient.tree()
  • TypeScript: TreeOptions and OpenVikingClient.tree()
  • Go: TreeOptions and Client.Tree()

As a result, SDK users cannot request a shallower or deeper tree. The bundled Python example fails before making an HTTP request.

Steps to Reproduce

  1. Check out current main at 3590b47a25bd008068e35c8423149e3baa3203b8.
  2. Put sdk/python on PYTHONPATH.
  3. Call tree() with the parameter used by examples/basic-usage/basic_usage.py.

Expected Behavior

All three HTTP SDKs should expose the server's documented tree-depth control and send it as the level_limit query parameter, while preserving the current effective default of 3.

Actual Behavior

Python raises TypeError. TypeScript and Go do not provide a corresponding field in their public tree option types, so callers cannot express the request.

Minimal Reproducible Example

from openviking_sdk.client import AsyncHTTPClient

client = AsyncHTTPClient(url="http://127.0.0.1:1933")
client.tree("viking://resources", level_limit=1)

Error Logs

TypeError: AsyncHTTPClient.tree() got an unexpected keyword argument 'level_limit'

OpenViking Version

Current main: 3590b47a25bd008068e35c8423149e3baa3203b8

Python Version

Python 3.11.8

Operating System

macOS

Model Backend

Not applicable; this fails at the SDK request boundary and does not require a model backend.

Additional Context

The server implementation is in openviking/server/routers/filesystem.py, and the documented contract is in docs/en/api/03-filesystem.md and docs/zh/api/03-filesystem.md. The invalid in-repository example is in examples/basic-usage/basic_usage.py.

Suggested acceptance coverage:

  • Python async request parameters and sync forwarding
  • TypeScript TreeOptions plus request query
  • Go TreeOptions plus request query
  • Existing default behavior remains depth 3

I searched the open issue and PR trackers for tree level_limit and found no matching report or implementation. I also checked the current head of #3737; it modifies the SDK files but still does not expose this parameter.

HaningZS avatar Aug 18 '26 21:08 HaningZS

I'd like to work on this. I plan to keep the change at the SDK request boundary: add a failing request-contract test in each SDK first, expose the language-idiomatic option (level_limit, levelLimit, and LevelLimit), forward it as level_limit, and preserve the server's effective default of 3. No server behavior change is needed. I will run each SDK's focused and full test suites before opening the PR.

HaningZS avatar Aug 18 '26 21:08 HaningZS