Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 59 additions & 29 deletions documentation/docs/guides/sessions/in-session-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,87 @@ goose provides features you can use to manage conversations and share informatio

## Edit Message

Edit your previously sent messages to refine conversations and correct course.
Edit your previously sent messages to refine conversations, correct course, or try different approaches.

Editing any message in the session gives you complete control over the conversation history by overwriting all the context that follows the edited message. Your change can be as simple as fixing a path in your last message or completely starting over from a given point.
**Example Message Flow:**

This is useful when:
Your original conversation has five messages. After editing message 3, all message and response context from messages 4 and 5 is deleted.

```
┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
│ 1 │ → │ 2 │ → │ 3 │ → │ 4 │ → │ 5 │
└─────┘ └─────┘ └─────┘ └─────┘ └─────┘

Edit here
┌─────┐ ┌─────┐ ┌─────┐ continue from here in
│ 1 │ → │ 2 │ → │ 3 │ → current session, or
└─────┘ └─────┘ └─────┘ copy to new session
```

You choose to continue working in the current session or create a fork in a new session:

- [Edit in Place](#edit-in-place) to update the current session and delete all message and response context after the edited message. This lets you start your conversation over from a given point.
- [Fork Session](#fork-session) to create a new session with all conversation history prior to and including the edited message. This lets you explore different approaches while preserving your original conversation.

### Edit in Place

Edit in Place gives you complete control over the conversation history by overwriting all context that follows the edited message. Your change can be as simple as fixing a path in your last message or completely starting over from a given point.

Editing in place is useful when:

- You realize a prompt you sent was unclear or incomplete
- goose misunderstood your intent and went in the wrong direction
- You want to try different approaches to a problem without starting a new session
- goose misunderstood your intent and went in the wrong direction

<Tabs groupId="interface">
<TabItem value="ui" label="goose Desktop" default>

1. Hover over any of your previous messages to reveal the edit button
2. Click the <Edit2 className="inline" size={16} /> edit button that appears
1. Hover over any of your previous messages
2. Click the <Edit2 className="inline" size={16} /> `Edit` button that appears
3. Make your changes in the inline editor
4. Click `Save` to save your changes and reprompt goose (or use `Cmd+Enter` (macOS) or `Ctrl+Enter` (Windows/Linux))
4. Click `Edit in Place` to save your changes and reprompt goose

goose removes all conversation history after the edited message and responds contextually from that point.

:::warning Deleted Context
Subsequent conversation history is permanently deleted from the session and removed from goose's context. Edit a message only if you don't need goose to remember the context that follows it.
With Edit in Place, subsequent conversation history is permanently deleted from the session and removed from goose's context. Use this option only if you don't need goose to remember the context that follows the edited message.
:::

#### Example Message Flow

Your original conversation has five messages. After editing message 3, the conversation continues from that point, and all message and response context from messages 4 and 5 is deleted.
</TabItem>
<TabItem value="cli" label="goose CLI">
Message editing options are not available in the goose CLI.
</TabItem>
</Tabs>

```
┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
│ 1 │ -> │ 2 │ -> │ 3 │ -> │ 4 │ -> │ 5 │
└─────┘ └─────┘ └─────┘ └─────┘ └─────┘

Edit here
┌─────┐ ┌─────┐ ┌─────┐ conversation
│ 1 │ -> │ 2 │ -> │ 3 │ -> continues
└─────┘ └─────┘ └─────┘ from here
```
### Fork Session

#### Editing Scenario Tips

- **Iterative Prompt Refinement**: Start with a basic prompt, then edit and refine based on goose's response. This often works better than trying to craft the perfect prompt from the start.
- **When to Edit vs. Interrupt**: Editing earlier messages when a conversation has gone off track can be more effective than trying to correct course using new messages or [interruptions](#interrupt-task). By editing messages, you rewrite history. With interruptions, you only affect the conversation from the current message onwards.
Fork Session creates a new session with your edited message while preserving the original conversation. You can experiment with variations and compare results while keeping the original session as a reference point.

Forking sessions is useful to:
- Compare different approaches to the same problem side-by-side
- Test how different prompts affect goose's responses

<Tabs groupId="interface">
<TabItem value="ui" label="goose Desktop" default>

1. Hover over any of your previous messages
2. Click the <Edit2 className="inline" size={16} /> `Edit` button that appears
3. Make your changes in the inline editor
4. Click `Fork Session` to save your changes and start a new session (or use `Cmd+Enter` (macOS) or `Ctrl+Enter` (Windows/Linux))

goose copies the conversation history from the original session to the new session. The new session is named "(edited)" and the original session is unchanged.
</TabItem>
<TabItem value="cli" label="goose CLI">
Message editing is not available in the goose CLI.
Message editing options are not available in the goose CLI.
</TabItem>
</Tabs>

### Editing Scenario Tips

- **Iterative Prompt Refinement**: Start with a basic prompt, then edit and refine based on goose's response. This often works better than trying to craft the perfect prompt from the start.
- **When to Edit vs. Interrupt**: Editing earlier messages when a conversation has gone off track can be more effective than trying to correct course using new messages or [interruptions](#interrupt-task). By editing messages, you rewrite history. With interruptions, you only affect the conversation from the current message onwards.
- **Preserving Progress**: Use Fork Session when you've made good progress but want to try a different approach. This way you can always return to the original if the new direction doesn't work out.

## Queue Messages

Queue messages while goose is processing a task to manage your workflow. This is useful when:
Expand Down Expand Up @@ -257,4 +287,4 @@ Provide goose with context from your codebase, documents, and other files to get
Review these test files: ./tests/*.rs
```
</TabItem>
</Tabs>
</Tabs>
Loading