Skip to content

Commit f0301c9

Browse files
Fix all lint errors with minimal changes
1 parent 8e08e91 commit f0301c9

6 files changed

Lines changed: 36 additions & 3 deletions

File tree

src/bot/agents/command_center_agent.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,15 @@ async def get_agent_response(self, message: discord.Message, thread: discord.Thr
121121
"""
122122
Send the user's request to Gemini with automatic function‐calling.
123123
124-
then returns a tuple of:
125-
1) the assistant's final text
126-
2) a list of all actions taken, e.g. [{"name": ..., "args": ...}, {"tool": ..., "result": ...}, ...]
124+
Args:
125+
message (discord.Message): The user's message to the agent.
126+
thread (discord.Thread): The thread where the conversation is happening.
127+
128+
Returns:
129+
tuple[str, list[dict]]: A tuple of:
130+
1) the assistant's final text
131+
2) a list of all actions taken, e.g. [{"name": ..., "args": ...}, {"tool": ..., "result": ...}, ...]
132+
127133
"""
128134
async with streamablehttp_client(command_center_config.mcp_server_url, headers=self.headers) as (
129135
read_stream,
@@ -173,6 +179,9 @@ async def _get_thread_history(self, thread: discord.Thread) -> list[dict]:
173179
Args:
174180
thread: The thread to get history for.
175181
182+
Returns:
183+
list[dict]: A list of dictionaries representing the message history.
184+
176185
"""
177186
history = []
178187
async for msg in thread.history(limit=command_center_config.agent_history_size):

src/bot/agents/tools/restart_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ async def restart_service(service_name: str) -> Dict:
2727
Args:
2828
service_name (str): The name of the service to restart.
2929
30+
Returns:
31+
Dict: A dictionary containing the result of the operation.
32+
3033
"""
3134
async with streamablehttp_client(command_center_config.mcp_server_url, headers=headers) as (
3235
read_stream,

src/bot/agents/tools/trigger_user.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ async def trigger_user(message: str) -> Dict:
2727
Args:
2828
message (str): The message to send to user.
2929
30+
Returns:
31+
Dict: A dictionary containing the result of the operation.
32+
3033
"""
3134
async with streamablehttp_client(command_center_config.mcp_server_url, headers=headers) as (
3235
read_stream,

src/bot/cogs/command_center.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ def cog_unload(self):
4949
async def on_message(self, message: discord.Message):
5050
"""
5151
Trigger MCP logic when a message is sent in the command center channel and the bot is mentioned.
52+
53+
Args:
54+
message (discord.Message): The message that triggered the event.
55+
5256
"""
5357
# Ignore bot's own messages
5458
if message.author.bot:

src/bot/core/command_center.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
async def handle_webhook_input(bot: commands.Bot, channel: discord.TextChannel, data: dict):
2222
"""
2323
Entry point for webhook sent to the command center.
24+
25+
Args:
26+
bot (commands.Bot): The Discord bot instance.
27+
channel (discord.TextChannel): The channel to send messages to.
28+
data (dict): The webhook data.
29+
2430
"""
2531
if data.get("type", "").lower() == "service_down":
2632
msg = await channel.send(

src/bot/prompt_loaders/mcp.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class McpPromptLoader:
2323
def load_prompts(prompts: List[Prompt]):
2424
"""
2525
Register all prompt callbacks/views.
26+
27+
Args:
28+
prompts (List[Prompt]): A list of prompts to be loaded.
29+
2630
"""
2731
# register callbacks
2832
for prompt in prompts:
@@ -32,6 +36,10 @@ def load_prompts(prompts: List[Prompt]):
3236
def unload_prompts(prompts: List[Prompt]):
3337
"""
3438
Unregister all prompt callbacks/views.
39+
40+
Args:
41+
prompts (List[Prompt]): A list of prompts to be unloaded.
42+
3543
"""
3644
# unregister callbacks
3745
for prompt in prompts:

0 commit comments

Comments
 (0)