Skip to content
This repository was archived by the owner on Sep 7, 2026. It is now read-only.

feat(FileClient): forward include_hidden to /api/file/home and /search_subdirs - #217

Merged
xingyaoww merged 1 commit into
mainfrom
feature/file-browser-include-hidden
Jun 19, 2026
Merged

xingyaoww merged 1 commit into
mainfrom
feature/file-browser-include-hidden

Conversation

@xingyaoww

Copy link
Copy Markdown
Contributor

Why

agent-canvas wants a "Show hidden folders" toggle in its folder browser, but the agent-server's /api/file/home and /api/file/search_subdirs endpoints filter out hidden (dot-) entries by default. The server is gaining an include_hidden query param (OpenHands/software-agent-sdk#3740), but the typed FileClient here has no way to forward it — so the frontend would be forced to construct the low-level HttpClient directly, which agent-canvas's API-access guard explicitly bans.

Summary

  • Added an optional includeHidden flag to FileHomeOptions and FileSearchSubdirsOptions.
  • FileClient.getHome({ includeHidden }) and FileClient.searchSubdirectories(path, { includeHidden }) now forward include_hidden=true when set.
  • When unset, the param is omitted entirely, so requests are byte-identical to before (backward compatible).
  • Typed the existing favorites / locations fields on FileHomeResponse as FileBrowserEntry[] ({ label, path }), matching the agent-server's HomeResponse model.

Type

  • Feature

Backward compatibility

Purely additive: optional params/options only. Older agent-servers ignore the unknown include_hidden query param, so consumers on a newer client + older server keep working (the toggle is just a no-op).

How to Test

npm run build && npm test -- --testPathPatterns=api-clients — adds two tests:

  • FileClient forwards includeHidden to the home and search_subdirs endpoints — asserts ?include_hidden=true is appended to both URLs when set.
  • FileClient omits include_hidden when includeHidden is not set — asserts the param is absent (URL unchanged) when not set.

All 55 api-clients tests pass; build + lint clean.

Linked

This PR was created by an AI agent (OpenHands) on behalf of the user.

…h_subdirs

Add an optional includeHidden flag to FileHomeOptions and
FileSearchSubdirsOptions so callers can request hidden (dot-) entries
from the agent-server's file-browser endpoints. When unset, the param
is omitted entirely so requests stay byte-identical to before
(backward compatible).

Also types the existing favorites/locations fields on FileHomeResponse
as FileBrowserEntry[] (label, path), matching the agent-server's
HomeResponse model.

Needed by agent-canvas to add a 'Show hidden folders' toggle to the
folder browser without reaching for the low-level HttpClient.

Co-authored-by: openhands <openhands@all-hands.dev>
@xingyaoww
xingyaoww requested a review from all-hands-bot June 19, 2026 20:16

all-hands-bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ Review complete.

This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here.

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Taste Rating: Good taste — this is a small, additive API extension that uses the existing request parameter machinery without changing default behavior.

No blocking issues found. include_hidden is only emitted when includeHidden is true, the old getHome() and searchSubdirectories(path) URLs remain unchanged when unset, and the added tests cover both the opt-in and omitted-parameter paths. CI is green across build, unit, integration, smoke, and security checks.

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW
    Small typed-client surface addition with optional fields only, no dependency changes, no new security-sensitive code, and backward-compatible default request serialization.

VERDICT:
✅ Worth merging: Core logic is sound and the behavior is covered by tests.

KEY INSIGHT:
The patch cleanly threads one optional boolean through the existing HttpClient parameter path, preserving byte-identical requests for existing callers.

This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation

@xingyaoww
xingyaoww merged commit e9510e2 into main Jun 19, 2026
7 checks passed
@VascoSch92 VascoSch92 added the type: feat A new feature label Jun 24, 2026
@openhands-release-bot openhands-release-bot Bot added the released: v1.27.0 Shipped in v1.27.0 label Jun 25, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in v1.27.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released: v1.27.0 Shipped in v1.27.0 type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants