docs(custom): add PATH modification example#2882
Conversation
Signed-off-by: Hector Martinez <hemartin@redhat.com>
PR Summary by QodoDocument how to modify PATH for custom tools via host_files
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
🤖 Finished Review · ✅ Success · Started 6:46 AM UTC · Completed 6:57 AM UTC |
|
cc @ralphbean as stated in the docs |
Site previewPreview: https://7cf3db48-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Code Review by Qodo
1. PATH procedure lacks numbered steps
|
| To modify the agent's `PATH` so it gains access to new executables, | ||
| use the harness' `host_files` key: | ||
|
|
||
| ```yaml | ||
| host_files: | ||
| - src: scripts/my-tool.sh | ||
| dest: /tmp/bin/my-tool.sh | ||
| - src: env/path-modification.env | ||
| dest: /sandbox/workspace/.env.d/path-modification.env | ||
| expand: false # expand works outside the runner, so we set it to false | ||
| ``` | ||
|
|
||
| The `scripts/my-tool.sh` file: | ||
|
|
||
| ```bash | ||
| #!/bin/bash | ||
|
|
||
| echo "Hello from $0" | ||
| ``` | ||
|
|
||
| And the `env/path-modification.env`: | ||
|
|
||
| ```bash | ||
| PATH=/tmp/bin:$PATH | ||
| ``` | ||
|
|
||
| The agent execution sources the special file `/sandbox/workspace/.env` which | ||
| sources all the files under `/sandbox/workspace/.env.d/`, including your | ||
| `path-modification.env` that includes `/tmp/bin/` into the `PATH`. | ||
|
|
||
| **Note**: the harness' `env.sandbox` does not work to modify the `PATH` as it | ||
| rejects numerous special variables to avoid the malfunction of the agent. |
There was a problem hiding this comment.
1. path procedure lacks numbered steps 📜 Skill insight ✧ Quality
The new ### Modifying the PATH section describes a procedure using prose and code blocks, but it does not present the procedure as a numbered (ordered) list of steps. This makes the procedure harder to follow and violates the guide requirement to express procedures as numbered steps.
Agent Prompt
## Issue description
The `### Modifying the PATH` section is procedural but written as prose paragraphs instead of a numbered step list.
## Issue Context
This file is a documentation guide under `docs/guides/`, and procedural content in guides must be written as numbered (ordered) steps.
## Fix Focus Areas
- docs/guides/user/customizing-agents.md[303-334]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| ```yaml | ||
| host_files: | ||
| - src: scripts/my-tool.sh | ||
| dest: /tmp/bin/my-tool.sh | ||
| - src: env/path-modification.env | ||
| dest: /sandbox/workspace/.env.d/path-modification.env | ||
| expand: false # expand works outside the runner, so we set it to false | ||
| ``` | ||
|
|
||
| The `scripts/my-tool.sh` file: | ||
|
|
||
| ```bash | ||
| #!/bin/bash | ||
|
|
||
| echo "Hello from $0" | ||
| ``` | ||
|
|
||
| And the `env/path-modification.env`: | ||
|
|
||
| ```bash | ||
| PATH=/tmp/bin:$PATH | ||
| ``` |
There was a problem hiding this comment.
2. Upload to /tmp/bin fails 🐞 Bug ≡ Correctness
The new example copies scripts/my-tool.sh to /tmp/bin/my-tool.sh, but the runner only pre-creates /sandbox/workspace/bin (not /tmp/bin) before copying host_files, so the upload can fail and the recipe won’t work. The runner already prepends /sandbox/workspace/bin to PATH, so using that location avoids both the directory-creation and PATH-modification pitfalls.
Agent Prompt
## Issue description
The doc example copies an executable to `/tmp/bin`, but the runner does not create `/tmp/bin` before `host_files` upload, so the copy can fail and the example is non-functional.
## Issue Context
The runner creates `/sandbox/workspace/bin` and also prepends it to `PATH` during bootstrap.
## Fix Focus Areas
- docs/guides/user/customizing-agents.md[301-334]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| The agent execution sources the special file `/sandbox/workspace/.env` which | ||
| sources all the files under `/sandbox/workspace/.env.d/`, including your | ||
| `path-modification.env` that includes `/tmp/bin/` into the `PATH`. |
There was a problem hiding this comment.
3. Overbroad env.d sourcing claim 🐞 Bug ⚙ Maintainability
The docs say /sandbox/workspace/.env “sources all the files under /sandbox/workspace/.env.d/”, but bootstrap only sources files matching *.env. Users who follow the prose and use a different extension will be silently ignored.
Agent Prompt
## Issue description
The documentation implies all files in `.env.d/` are sourced, but the implementation only sources `*.env` files.
## Issue Context
Bootstrap uses a glob over `.env.d/*.env`.
## Fix Focus Areas
- docs/guides/user/customizing-agents.md[329-331]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
ReviewFindingsMedium
Labels: Docs-only PR documenting harness host_files and env.sandbox behavior for PATH customization. |
Closes #2883