Skip to content

Commit 8b550d0

Browse files
committed
refactor: cleanup more naming
1 parent dd37109 commit 8b550d0

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

docs/architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Routes messages from the AgentLoop to appropriate UI components:
7575

7676
**Actions** (`core/actions.py`)
7777
User-initiated action handlers:
78-
- `submit_user_message()`: Posts user message and queries agent
78+
- `post_user_message()`: Posts user message and queries agent
7979
- `interrupt()`: Cancels current agent operation
8080
- `new()`: Starts new conversation, clears history
8181
- `respond_to_tool_permission()`: Handles permission prompt responses
@@ -90,7 +90,7 @@ Manages the Claude Agent SDK client lifecycle:
9090
### Message Flow
9191

9292
1. User types in `UserInput` and presses Enter
93-
2. `Actions.submit_user_message()` posts to UI and enqueues to `AgentLoop.query_queue`
93+
2. `Actions.post_user_message()` posts to UI and enqueues to `AgentLoop.query_queue`
9494
3. `AgentLoop` sends query to Claude Agent SDK and streams responses
9595
4. Responses flow through `Actions.render_message()` to update UI
9696
5. Tool use triggers permission prompt via `UIState.show_permission_prompt()`

src/agent_chat_cli/components/user_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ async def action_submit(self) -> None:
120120
return
121121

122122
input_widget.clear()
123-
await self.actions.submit_user_message(user_message)
123+
await self.actions.post_user_message(user_message)

src/agent_chat_cli/core/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, app: "AgentChatCLIApp") -> None:
1717
def quit(self) -> None:
1818
self.app.exit()
1919

20-
async def submit_user_message(self, message: str) -> None:
20+
async def post_user_message(self, message: str) -> None:
2121
await self.app.renderer.add_message(RoleType.USER, message)
2222
await self._query(message)
2323

@@ -64,7 +64,7 @@ async def respond_to_tool_permission(self, response: str) -> None:
6464
if normalized in ["n", "no", "deny"]:
6565
await self._query("The user has denied the tool")
6666
else:
67-
await self.submit_user_message(response)
67+
await self.post_user_message(response)
6868

6969
async def _query(self, user_input: str) -> None:
7070
await self.app.agent_loop.query_queue.put(user_input)

tests/components/test_user_input.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self):
1616
self.mock_actions.interrupt = AsyncMock()
1717
self.mock_actions.new = AsyncMock()
1818
self.mock_actions.clear = AsyncMock()
19-
self.mock_actions.submit_user_message = AsyncMock()
19+
self.mock_actions.post_user_message = AsyncMock()
2020

2121
def compose(self) -> ComposeResult:
2222
yield UserInput(actions=self.mock_actions)
@@ -31,7 +31,7 @@ async def test_empty_submit_does_nothing(self, app):
3131
async with app.run_test() as pilot:
3232
await pilot.press("enter")
3333

34-
app.mock_actions.submit_user_message.assert_not_called()
34+
app.mock_actions.post_user_message.assert_not_called()
3535

3636
async def test_submits_message(self, app):
3737
async with app.run_test() as pilot:
@@ -41,7 +41,7 @@ async def test_submits_message(self, app):
4141

4242
await pilot.press("enter")
4343

44-
app.mock_actions.submit_user_message.assert_called_with("Hello agent")
44+
app.mock_actions.post_user_message.assert_called_with("Hello agent")
4545

4646
async def test_clears_input_after_submit(self, app):
4747
async with app.run_test() as pilot:

tests/core/test_actions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async def test_adds_user_message_to_chat(self, mock_agent_loop, mock_config):
9696
async with app.run_test():
9797
chat_history = app.query_one(ChatHistory)
9898

99-
await app.actions.submit_user_message("Hello agent")
99+
await app.actions.post_user_message("Hello agent")
100100

101101
widgets = chat_history.query(UserMessage)
102102
assert len(widgets) == 1
@@ -107,15 +107,15 @@ async def test_starts_thinking_indicator(self, mock_agent_loop, mock_config):
107107

108108
app = AgentChatCLIApp()
109109
async with app.run_test():
110-
await app.actions.submit_user_message("Hello agent")
110+
await app.actions.post_user_message("Hello agent")
111111

112112
thinking_indicator = app.query_one(ThinkingIndicator)
113113
assert thinking_indicator.is_thinking is True
114114

115115
async def test_queues_message_to_agent_loop(self, mock_agent_loop, mock_config):
116116
app = AgentChatCLIApp()
117117
async with app.run_test():
118-
await app.actions.submit_user_message("Hello agent")
118+
await app.actions.post_user_message("Hello agent")
119119

120120
mock_agent_loop.query_queue.put.assert_called_with("Hello agent")
121121

0 commit comments

Comments
 (0)