Skip to content

Commit 5c4277c

Browse files
durandomclaude
andauthored
docs: improve local setup guide with env requirements and troubleshooting (#14)
Documents the two-layer env architecture (runner context vs sandbox .env.d), per-agent env file requirements (GH_TOKEN, GIT_BOT_EMAIL), custom image requirement, sandbox log inspection, and common local setup mistakes. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 241cf13 commit 5c4277c

1 file changed

Lines changed: 94 additions & 16 deletions

File tree

.claude/skills/fullsend/references/local-setup.md

Lines changed: 94 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Guide for running fullsend agents locally on a Mac. Covers only RHDH-specific se
1616
Direct the user to the canonical upstream guide for all generic setup:
1717

1818
```
19-
📘 Follow the upstream guide first:
19+
Follow the upstream guide first:
2020
https://github.com/fullsend-ai/fullsend/blob/main/docs/guides/user/running-agents-locally.md
2121
2222
It covers: fullsend CLI download, OpenShell install, GCP credentials,
@@ -31,15 +31,20 @@ Our agents run on the `rhdh-sidekick-167988` GCP project. If the user's team lea
3131

3232
Present the GCP env file with our project values filled in:
3333

34-
```
34+
```bash
3535
# ~/.config/fullsend/gcp-vertex.env
3636
ANTHROPIC_VERTEX_PROJECT_ID=rhdh-sidekick-167988
3737
CLOUD_ML_REGION=us-east5
3838
GOOGLE_CLOUD_PROJECT=rhdh-sidekick-167988
39-
GOOGLE_APPLICATION_CREDENTIALS=/path/to/.config/fullsend/fullsend-local-credentials.json
39+
GOOGLE_APPLICATION_CREDENTIALS=/Users/<you>/.config/fullsend/fullsend-local-credentials.json
4040
FULLSEND_SANDBOX_IMAGE=ghcr.io/redhat-developer/rhdh-fullsend-code:latest
4141
```
4242

43+
**IMPORTANT:** `FULLSEND_SANDBOX_IMAGE` must point to the RHDH custom image, not the upstream
44+
default (`ghcr.io/fullsend-ai/fullsend-sandbox:dev`). The custom image includes corepack,
45+
yarn, and openspec — without it, `yarn install` and `openspec validate` will fail inside
46+
the sandbox.
47+
4348
### 3. RHDH custom sandbox image
4449

4550
Our image extends upstream with corepack + yarn for JS monorepos:
@@ -57,42 +62,115 @@ podman build -t rhdh-fullsend-code:local \
5762
export FULLSEND_SANDBOX_IMAGE=localhost/rhdh-fullsend-code:local
5863
```
5964

60-
### 4. Running an RHDH agent
65+
### 4. Per-agent env files
66+
67+
Each agent needs a local env file with the runner-context variables that
68+
`expand: true` substitutes into the sandbox. The scaffold's env templates
69+
(e.g., `env/code-agent.env`) reference `${GH_TOKEN}`, `${ISSUE_NUMBER}`, etc.
70+
— your local env file provides the values.
71+
72+
**Common variables all agents need:**
73+
74+
| Variable | Source | Notes |
75+
|----------|--------|-------|
76+
| `GH_TOKEN` | `gh auth token` | Read-only in sandbox; used for `gh` commands |
77+
| `ISSUE_NUMBER` | Per-run | The issue or PR number to work on |
78+
| `GITHUB_ISSUE_URL` | Per-run | Full URL to the issue |
79+
| `REPO_FULL_NAME` | Per-run | `owner/repo` format |
80+
81+
**Code agent** (`~/.config/fullsend/code-agent.env`):
82+
83+
```bash
84+
GH_TOKEN=<output of gh auth token>
85+
ISSUE_NUMBER=<number>
86+
GITHUB_ISSUE_URL=https://github.com/redhat-developer/rhdh-plugins/issues/<number>
87+
REPO_FULL_NAME=redhat-developer/rhdh-plugins
88+
GIT_BOT_EMAIL=noreply@local
89+
GIT_AUTHOR_NAME=fullsend-local
90+
GIT_AUTHOR_EMAIL=noreply@local
91+
GIT_COMMITTER_NAME=fullsend-local
92+
GIT_COMMITTER_EMAIL=noreply@local
93+
MAX_RETRIES=1
94+
TIMEOUT_SECONDS=2100
95+
```
96+
97+
`GIT_BOT_EMAIL` is required — the scaffold's `code-agent.env` template uses
98+
`${GIT_BOT_EMAIL}` for `GIT_AUTHOR_EMAIL` and `GIT_COMMITTER_EMAIL`. In CI,
99+
this is resolved from the GitHub App bot identity. Locally, `noreply@local` works.
61100

62-
After gateway is running, show a typical triage run:
101+
**Triage agent** (`~/.config/fullsend/triage.env`):
63102

64103
```bash
65-
# Agent-specific env
66-
# ~/.config/fullsend/triage.env
67-
GH_TOKEN=<your-github-pat>
104+
GH_TOKEN=<output of gh auth token>
68105
GITHUB_ISSUE_URL=https://github.com/<org>/<repo>/issues/<number>
69106
```
70107

108+
### 5. Running an RHDH agent
109+
110+
After gateway is running (`~/.config/fullsend/start-gateway.sh`), run an agent:
111+
71112
```bash
113+
# Triage (quickest — ~2 min, ~$2)
72114
fullsend run triage \
73-
--fullsend-dir /path/to/fullsend/internal/scaffold/fullsend-repo/ \
74-
--target-repo /path/to/your/target-repo/ \
115+
--fullsend-dir ~/src/rhdh/asdlc-lab/resources/fullsend-ai/fullsend/internal/scaffold/fullsend-repo/ \
116+
--target-repo ~/src/rhdh/rhdh-plugins/ \
75117
--env-file ~/.config/fullsend/gcp-vertex.env \
76118
--env-file ~/.config/fullsend/triage.env \
77119
--no-post-script
120+
121+
# Code (full run — ~15-35 min, ~$15-30)
122+
fullsend run code \
123+
--fullsend-dir ~/src/rhdh/asdlc-lab/resources/fullsend-ai/fullsend/internal/scaffold/fullsend-repo/ \
124+
--target-repo ~/src/rhdh/rhdh-plugins/ \
125+
--env-file ~/.config/fullsend/gcp-vertex.env \
126+
--env-file ~/.config/fullsend/code-agent.env \
127+
--no-post-script
78128
```
79129

80-
`--no-post-script` prevents the agent from modifying the GitHub issue. Remove it when you want the agent to act on its triage result.
130+
`--no-post-script` prevents the agent from pushing branches or creating PRs.
131+
Remove it only when you want the agent to act on its result.
132+
133+
### 6. Checking sandbox logs
134+
135+
After a run, inspect sandbox logs for network policy issues:
81136

82-
Refer to the upstream guide's per-agent env var tables for `code`, `review`, and `fix` agents.
137+
```bash
138+
# Find the latest run output
139+
ls -td /tmp/fullsend/agent-*/ | head -1
140+
141+
# Check for DENIED requests
142+
grep "DENIED" /tmp/fullsend/agent-*/logs/openshell-sandbox.log | sort | uniq -c | sort -rn
143+
144+
# Full sandbox log
145+
less /tmp/fullsend/agent-*/logs/openshell-sandbox.log
146+
```
83147

84-
### 5. What to expect
148+
### 7. What to expect
85149

86150
| Metric | Value |
87151
|--------|-------|
88152
| Sandbox creation | ~2-8 seconds |
89153
| Bootstrap | ~7 seconds |
90154
| Agent inference | ~30-60 seconds per iteration |
91155
| Total (triage) | ~2 minutes |
156+
| Total (code) | ~15-35 minutes |
92157
| Estimated cost (triage) | ~$2.00 |
158+
| Estimated cost (code) | ~$15-30 |
159+
160+
Output: `/tmp/fullsend/agent-<type>-*/iteration-*/output/agent-result.json`
161+
162+
### 8. Troubleshooting (RHDH-specific)
93163

94-
Output: `/tmp/fullsend/agent-triage-*/iteration-*/output/agent-result.json`
164+
For generic troubleshooting (sandbox creation, gateway connectivity, missing env vars,
165+
arm64 image pulls, Podman host-gateway), see the upstream guide.
95166

96-
### 6. Troubleshooting (RHDH-specific)
167+
**Common local setup mistakes:**
97168

98-
For generic troubleshooting (sandbox creation, gateway connectivity, missing env vars, arm64 image pulls, Podman host-gateway), see the upstream guide.
169+
| Symptom | Cause | Fix |
170+
|---------|-------|-----|
171+
| `yarn: command not found` | Using upstream default image instead of RHDH custom image | Set `FULLSEND_SANDBOX_IMAGE=ghcr.io/redhat-developer/rhdh-fullsend-code:latest` in gcp-vertex.env |
172+
| Agent can't run `gh` commands | Missing `GH_TOKEN` in local env file | Add `GH_TOKEN=<gh auth token>` to your agent env file |
173+
| Git commits fail with empty email | Missing `GIT_BOT_EMAIL` in code-agent.env | Add `GIT_BOT_EMAIL=noreply@local` — the scaffold template uses `${GIT_BOT_EMAIL}` |
174+
| `COREPACK_HOME` not set | Using upstream image (Docker ENV stripped at runtime) | Use RHDH custom image + `rhdh-toolchain.env` sets it via `.env.d/` |
175+
| `DENIED ... edge.openspec.dev:443` | openspec telemetry not in policy | Set `OPENSPEC_TELEMETRY=0` in `rhdh-toolchain.env` |
176+
| 268 DENIED for `registry.npmjs.org` | Yarn scoped packages use `%2F` encoding | Add `allow_encoded_slash: true` to npmjs endpoint in policy |

0 commit comments

Comments
 (0)