Repository navigation
Fix agent workspace isolation and Hermes one-shot resume - #7103
Conversation
dec5368 to
98e0fb0
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces several enhancements to the CLI commands. Specifically, it routes resumed one-shot prompts through Hermes' session-aware chat command, configures a dedicated workspace directory for OpenClaw, and adds external directory permissions for OpenCode when running in YOLO mode. Additionally, corresponding unit tests have been updated and added. The feedback suggests a more idiomatic way to prepend elements to a list in _hermes_resume_oneshot_args using list concatenation instead of slice assignment.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5de5d70da7
ℹ️ 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".
98e0fb0 to
f13c04e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f13c04ece2
ℹ️ 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".
f13c04e to
621bfd6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 621bfd6777
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 621bfd6777
ℹ️ 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".
621bfd6 to
e1fb76a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 673372d108
ℹ️ 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".
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 559417b42c
ℹ️ 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".
…to fix/start-agent-session-safety
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4039a3d54a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e88877af6
ℹ️ 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".
| if permission.get("external_directory") == {"*": "allow"}: | ||
| permission["external_directory"] = {"*": "ask"} |
There was a problem hiding this comment.
Clear stale external_directory instead of forcing ask
When a reused --no-launch/--persist OpenCode config follows a --yolo run, this writes an explicit external_directory ask rule into the OPENCODE_CONFIG file. OpenCode loads OPENCODE_CONFIG above the user's global config (https://opencode.ai/docs/config/), and external_directory already defaults to prompting, so this overrides a user's global deny/allow policy instead of just removing Unsloth's stale yolo override; delete the key when it matches the yolo fingerprint so the next non-yolo run falls back to the user's policy/default.
Useful? React with 👍 / 👎.
| # config so ephemeral launches avoid ~/.openclaw and persisted sessions retain it. | ||
| workspace = path.parent / "workspace" | ||
| workspace.mkdir(parents = True, exist_ok = True, mode = 0o700) | ||
| defaults["workspace"] = workspace_path or str(workspace) |
There was a problem hiding this comment.
Clear default OpenClaw agentDir during isolation
When a reused managed openclaw.json contains agents.defaults.agentDir (for example after OpenClaw setup or migration records a default state root), this path survives while only the default workspace and per-agent paths are adjusted. OpenClaw uses agentDir for agent state/session storage, so those launches can still write sessions under the old ~/.openclaw or another user path despite the Unsloth session dir being isolated; clear or relocate the default agentDir alongside the default workspace.
Useful? React with 👍 / 👎.
Summary
chatcommand in quiet, unattended mode.Details
Hermes handles top-level
-zbefore its resume shortcut and does not pass--resumeor--continueinto one-shot execution. The wrapper now converts only resumed one-shot invocations to the equivalent session-aware chat form and preserves automatic tool approval. New one-shot sessions and interactive resume commands remain unchanged.Hermes upstream exposes
--usage-fileonly for top-level one-shot execution, so it cannot be preserved by the chat compatibility path. That unsupported combination now fails with a clear message instead of losing resume state or passing an invalid chat option.OpenClaw's state directory does not relocate its default workspace, so ephemeral sessions could initialize or read
~/.openclaw/workspace. The workspace is now pinned beside the managed config and persists only when the session itself persists. When WSL launches a Windows OpenClaw shim, the embedded workspace path is converted withwslpath -wjust like the config and state environment paths.OpenCode requires a separate
external_directorypermission when tools access paths outside the launch directory. YOLO mode now enables it, while later non-YOLO launches restore the prompting policy.Verification
python -m pytest unsloth_cli/tests -q(390 passed)python -m ruff check unsloth_cli/commands/start.py unsloth_cli/tests/test_start.pypython -m py_compile unsloth_cli/commands/start.py unsloth_cli/tests/test_start.pypython scripts/enforce_kwargs_spacing.py unsloth_cli/commands/start.py unsloth_cli/tests/test_start.py