Class GitHubBotIdentityResolver
java.lang.Object
io.agentscope.extensions.channel.github.GitHubBotIdentityResolver
Resolves the bot's GitHub user id (and login) for the configured PAT by calling
GET /user. Used for bot-loop self-detection in the webhook handler — when a
webhook delivers a comment authored by the bot itself, the channel must drop it instead of
looping forever.
The lookup is best-effort: a network failure does not block startup. The resolved id is
cached for the lifetime of the channel and accessed via botUserId().
-
Constructor Summary
ConstructorsConstructorDescriptionGitHubBotIdentityResolver(String apiBase, String token, String botLoginOverride) -
Method Summary
-
Constructor Details
-
GitHubBotIdentityResolver
-
-
Method Details
-
refresh
public void refresh()Synchronously attempts to resolveGET /userand cache the response. Errors are logged at WARN; startup continues. -
botUserId
public long botUserId()Returns the bot's numeric user id, or-1if unresolved. -
botLogin
Returns the bot's login (handle), or null if unresolved.
-