refactor: extract hardcoded values to config (section 5.3)

- Add AGENT_USERNAMES and GITEA_ORG_FILTER settings to gitea/config.py
- Update core/dispatcher.py to use AGENT_USERNAMES from config
- Update gitea/client.py to use GITEA_ORG_FILTER in list_all_user_repos() and list_unread_notifications()
This commit is contained in:
meeks
2026-07-16 13:54:52 +02:00
parent 9b63fbbcfc
commit 2ab87d507f
3 changed files with 115 additions and 41 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ from gitea.tools.git_tools import GitTools
from gitea.client import GiteaClient
from core.coordinator_tools import CoordinatorTools
from gitea.workspace import WorkspaceManager
from gitea.config import AGENT_MODEL_ID
from gitea.config import AGENT_MODEL_ID, AGENT_USERNAMES
from gitea.models import (
CommentModel,
PullRequestFileModel,
@@ -79,7 +79,7 @@ def _is_awaiting_reply_helper(comments: list[CommentModel], ai_username: str) ->
return False
# Find the last agent comment index
last_agent_idx: int = -1
agent_usernames = {ai_username, "agent-bot"}
agent_usernames = {ai_username, *AGENT_USERNAMES}
for i, c in enumerate(comments):
if c.user and c.user.login in agent_usernames:
last_agent_idx = i