Repository navigation
Description
Part of #754, and follows on from #819. The office was restarted with zsh ~/office-as-bot-754.sh, but its workers still act as QuinnsCode on GitHub: #936 and #939 were both opened and merged as QuinnsCode.
What a worker sees (checked 12 Oct)
- The script's git settings are in effect: the keychain helper is cleared and
!gh auth git-credentialis set. GH_TOKENreaches the workers, but it is empty.gh auth statussaysLogged in … QuinnsCode (keyring). An emptyGH_TOKENmakes gh fall back to the owner's keyring login, and git pushes go through gh as well.
Why the script didn't stop
Line 9 is export GH_TOKEN=$(op read …). When the command runs inside export, the line reports export's exit status (success), so set -e never saw op read fail. The script went on with an empty token, printed GitHub as: QuinnsCode, and started the office anyway. Why op read came back empty isn't known yet. It could have been a dismissed Touch ID prompt, or the item may not be at op://codesplitter/github-bot/token. #754 still names it codesplitters/github-bot, from before the vault rename (#824).
Steps (owner)
- Replace
~/office-as-bot-754.shwith the version below. It stops ifop readfails or returns nothing, and it won't start the office unless gh saysquinnscode-bot. Replacing the file is safe at any time, because nothing reads it until the next restart. - Wait until no worker is mid-task: nothing uncommitted, and nothing left unpushed. Restarting the office ends every session.
- Stop the office, then start it again from
apps/agent-officewithzsh ~/office-as-bot-754.sh. If it stops with "op read failed", check that the 1Password item is atcodesplitter/github-botand has atokenfield. - Check that a new worker's
gh api user --jq .loginprintsquinnscode-bot. Then carry on with MANUAL RUN: restart Agent Office as quinnscode-bot (#754 step 2) #819 (the ruleset PR, written by the bot).
Fixed ~/office-as-bot-754.sh
#!/bin/zsh
# #754: start Agent Office with its workers acting as quinnscode-bot on GitHub (Write, not Admin).
# Run it where you'd run `bun run office` (apps/agent-office), instead of that command:
# zsh ~/office-as-bot-754.sh
set -euo pipefail
export PATH=/opt/homebrew/bin:$PATH
# The bot's classic token (repo + workflow), from 1Password behind Touch ID. Never printed.
# Assign first, export after: `export X=$(cmd)` hides cmd's failure from set -e, and an empty
# GH_TOKEN makes gh fall back to your keyring login, so the whole office ran as QuinnsCode.
token=$(op read "op://codesplitter/github-bot/token") || { echo "op read failed: is the item at op://codesplitter/github-bot/token?" >&2; exit 1; }
[[ -n $token ]] || { echo "op read returned an empty token" >&2; exit 1; }
export GH_TOKEN=$token
unset token
# live/env.ts drops *_TOKEN names from workers; let this one through, since it is the agents' own identity.
export AGENT_OFFICE_ENV_PASS=GH_TOKEN
# git push uses the macOS keychain (your login) by default. For this office and its workers only:
# clear that helper, and let gh answer for github.com with GH_TOKEN instead.
export GIT_CONFIG_COUNT=2
export GIT_CONFIG_KEY_0=credential.helper GIT_CONFIG_VALUE_0=
export GIT_CONFIG_KEY_1=credential.https://git.lvmhsh.cn.helper GIT_CONFIG_VALUE_1='!gh auth git-credential'
login=$(gh api user --jq .login)
echo "GitHub as: $login"
[[ $login == quinnscode-bot ]] || { echo "expected quinnscode-bot, got $login: not starting the office" >&2; exit 1; }
exec bun run office
Activity
QuinnsCode commentedon Oct 14, 2026
Folded into the one manual-run list, section 9 of #609 (easiest first, with times). This issue's steps stay here; tick the item in #609.