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:
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user