stability: fail fast with clear error when host/token are unset #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
cmd/cmd.godefaultsGITEA_HOSTtohttps://gitea.comand treats an emptyGITEA_ACCESS_TOKENas "use Authorization header per request". This is fine for HTTP mode, but in stdio mode a missing token surfaces as opaque 401 errors on every tool call — the user has no idea they forgot the env var.Suggested direction
Execute(), validate that, in stdio mode, a token is set via flag or env. If not, print a one-line setup hint and exit 1 before tool registration.Infoline at startup describing the auth precedence (header > flag > env) so operators can confirm their setup.