Class GitLabBotIdentityResolver

java.lang.Object
io.agentscope.extensions.channel.gitlab.GitLabBotIdentityResolver

public final class GitLabBotIdentityResolver extends Object
Resolves the bot's GitLab user id (and username) for the configured token by calling GET /user. Used for bot-loop self-detection — when a Note Hook is fired by the bot itself, the channel must drop it to avoid infinite loops.
  • Constructor Details

    • GitLabBotIdentityResolver

      public GitLabBotIdentityResolver(String apiBase, String token)
  • Method Details

    • refresh

      public void refresh()
      Synchronously attempts to resolve GET /user and cache the response. Errors are logged at WARN; startup continues.
    • botUserId

      public long botUserId()
      Returns the bot's numeric user id, or -1 if unresolved.
    • botUsername

      public String botUsername()
      Returns the bot's username, or null if unresolved.