feat: add commands.shellProfile option for custom shell profile loading#52154
feat: add commands.shellProfile option for custom shell profile loading#52154easyteacher wants to merge 1 commit intoopenclaw:mainfrom
commands.shellProfile option for custom shell profile loading#52154Conversation
Greptile SummaryThis PR adds an opt-in Key changes:
All issues raised in prior review rounds have been addressed: the Confidence Score: 4/5
Reviews (4): Last reviewed commit: "feat: add commands.shellProfile option f..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a17a503db6
ℹ️ 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".
e25351b to
5401087
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5401087b69
ℹ️ 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".
5401087 to
b288254
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b28825483d
ℹ️ 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".
b288254 to
e2ab098
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2ab098faa
ℹ️ 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".
e2ab098 to
2eedd81
Compare
|
@greptile-apps Please re-evaluate |
b56603a to
e90f1e1
Compare
|
@greptile-apps Please re-evaluate |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e90f1e13f8
ℹ️ 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".
e90f1e1 to
46944f0
Compare
|
@greptile-apps Please re-evaluate |
46944f0 to
d9b57fe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9b57fe3bd
ℹ️ 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".
d9b57fe to
8f84703
Compare
4e73b7f to
49bb269
Compare
|
All passed, and it turns out |
50446e7 to
e1a14c6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1a14c6536
ℹ️ 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".
f9b1a99 to
e41f7a4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e41f7a4b6e
ℹ️ 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".
e41f7a4 to
29dff47
Compare
29dff47 to
db91262
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db912620ce
ℹ️ 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".
b4c1659 to
16dc185
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16dc185eaf
ℹ️ 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".
16dc185 to
9f051b3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f051b329c
ℹ️ 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".
9f051b3 to
019c33f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 019c33fd66
ℹ️ 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".
019c33f to
3bef192
Compare
- Add shellProfile option to CommandsConfig type - Add Zod schema validation requiring absolute file path - Add help text and label for shellProfile config - Update getShellConfig() to accept and use shellProfile parameter - Support PowerShell, bash, zsh, and sh profile loading - PowerShell: source profile with . 'path'; prefix - Bash/Zsh/Sh: use source command prefix (non-interactive shells ignore --init-file) - Fix POSIX shell -c argument handling: concatenate source prefix with command - Pass shellProfile through exec tool chain - Add tests for shellProfile functionality
3bef192 to
969cdaa
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 969cdaaf85
ℹ️ 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 (baseName === "bash" || baseName === "zsh" || baseName === "sh") { | ||
| return { shell, args: ["-c", buildSourcePrefix(profile)] }; | ||
| } |
There was a problem hiding this comment.
Source shellProfile for dash/ksh-style POSIX shells
The profile-loading branch only runs when baseName is exactly bash, zsh, or sh, so hosts where $SHELL is dash/ksh (or other POSIX shells that still support .) silently skip commands.shellProfile and execute with plain -c. In those environments, commands that rely on profile-defined PATH/aliases/functions will fail even though a valid absolute shellProfile is configured.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Current-main absence is source-reproducible from Next step before merge Security Review findings
Review detailsBest possible solution: Land a rebased implementation of an explicit opt-in shell profile setting that preserves current startup-file suppression and placeholder-shell fallback, keeps allowlist-enforced commands profile-free, documents host limitations, adds focused regression tests, and includes a changelog entry. Do we have a high-confidence way to reproduce the issue? Yes. Current-main absence is source-reproducible from Is this the best way to solve the issue? No. The feature direction is plausible, but this branch is not the best mergeable solution until it is rebased onto current main and fixes the unused import, changelog, and shell-startup contract regression. Full review comments:
Overall correctness: patch is incorrect Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 06056926a099. |
Summary
Describe the problem and fix in 2–5 bullets:
Problem: Users could not specify a custom shell profile file for command execution, causing commands to run without user-defined environment variables, aliases, and functions.
Why it matters: Users with custom shell configurations (e.g., custom PATH, aliases, environment variables) could not leverage these in OpenClaw's command execution, leading to "command not found" errors or missing environment setup.
What changed: Added
commands.shellProfileconfiguration option that accepts an absolute file path to a shell profile. When set, PowerShell, bash, zsh, and sh will source/load this profile before executing commands.What did NOT change (scope boundary): Default shell behavior remains unchanged when
shellProfileis not configured. No changes to existing command execution logic beyond profile loading.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
commands.shellProfile(string, optional){ "commands": { "shellProfile": "C:\\Users\\username\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1" } }Security Impact (required)
New permissions/capabilities? (
Yes)Secrets/tokens handling changed? (
No)New/changed network calls? (
No)Command/tool execution surface changed? (
Yes)Data access scope changed? (
No)Repro + Verification
Environment
{ "commands": { "shellProfile": "/home/user/.bashrc" } }Steps
shellProfileto openclaw.json config with an absolute path to your shell profileopenclaw doctorto verify config is validExpected
Actual
Evidence
Attach at least one:
Before:

After:

Human Verification (required)
What you personally verified (not just CI), and how:
Verified scenarios:
-NoProfileflag followed by manual sourcingEdge cases checked:
shellProfileis treated as unsetshellProfileis treated as unsetWhat you did not verify:
Running on macOS/Linux
Review Conversations
Compatibility / Migration
Yes)Yes)commands.shellProfileNo)Failure Recovery (if this breaks)
shellProfilefrom config or set to empty stringRisks and Mitigations
Risk: User specifies non-existent profile file path
Risk: Profile file contains syntax errors
Risk: Profile loading slows down command execution