Skip to content

Commit c80f287

Browse files
authored
feat(claudebox): pass mode=public to the v2 /run webhook (#23607)
Follow-up to #23600 (merged), which pointed CI at the ClaudeBox v2 `/run` webhook but did not pass a mode. A v2 session's GitHub repo access is derived from its mode (`slack_route.effective_mode` in session meta). The `slackbot` group's repos are entirely mode-scoped, so a `/run` session **without** a mode only resolves the group chain's unscoped repos (`claudebox` + `honk-ai`) and **cannot write `aztec-packages`** — the same "no GitHub access" failure #23600 set out to fix. Prompt text has no effect; `/run` never parses mode flags. This passes **`mode: "public"`** in both dispatch payloads (overridable via repo var `CLAUDEBOX_MODE`), so kickoff/`/claudebox`/review sessions resolve the public read-write repo set and can open PRs against aztec-packages. **Depends on AztecProtocol/claudebox#625**, which adds `mode` support to the v2 `/run` endpoint (it stamps `effective_mode` into the new session's meta). Without #625 deployed, `mode` is accepted but ignored, so land/deploy #625 first or together. ## Testing - `bash -n` on every `run:` body (7 steps) and YAML parse — pass. - `jq` payload validated with `mode: "public"` for the issue-comment, workflow_dispatch, and review shapes — valid JSON matching the v2 `RunRequest`. --- *Created by [claudebox](https://claudebox.work/v2/sessions/4b53f2dd8370a83a) · group: `slackbot`*
2 parents 2fa2623 + 05aa901 commit c80f287

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/claudebox.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ jobs:
129129
AUTHOR: ${{ github.event.comment.user.login || github.actor }}
130130
SLACK_CHANNEL: ${{ inputs.slack_channel || '' }}
131131
SLACK_THREAD_TS: ${{ inputs.slack_thread_ts || '' }}
132+
# Public mode grants the session read-write access to public repos
133+
# (aztec-packages). Without it the session only gets the group's
134+
# unscoped repos and cannot open PRs against aztec-packages.
135+
CLAUDEBOX_MODE: ${{ vars.CLAUDEBOX_MODE || 'public' }}
132136
run: |
133137
if [ -z "${CLAUDEBOX_API_SECRET:-}" ]; then
134138
echo "ERROR: CLAUDEBOX_API_SECRET is not set; cannot dispatch ClaudeBox v2"
@@ -145,7 +149,8 @@ jobs:
145149
--arg link "$CLAUDEBOX_LINK" \
146150
--arg slack_channel "$SLACK_CHANNEL" \
147151
--arg slack_thread_ts "$SLACK_THREAD_TS" \
148-
'{prompt: $prompt, user: $user, repo: $repo, run_url: $run_url, link: $link, slack_channel: $slack_channel, slack_thread_ts: $slack_thread_ts}
152+
--arg mode "$CLAUDEBOX_MODE" \
153+
'{prompt: $prompt, user: $user, repo: $repo, run_url: $run_url, link: $link, slack_channel: $slack_channel, slack_thread_ts: $slack_thread_ts, mode: $mode}
149154
+ (if $comment_id != "" then {comment_id: ($comment_id | tonumber)} else {} end)
150155
+ (if $run_comment_id != "" then {run_comment_id: ($run_comment_id | tonumber)} else {} end)')
151156
@@ -203,6 +208,7 @@ jobs:
203208
RUN_COMMENT_ID: ${{ steps.status_comment.outputs.run_comment_id || '' }}
204209
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
205210
REPO: ${{ github.repository }}
211+
CLAUDEBOX_MODE: ${{ vars.CLAUDEBOX_MODE || 'public' }}
206212
run: |
207213
if [ -z "${CLAUDEBOX_API_SECRET:-}" ]; then
208214
echo "ERROR: CLAUDEBOX_API_SECRET is not set; cannot dispatch ClaudeBox v2"
@@ -226,7 +232,8 @@ jobs:
226232
--arg repo "$REPO" \
227233
--arg run_url "$RUN_URL" \
228234
--arg link "$PR_URL" \
229-
'{prompt: $prompt, user: $user, repo: $repo, run_url: $run_url, link: $link}
235+
--arg mode "$CLAUDEBOX_MODE" \
236+
'{prompt: $prompt, user: $user, repo: $repo, run_url: $run_url, link: $link, mode: $mode}
230237
+ (if $run_comment_id != "" then {run_comment_id: ($run_comment_id | tonumber)} else {} end)')
231238
232239
RESPONSE=$(curl -sS -w "\n%{http_code}" \

0 commit comments

Comments
 (0)