feat: add fork assistant message to new session

Add fork button on assistant messages to start new execution session
Include synthetic meta-instruction when forking to explain context
This commit is contained in:
Bohdan Triapitsyn
2025-12-09 00:40:43 +02:00
parent 96aa5bdd18
commit 2779e19103
13 changed files with 937 additions and 46 deletions
+8
View File
@@ -354,6 +354,7 @@ class OpencodeService {
providerID: string;
modelID: string;
text: string;
prefaceText?: string;
agent?: string;
files?: Array<{
type: 'file';
@@ -372,6 +373,13 @@ class OpencodeService {
// Build parts array using SDK types (TextPartInput | FilePartInput) plus lightweight agent parts
const parts: Array<TextPartInput | FilePartInput | AgentPartInputLite> = [];
if (params.prefaceText && params.prefaceText.trim()) {
parts.push({
type: 'text',
text: params.prefaceText
});
}
// Add text part if there's content
if (params.text && params.text.trim()) {
const textPart: TextPartInput = {