Studio: fix edit/run UI and write worldbook on advance (R6)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 22:46:28 +08:00
parent 63a32bfa7c
commit 5bfe7a733f
7 changed files with 185 additions and 154 deletions

View File

@@ -515,7 +515,6 @@ function StudioRunPage() {
const [chatInput, setChatInput] = useState('');
const [streamOutput, setStreamOutput] = useState(false);
const [toolOptionIndex, setToolOptionIndex] = useState(0);
const [pendingUserText, setPendingUserText] = useState(null);
const [runListExpanded, setRunListExpanded] = useState(false);
const [renamingId, setRenamingId] = useState(null);
const [renameValue, setRenameValue] = useState('');
@@ -534,7 +533,6 @@ function StudioRunPage() {
setRunSessionEntered(false);
setInsertionPopupOpen(false);
setContextBlockPopup(null);
setPendingUserText(null);
}, [currentRunId, runProjectId, setRunSessionEntered]);
const activeNodeState = useMemo(() => {
@@ -621,11 +619,9 @@ function StudioRunPage() {
const handleChatSend = async (text) => {
if (!text || isInitBindActive || !isWorldbookActive || runMessaging) return;
setPendingUserText(text);
setChatInput('');
const run = await sendRunMessage(text, { stream: streamOutput });
setPendingUserText(null);
if (!run) {
/* error surfaced via runError */
}
@@ -649,7 +645,6 @@ function StudioRunPage() {
if (run) {
setChatInput('');
setToolOptionIndex(0);
setPendingUserText(null);
}
};
@@ -864,7 +859,6 @@ function StudioRunPage() {
stepMessages={stepMessages}
thinking={runStreamingThinking ?? lastToolResponse?.thinking}
evaluation={runStreamingThinking ? null : lastToolResponse?.evaluation}
pendingUserText={pendingUserText}
inputValue={chatInput}
onInputChange={setChatInput}
onSend={handleChatSend}