Skip to content

Conversation

@markovejnovic
Copy link
Collaborator

No description provided.

Update all API call sites to use the new hierarchical client
pattern (client.org().repos().at().content()), new Content/DirEntry
enums from mesa_dev::low_level::content, and string-based error
wrapping since the error type is now generic per endpoint.
@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Feb 10, 2026

Mesa Description

This PR upgrades the mesa-dev SDK to version 1.8.0, which includes a completely new API. The changes primarily involve refactoring the mescloud module to adapt to the new client, data models, and error handling.

  • API Client Update: The mesa_dev::Mesa client has been replaced with mesa_dev::MesaClient, and its initialization now uses a new builder pattern. All API call sites have been updated to align with the new SDK methods.

  • Improved Error Handling: A new MesaApiError enum was introduced to provide more specific error handling for API interactions, replacing the generic mesa_dev::error::MesaError. This improves the clarity and robustness of our error-handling logic.

  • Logic Simplification: The synchronization logic in OrgFs was updated to fetch repository status directly instead of polling, removing the wait_for_sync function and simplifying the lookup and readdir implementations.

  • Dependency Changes: Cargo.toml and Cargo.lock were updated to reflect the mesa-dev version bump and include new transitive dependencies such as reqwest and reqwest-middleware.

Description generated by Mesa. Update settings

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

Performed full review of 6fc3cda...9c2fd82

Analysis

  1. The migration to mesa-dev 1.8 removes structured error context that was previously used to distinguish between authentication, throttling, and missing data issues, which may negatively impact observability and errno mapping.

  2. With the new dependency on the low-level content API, filesystem semantics (file/directory/symlink distinctions) must be preserved with absolute precision to prevent abstraction leakage through the FUSE bridge.

  3. The extensive plumbing changes required to adapt to the new builder- and resource-based SDK models may introduce subtle compatibility issues between the OrgFs/RepoFs layers and the new response models.

  4. Converting SDK errors to bare strings simplifies trait bounds but removes valuable context that higher layers previously utilized, creating a trade-off that warrants further evaluation.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

0 files reviewed | 2 comments | Edit Agent SettingsRead Docs

let kind = match &content {
mesa_dev::models::Content::File { .. } => DirEntryType::RegularFile,
mesa_dev::models::Content::Dir { .. } => DirEntryType::Directory,
Content::File(_) | Content::Symlink(_) => DirEntryType::RegularFile,
Copy link

Choose a reason for hiding this comment

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

Medium

Content::Symlink is being surfaced as a DirEntryType::RegularFile (and below as a FileAttr::RegularFile). From the FUSE side this means lstat/readdir will never report an entry as a symlink, so the kernel will happily open/read it instead of issuing a readlink, and all downstream tooling will think the repo tree contains plain files. The new content API distinguishes File vs Symlink so we should preserve that by returning DirEntryType::Symlink and a FileAttr::Symlink { size } for links (and wiring up readlink/ENOSYS separately). Otherwise every symlink in a repo is misrepresented and will behave as an opaque regular file.

Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: mesa-dot-dev/gitfs#32
File: src/fs/mescloud/repo.rs#L133
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
`Content::Symlink` is being surfaced as a `DirEntryType::RegularFile` (and below as a `FileAttr::RegularFile`). From the FUSE side this means `lstat`/`readdir` will never report an entry as a symlink, so the kernel will happily `open`/`read` it instead of issuing a `readlink`, and all downstream tooling will think the repo tree contains plain files. The new content API distinguishes `File` vs `Symlink` so we should preserve that by returning `DirEntryType::Symlink` and a `FileAttr::Symlink { size }` for links (and wiring up `readlink`/`ENOSYS` separately). Otherwise every symlink in a repo is misrepresented and will behave as an opaque regular file.

mesa_dev::models::Content::File { content, .. } => content,
mesa_dev::models::Content::Dir { .. } => return Err(ReadError::NotAFile),
Content::File(f) => f.content.unwrap_or_default(),
Content::Symlink(s) => s.content.unwrap_or_default(),
Copy link

Choose a reason for hiding this comment

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

Medium

read() now base64‑decodes Content::Symlink and returns the underlying string just like a file. That isn’t valid FUSE semantics: reading a symlink should either be rejected (EINVAL/ENOSYS) or follow the link via a dedicated readlink implementation. With the current code a cat of a symlink feeds the encoded target instead of the file it points at, and there is no way for the kernel to discover the link target via readlink. Once symlinks are surfaced as DirEntryType::Symlink, this branch should return ReadError::NotAFile (or implement a proper readlink) rather than pretending the link is file content.

Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: mesa-dot-dev/gitfs#32
File: src/fs/mescloud/repo.rs#L306
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
`read()` now base64‑decodes `Content::Symlink` and returns the underlying string just like a file. That isn’t valid FUSE semantics: reading a symlink should either be rejected (`EINVAL`/`ENOSYS`) or follow the link via a dedicated `readlink` implementation. With the current code a `cat` of a symlink feeds the encoded target instead of the file it points at, and there is no way for the kernel to discover the link target via `readlink`. Once symlinks are surfaced as `DirEntryType::Symlink`, this branch should return `ReadError::NotAFile` (or implement a proper `readlink`) rather than pretending the link is file content.

@markovejnovic markovejnovic merged commit cc7ead7 into main Feb 10, 2026
6 checks passed
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.

1 participant