Skip to content

feat: Expose per-mount subpath/alias/permission on legacy ComputeSession GraphQL node#11967

Open
rapsealk wants to merge 4 commits into
mainfrom
feat/session-mount-info-legacy
Open

feat: Expose per-mount subpath/alias/permission on legacy ComputeSession GraphQL node#11967
rapsealk wants to merge 4 commits into
mainfrom
feat/session-mount-info-legacy

Conversation

@rapsealk

@rapsealk rapsealk commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

The current WebUI still consumes the legacy Graphene GraphQL schema, where a session only exposes mounts (vfolder names) and vfolder_mounts (vfolder UUIDs) — both of which drop per-mount details such as the mounted subpath, the in-container mount destination (alias), and the granted permission.

This PR adds a read-only vfolder_mount_infos field to the legacy ComputeSession and ComputeSessionNode types, surfacing those per-mount details directly from the stored VFolderMount objects (via row.vfolders_sorted_by_id) so the UI can render them without waiting for the SessionV2 migration.

This is a deliberate, scoped exception to the v2-first rule, justified by the UI still consuming the legacy schema. It is limited to read-only mount fields.

New type VFolderMountInfo

GraphQL field Source (VFolderMount / VFolderMountData) Notes
vfolder_id str(m.vfid.folder_id)
name m.name
subpath str(m.vfsubpath) null when mounting the vfolder root (".")
mount_destination str(m.kernel_path) alias / container mount path
permission m.mount_perm.value
usage_mode m.usage_mode.value

The existing mounts and vfolder_mounts fields are unchanged for backward compatibility. The new field is populated at every construction site: ComputeSessionNode.from_row, ComputeSessionNode.from_dataclass, and ComputeSession.parse_row.

Test plan

  • pants fmt --changed-since=main
  • pants fix --changed-since=main
  • pants lint --changed-since=main
  • pants check --changed-since=main
  • pants test --changed-since=main
  • GraphQL schema regenerated (scripts/generate-graphql-schema.sh); schema.graphql and supergraph.graphql updated
  • Unit test added (tests/unit/manager/test_vfolder_mount_info.py) covering the per-mount mapping helper, including the subpath == "."null case and custom mount_destination/permission
  • Live server verification pending

Part of #11962
Resolves #11964

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://sorna--11967.org.readthedocs.build/en/11967/


📚 Documentation preview 📚: https://sorna-ko--11967.org.readthedocs.build/ko/11967/

…ion GraphQL node

Add a read-only vfolder_mount_infos field to the legacy Graphene
ComputeSession and ComputeSessionNode types, surfacing per-mount subpath,
alias (mount destination), and permission from the stored VFolderMount
objects. The existing mounts and vfolder_mounts fields are unchanged.

Resolves #11964

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 04:39
@rapsealk rapsealk requested a review from a team as a code owner June 8, 2026 04:39
@rapsealk rapsealk added this to the 26.4 milestone Jun 8, 2026
@github-actions github-actions Bot added size:L 100~500 LoC comp:manager Related to Manager component type:enhance Enhance component, behavior, internals without user-facing features labels Jun 8, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the area:docs Documentations label Jun 8, 2026

Copilot AI 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.

Pull request overview

This PR extends the legacy Graphene (v1) GraphQL ComputeSession and ComputeSessionNode types with a new read-only vfolder_mount_infos field so the current WebUI can access per-mount vfolder metadata (subpath, in-container destination/alias, permission, usage_mode) that is already persisted on sessions but not exposed in the legacy schema.

Changes:

  • Added a legacy Graphene output type VFolderMountInfo plus mapping helpers to convert stored VFolderMount / VFolderMountData entries into GraphQL-friendly objects (including "."null normalization for root subpath).
  • Populated vfolder_mount_infos from all legacy ComputeSession construction paths (ComputeSessionNode.from_row, ComputeSessionNode.from_dataclass, ComputeSession.parse_row) without modifying existing mounts / vfolder_mounts.
  • Regenerated the published GraphQL schema docs and added unit tests for the mount-info mapping behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/unit/manager/test_vfolder_mount_info.py Adds unit tests validating the mount-to-GraphQL mapping and "."null subpath normalization.
src/ai/backend/manager/api/gql_legacy/session.py Introduces VFolderMountInfo, mapping helpers, and exposes vfolder_mount_infos on legacy session types.
docs/manager/graphql-reference/supergraph.graphql Updates the federated supergraph schema docs to include the new field and type.
docs/manager/graphql-reference/schema.graphql Updates the legacy schema docs to include the new field and type.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The graphql-inspector CI rule (gql-inspector-checker.js) requires every
newly added GraphQL type to carry a description containing a version in
the 'Added in XX.X.X.' format. Graphene emits the class docstring as the
type description, so the version string is added to the docstring (and the
regenerated schema dumps) to satisfy the TYPE_ADDED check.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rapsealk rapsealk requested a review from HyeockJinKim June 8, 2026 05:38
@github-actions

Copy link
Copy Markdown

This PR has had no activity for 14 days and has been marked as stale. It will be closed on 2026-07-09 (in 14 days) if no further activity occurs. Push a commit or leave a comment to keep it open.

@github-actions github-actions Bot added the stale label Jun 25, 2026

@seedspirit seedspirit 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.

Rather than expanding legacy graphene based schema, let's migrate to v2 schema(based on strawberry)

@github-actions github-actions Bot removed the stale label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:manager Related to Manager component size:L 100~500 LoC type:enhance Enhance component, behavior, internals without user-facing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose per-mount subpath/alias/permission on the legacy ComputeSession GraphQL node

3 participants