mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-19 18:35:18 +02:00
implement run creation and title cleaning for message display
This commit is contained in:
parent
2683d4e371
commit
96d66a9f10
4 changed files with 34 additions and 12 deletions
|
|
@ -918,14 +918,14 @@ function App() {
|
|||
|
||||
try {
|
||||
let currentRunId = runId
|
||||
let isNewRun = false
|
||||
if (!currentRunId) {
|
||||
const run = await window.ipc.invoke('runs:create', {
|
||||
agentId,
|
||||
})
|
||||
currentRunId = run.id
|
||||
setRunId(currentRunId)
|
||||
// Refresh runs list to include new run
|
||||
loadRuns()
|
||||
isNewRun = true
|
||||
}
|
||||
|
||||
// Read mentioned file contents and format message with XML context
|
||||
|
|
@ -955,6 +955,11 @@ function App() {
|
|||
runId: currentRunId,
|
||||
message: formattedMessage,
|
||||
})
|
||||
|
||||
// Refresh runs list after message is sent (so title is available)
|
||||
if (isNewRun) {
|
||||
loadRuns()
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to send message:', error)
|
||||
}
|
||||
|
|
@ -1540,7 +1545,7 @@ function App() {
|
|||
<AskHumanRequest
|
||||
key={request.toolCallId}
|
||||
query={request.query}
|
||||
onSubmit={(response) => handleAskHumanResponse(request.toolCallId, request.subflow, response)}
|
||||
onResponse={(response) => handleAskHumanResponse(request.toolCallId, request.subflow, response)}
|
||||
isProcessing={isProcessing}
|
||||
/>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import { useState, useRef, useEffect } from "react";
|
|||
|
||||
export type AskHumanRequestProps = ComponentProps<"div"> & {
|
||||
query: string;
|
||||
onSubmit: (response: string) => void;
|
||||
onResponse: (response: string) => void;
|
||||
isProcessing?: boolean;
|
||||
};
|
||||
|
||||
export const AskHumanRequest = ({
|
||||
className,
|
||||
query,
|
||||
onSubmit,
|
||||
onResponse,
|
||||
isProcessing = false,
|
||||
...props
|
||||
}: AskHumanRequestProps) => {
|
||||
|
|
@ -31,7 +31,7 @@ export const AskHumanRequest = ({
|
|||
const handleSubmit = () => {
|
||||
const trimmed = response.trim();
|
||||
if (trimmed && !isProcessing) {
|
||||
onSubmit(trimmed);
|
||||
onResponse(trimmed);
|
||||
setResponse("");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ export function ChatSidebar({
|
|||
<AskHumanRequest
|
||||
key={request.toolCallId}
|
||||
query={request.query}
|
||||
onSubmit={(response) => onAskHumanResponse(request.toolCallId, request.subflow, response)}
|
||||
onResponse={(response) => onAskHumanResponse(request.toolCallId, request.subflow, response)}
|
||||
isProcessing={isProcessing}
|
||||
/>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue