Skip to content

Commit 867166f

Browse files
committed
Add user_id parameter to message handlers
Updated handle_agent_messages and handle_human_clarification in PlanService to accept a user_id parameter for improved context handling. Also reformatted ReactMarkdown components prop in StreamingBufferMessage.tsx for better readability.
1 parent 3c72b0d commit 867166f

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/backend/v3/common/services/plan_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async def handle_plan_approval(human_feedback: messages.PlanApprovalResponse, us
7676
return True
7777

7878
@staticmethod
79-
async def handle_agent_messages(standard_message: messages.AgentMessage) -> bool:
79+
async def handle_agent_messages(standard_message: messages.AgentMessage, user_id: str) -> bool:
8080
"""
8181
Process an AgentMessage coming from the client.
8282
@@ -93,7 +93,7 @@ async def handle_agent_messages(standard_message: messages.AgentMessage) -> bool
9393
return True
9494

9595
@staticmethod
96-
async def handle_human_clarification(human_feedback: messages.UserClarificationResponse) -> bool:
96+
async def handle_human_clarification(human_feedback: messages.UserClarificationResponse, user_id: str) -> bool:
9797
"""
9898
Process a UserClarificationResponse coming from the client.
9999

src/frontend/src/components/content/streaming/StreamingBufferMessage.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import rehypePrism from "rehype-prism";
99

1010
const renderBufferMessage = (streamingMessageBuffer: string) => {
1111
const [isExpanded, setIsExpanded] = useState<boolean>(false);
12-
// console.log(`streamingMessageBuffer: ${streamingMessageBuffer}`);
12+
1313
if (!streamingMessageBuffer || streamingMessageBuffer.trim() === "") return null;
1414

1515
const start = Math.max(0, streamingMessageBuffer.length - 500);
@@ -98,23 +98,23 @@ const renderBufferMessage = (streamingMessageBuffer: string) => {
9898
<ReactMarkdown
9999
remarkPlugins={[remarkGfm]}
100100
rehypePlugins={[rehypePrism]}
101-
components={{
102-
a: ({ node, ...props }) => (
103-
<a
104-
{...props}
105-
style={{
106-
color: 'var(--colorNeutralBrandForeground1)',
107-
textDecoration: 'none'
108-
}}
109-
onMouseEnter={(e) => {
110-
e.currentTarget.style.textDecoration = 'underline';
111-
}}
112-
onMouseLeave={(e) => {
113-
e.currentTarget.style.textDecoration = 'none';
114-
}}
115-
/>
116-
)
117-
}}
101+
components={{
102+
a: ({ node, ...props }) => (
103+
<a
104+
{...props}
105+
style={{
106+
color: 'var(--colorNeutralBrandForeground1)',
107+
textDecoration: 'none'
108+
}}
109+
onMouseEnter={(e) => {
110+
e.currentTarget.style.textDecoration = 'underline';
111+
}}
112+
onMouseLeave={(e) => {
113+
e.currentTarget.style.textDecoration = 'none';
114+
}}
115+
/>
116+
)
117+
}}
118118
>
119119
{previewText}
120120
</ReactMarkdown>

0 commit comments

Comments
 (0)