Skip to content

Commit 5d4ead7

Browse files
committed
added placeholder _handle_commands
1 parent 4c2ec95 commit 5d4ead7

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

codetide/agents/tide/agent.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,9 @@ def _(event):
169169
# This can happen if the event loop is shut down
170170
pass
171171
finally:
172-
_logger.logger.info("Exited by user. Goodbye!")
172+
_logger.logger.info("Exited by user. Goodbye!")
173+
174+
async def _handle_commands(self, command :str):
175+
# TODO add logic here to handlle git command, i.e stage files, write commit messages and checkout
176+
# expand to support new branches
177+
pass

codetide/agents/tide/ui/agent_tide_ui.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,7 @@ def settings(self):
126126
)
127127
]
128128

129-
def get_command_prompt(self, command :str)->Optional[str]:
130-
return self.commands_prompts.get(command)
129+
async def get_command_prompt(self, command :str)->Optional[str]:
130+
await self.agent_tide._handle_commands(command)
131+
132+
return self.commands_prompts.get(command)

codetide/agents/tide/ui/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ async def agent_loop(message: cl.Message, codeIdentifiers: Optional[list] = None
240240
chat_history = cl.user_session.get("chat_history")
241241

242242
if message.command:
243-
command_prompt = agent_tide_ui.get_command_prompt(message.command)
243+
command_prompt = await agent_tide_ui.get_command_prompt(message.command)
244244
if command_prompt:
245245
message.content = "\n\n---\n\n".join([command_prompt, message.content])
246246

examples/hf_demo_space/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ async def agent_loop(message: cl.Message, codeIdentifiers: Optional[list] = None
255255
chat_history = cl.user_session.get("chat_history")
256256

257257
if message.command:
258-
command_prompt = agent_tide_ui.get_command_prompt(message.command)
258+
command_prompt = await agent_tide_ui.get_command_prompt(message.command)
259259
if command_prompt:
260260
message.content = "\n\n---\n\n".join([command_prompt, message.content])
261261

0 commit comments

Comments
 (0)