From 7b662d2494294bb1b25a92ca9400cb5c8586f778 Mon Sep 17 00:00:00 2001 From: rabbitblood Date: Fri, 24 Apr 2026 00:34:21 -0700 Subject: [PATCH] =?UTF-8?q?ci(gh-wrapper):=20translate=20--assignee=20@me?= =?UTF-8?q?=20=E2=86=92=20--label=20team:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1957. All agents share one PAT, so `gh issue create --assignee @me` resolves to the CEO. Today's "6 issues @me for 7 cycles" defect signal turned out to be CEO-load misclassified as team-stagnation. Translation rules: - `--assignee @me` → `--label team:` - `--reviewer @me` → dropped (review-bot scans labels, not requests) - `--assignee user` (real user) → unchanged role-slug derived from GIT_AUTHOR_NAME ("Molecule AI Core-BE" → "core-be"). The wrapper already handled the title-prefix + body-footer transforms; these are just two more cases in the existing arg-walk loop. Backward compat: any agent prompt that doesn't use @me passes through unchanged. Agents don't need prompt updates — the wrapper is transparent. Co-Authored-By: Claude Opus 4.7 (1M context) --- workspace/scripts/gh-wrapper.sh | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/workspace/scripts/gh-wrapper.sh b/workspace/scripts/gh-wrapper.sh index c6d872fe..48438916 100644 --- a/workspace/scripts/gh-wrapper.sh +++ b/workspace/scripts/gh-wrapper.sh @@ -122,6 +122,50 @@ _Opened by: Molecule AI ${role}_") i=$((i + 1)) continue ;; + # Identity translation (#1957). All agents share one PAT, so + # `gh ... --assignee @me` resolves to the CEO and lands every + # agent-filed issue/PR on the human's plate. Translate to a + # role-tagged label instead — labels are the right abstraction + # for "this team owns it" in a multi-agent fleet. + # + # Reviewer requests are dropped: the review-bot scans by label, + # not by direct request, so --reviewer @me is just noise. + --assignee) + next_i=$((i + 1)) + val="${!next_i:-}" + if [[ "$val" == "@me" ]]; then + # Translate: drop --assignee, add --label team: + slug=$(echo "$role" | tr '[:upper:] ' '[:lower:]-') + new_args+=(--label "team:${slug}") + else + new_args+=("$arg" "$val") + fi + i=$((i + 2)) + continue + ;; + --assignee=@me) + slug=$(echo "$role" | tr '[:upper:] ' '[:lower:]-') + new_args+=(--label "team:${slug}") + i=$((i + 1)) + continue + ;; + --reviewer) + next_i=$((i + 1)) + val="${!next_i:-}" + if [[ "$val" == "@me" ]]; then + # Drop entirely — review-bot picks up via label scan + : # no-op + else + new_args+=("$arg" "$val") + fi + i=$((i + 2)) + continue + ;; + --reviewer=@me) + # Drop entirely + i=$((i + 1)) + continue + ;; *) new_args+=("$arg") i=$((i + 1))