feat: add dialog for "Start new session from this answer" (#1501)
* feat: add dialog for "Start new session from this answer" Replace the one-click fork action on assistant messages with a dialog (ForkSessionDialog) that lets the user pick model, thinking level, and agent, plus edit the instructions sent to the new session. The instructions field is prefilled with the previous fixed fork prompt and is mandatory. The composed message is now fully visible (no synthetic preface): the user's instructions sit above a short fixed connective that opens the assistant content. createSessionFromAssistantMessage takes the chosen execution params instead of reading from config. Also fix TodoSendDialog visuals: narrower vertical layout, model trigger no longer stretches with centered text, and the agent/thinking dropdowns portal to body so opening them no longer nudges the dialog height. Extract the shared ThinkingPill into its own component. * fix: address review feedback on fork session dialog - Fix "bellow" -> "below" typo in the fork content preface (now user-visible since the message is no longer synthetic) - Reset ForkSessionDialog state only on open transition, reading the config store snapshot via getState() so background store refreshes can't discard in-progress instruction edits
This commit is contained in:
committed by
GitHub
parent
aefbdbc52f
commit
6a88cd09cc
@@ -14,3 +14,25 @@ export const MULTIRUN_EXECUTION_FORK_PROMPT_META_TEXT =
|
||||
|
||||
export const isExecutionForkMetaText = (text: string | null | undefined): boolean =>
|
||||
typeof text === 'string' && text.trim() === EXECUTION_FORK_META_TEXT.trim();
|
||||
|
||||
// Default, user-editable instructions prefilled in the "Start new session from
|
||||
// this answer" dialog. Mirrors the previous fixed fork instruction so existing
|
||||
// behavior is preserved unless the user edits it.
|
||||
export const EXECUTION_FORK_DEFAULT_INSTRUCTIONS =
|
||||
"I want you to respond according to the content of message I share: " +
|
||||
"if it is an implementation plan, your task is to implement that plan; " +
|
||||
"if it is a conclusion or summary, your task is to verify it, explain whether you agree or disagree, and correct it if needed. " +
|
||||
"Always clearly state what you understand your task to be, and wait for the user's approval of your conclusions before taking any further actions.";
|
||||
|
||||
// Fixed connective that opens the forked assistant content. Not editable by the
|
||||
// user — it sits between the user's instructions and the assistant message.
|
||||
export const EXECUTION_FORK_CONTENT_PREFACE =
|
||||
"This message below comes from an AI agent in another session. Here is the content of the message:";
|
||||
|
||||
// Builds the final message sent to the new session:
|
||||
// <user instructions>
|
||||
//
|
||||
// This message below comes from an AI agent in another session. Here is the content of the message:
|
||||
// <assistant content>
|
||||
export const composeForkSessionMessage = (instructions: string, assistantContent: string): string =>
|
||||
`${instructions.trim()}\n\n${EXECUTION_FORK_CONTENT_PREFACE}\n${assistantContent}`;
|
||||
|
||||
Reference in New Issue
Block a user