Skip to content

fix(mounts): resolve rclone remote names consistently#3624

Open
mshsheikh wants to merge 3 commits into
openai:mainfrom
mshsheikh:patch-61
Open

fix(mounts): resolve rclone remote names consistently#3624
mshsheikh wants to merge 3 commits into
openai:mainfrom
mshsheikh:patch-61

Conversation

@mshsheikh

Copy link
Copy Markdown
Contributor
  • Use RcloneMountPattern.resolve_remote_name() when building the per-session config path and when launching/unmounting rclone processes.

  • This keeps apply() and unapply() aligned on the same remote name, preserves deterministic naming when no explicit remote_name is provided, and removes the current dead wiring around pattern-level name resolution.

  • The change is intentionally limited to name resolution and does not alter mount semantics.

- Use `RcloneMountPattern.resolve_remote_name()` when building the per-session config path and when launching/unmounting rclone processes.

- This keeps `apply()` and `unapply()` aligned on the same remote name, preserves deterministic naming when no explicit remote_name is provided, and removes the current dead wiring around pattern-level name resolution.

- The change is intentionally limited to name resolution and does not alter mount semantics.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e210af4418

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

"rclone",
"mount",
f"{config.remote_name}:{config.remote_path}",
f"{remote_name}:{config.remote_path}",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pass the resolved remote name into rclone helpers

When any rclone mount is applied, the default fuse path calls _start_rclone_client(), but this helper has no remote_name parameter or local binding, so evaluating this f-string raises NameError before rclone is invoked. The NFS server helper has the same issue, so this change currently breaks rclone mounts instead of just changing name resolution.

Useful? React with 👍 / 👎.

Comment on lines +977 to +981
remote_name = self.resolve_remote_name(
session_id=session_id.hex,
remote_kind=rclone_config.remote_kind,
mount_type=rclone_config.mount_type,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the resolved remote name during teardown

For mounts where the pattern-level or derived name differs from rclone_config.remote_name, teardown computes the resolved remote_name here but the pkill pattern below still matches rclone_config.remote_name. After apply launches rclone under the resolved name, unapply will miss that process and leave the rclone mount/server running.

Useful? React with 👍 / 👎.

- Thread the resolved rclone remote name through `_start_rclone_server()`, `_start_rclone_client()`, and `unapply()` so mount creation and cleanup use the same identifier.

- This fixes the regression introduced by the name-resolution change, prevents the helper NameError, and keeps teardown aligned with the process started during `apply()`.

- No public API changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9646e6dba4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +905 to +909
remote_name = self.resolve_remote_name(
session_id=session_id_str,
remote_kind=rclone_config.remote_kind,
mount_type=rclone_config.mount_type,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the config's remote name when launching rclone

When RcloneMountPattern.apply() is called with a caller-supplied RcloneMountConfig whose config_text defines the section named by rclone_config.remote_name (the existing direct/custom adapter path), this now ignores that name and launches rclone with a generated sandbox_<kind>_<session> remote instead. The isolated config file is still written from the original config_text, so rclone looks for a section that is not present and the mount fails (for example [remote] is written but sandbox_s3_...:bucket is mounted).

Useful? React with 👍 / 👎.

- Pass the configured rclone remote name through the helper launch path and reuse it in `unapply()` so mount setup and cleanup target the same remote.

- This keeps the current config-file-based adapter path working without changing user-facing behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants