GitHub Copilot
| 필수 Secret | 오버레이 |
|---|---|
DISCORD_BOT_TOKEN |
values-github-copilot.yaml |
TELEGRAM_BOT_TOKEN, auth.deviceFlow.notify: telegram과 함께 |
values-github-copilot.yaml에 아래 override를 더함 |
언제 사용하나요?¶
Discord 또는 Telegram bot과 GitHub Copilot 권한이 필요합니다. 영속 볼륨도 활성화해야 로그인 토큰이 재사용됩니다.
Hermes v0.23.0부터 copilot 공급자는
GitHub Copilot Labs 플러그인으로
이동했습니다. Copilot을 선택한 프로필에는 Hermes가 플러그인을 자동으로 설치합니다.
외부 트래픽을 제한한다면 Copilot API뿐 아니라 처음 시작할 때 플러그인 카탈로그와
GitHub 소스에도 접근할 수 있어야 합니다.
config.model.provider: copilot은 그대로 사용하세요. 차트의 기기 로그인은
Hermes 볼륨에 COPILOT_GITHUB_TOKEN을 저장하고, 플러그인도 같은 키를 읽습니다.
다른 머신의 GitHub 또는 Copilot CLI에만 로그인이 저장돼 있다면 차트의 기기
로그인으로 인증하세요.
설치¶
helm upgrade --install hermes-agent ./charts/hermes-agent \
--namespace hermes-agent --create-namespace \
-f charts/hermes-agent/values-github-copilot.yaml \
--set-string env.DISCORD_BOT_TOKEN='<real-value>' --wait
둘 이상의 자격 증명이 필요한 예제에서는 모든 값을 --set-string으로 전달하거나 extraEnvFrom으로 기존 Secret을 참조하세요.
배포 전 조정¶
초기 pod 로그 또는 Discord 안내에 나온 device code를 GitHub에서 승인합니다.
이후 시작¶
토큰은 영속 볼륨의 HERMES_HOME/.env에 저장됩니다. 이후 시작에서는 init container가
https://api.github.com/user로 토큰을 확인하고, 아직 동작하면 로그인을 건너뜁니다.
확인 엔드포인트가 HTTP 401 또는 403을 반환하면 init container가 기기 로그인을 다시
시작합니다. 이 확인은 Copilot 플랜과 무관합니다. 1.18.0까지의 차트는
copilot_internal/v2/token을 확인했는데, Copilot Free 계정에서 유효한 토큰에도
403을 돌려줘서 재시작할 때마다 새 코드를 요구했습니다
(#349). validateUrl을 바꾼다면
사용 가능한 토큰에는 200을, 다시 로그인해야 하는 경우에만 401 또는 403을 반환하는
엔드포인트를 사용하세요.
Discord 대신 Telegram¶
auth.deviceFlow.notify: telegram으로 설정하고, Discord 값 대신 Telegram 봇 토큰과 홈
채널(TELEGRAM_BOT_TOKEN, TELEGRAM_HOME_CHANNEL, TELEGRAM_ALLOWED_USERS)을
릴리스에 주세요. 그러면 코드가 Telegram 채팅으로 오고, readyNotify.enabled: true를 켜면
에이전트가 올라왔을 때 그곳에 한 줄이 옵니다. Copilot Free 계정에서 라이브로 확인했을 때
로그인이 끝났고 준비 알림이 왔으며 gpt-4o로 응답했습니다. 어떤 모델이 되는지는 GitHub
플랜에 따릅니다.
전체 오버레이¶
# values-github-copilot.yaml
#
# Hermes Agent backed by GitHub Copilot, authenticated at startup via the OAuth
# 2.0 Device Authorization Grant (RFC 8628): no API key to paste. The
# "auth-device-login" init container surfaces a verification link + code to your
# Discord home channel (or Telegram: set `auth.deviceFlow.notify: telegram` and
# pass TELEGRAM_BOT_TOKEN, TELEGRAM_HOME_CHANNEL and TELEGRAM_ALLOWED_USERS
# instead of the Discord values), waits for you to approve it on github.com (phone is
# fine), then persists the resulting token to HERMES_HOME/.env where Hermes
# reads it natively. The token lives on the persistent volume, so restarts are
# fast; re-login only happens when it is missing or revoked.
#
# Copilot's token API rejects PATs: a device-flow `gho_`/`ghu_` token is
# required, which is exactly what this flow produces.
#
# All secrets below are DUMMY placeholders. Do NOT commit real keys: override
# them at install time (--set-string) or inject via a SealedSecret + extraEnvFrom
# (see examples/argocd/).
#
# helm upgrade --install hermes-agent ./charts/hermes-agent \
# --namespace hermes-agent --create-namespace \
# -f charts/hermes-agent/values-github-copilot.yaml \
# --set-string env.DISCORD_BOT_TOKEN='<real-bot-token>' --wait
#
# # then watch the login init container for the verification prompt:
# kubectl logs deploy/hermes-agent -n hermes-agent -c auth-device-login -f
config:
model:
# GitHub Copilot provider. Hermes v0.23.0 auto-installs its Labs plugin.
provider: copilot
# Any model your Copilot subscription can reach. Examples: gpt-4o, gpt-4.1,
# claude-sonnet-4.5, gemini-2.5-pro, gpt-5.
default: gpt-4o
terminal:
backend: local
# Authenticate the Copilot credential via the OAuth device flow at startup.
auth:
deviceFlow:
enabled: true
provider: github-copilot
# Deliver the verification link + code to the agent's Discord home channel
# (reuses DISCORD_BOT_TOKEN + DISCORD_HOME_CHANNEL). It is always also
# printed to the init container logs as a fallback.
notify: discord
env:
# The chart's default placeholder is for OpenAI; this deployment doesn't use
# it (the Copilot token is fetched at runtime via device flow). Set to a clear
# sentinel so no real OpenAI key is implied.
OPENAI_API_KEY: "unused"
# --- Discord bot (secret bits) ------------------------------------------
# Setting the token is enough to auto-enable Discord: no config.yaml change.
# The login init container reuses this same bot to post the verification link.
# Create the bot at https://discord.com/developers/applications, enable the
# "Message Content Intent", and invite it to your server.
DISCORD_BOT_TOKEN: "MTA0DUMMYtoken000000000000.DUMMY.replace_me_with_a_real_token"
# Non-secret Discord knobs go here (plain env, not the Secret). The login init
# container also reads DISCORD_HOME_CHANNEL from here to know where to post.
extraEnv:
- name: DISCORD_HOME_CHANNEL # channel id for cron / notification / login delivery
value: "000000000000000000" # DUMMY - your channel id (18 digits)
- name: DISCORD_ALLOWED_USERS # comma-separated user ids allowed to talk
value: "111111111111111111" # DUMMY - your Discord user id
- name: DISCORD_ALLOW_ALL_USERS # true only for throwaway/dev bots
value: "false"
# Persistence is required for device-flow login: the token is written here so it
# survives restarts (otherwise you would re-approve on every restart). Empty
# storageClass = cluster default; on a Raspberry Pi cluster that is typically
# local-path (k3s) or microk8s-hostpath: both ReadWriteOnce, which is exactly
# what this single-writer workload wants.
persistence:
enabled: true
storageClass: ""
accessModes:
- ReadWriteOnce
size: 5Gi
# Defaults are already tuned for small arm64 nodes; shown here for visibility.
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: "1"
memory: 1Gi