Session events and projections
DataMind Oda keeps a chat's lasting state inside the chat itself. Plan mode, the preset the chat runs under, its file policy and its link to a scheduled run are recorded as small events in the chat's own log, and Oda reads them back into current values, the projections, whenever it needs to show or continue the chat. This page is written for people who support chats or inspect session logs. It describes what each part records, and what a chat rebuilds when it is reopened. For the log itself, see Chat log format.
What a chat records, and what it reads back
- An event is one note a chat writes into its own log. The events on this page are not chat messages: nothing you read in the conversation is one of them.
- A projection is a small current value built from a chat's events, such as whether plan mode is on or which preset the chat runs. Oda shows the chat's state from these values instead of replaying every event each time.
- Each chat keeps its own values. None of them is shared between chats.
- Some of these values are whole-value records: a new record replaces the previous one, so the newest recorded value is the one in effect.
Rebuilding a chat's state
Oda rebuilds these values from the chat's own events whenever it reads the chat again:
- when the chat is reopened, for example after Oda restarts;
- when a fork or a helper chat inherits the chat's events;
- when a long conversation is compacted and its record is read again; compacting changes what is sent to the model, not what the chat records.
A rebuild reads the events in order, so the value that last took effect wins.
Plan mode
- Plan mode is recorded as one whole value per chat: each switch, on or off, replaces it, and with no record the mode reads as off.
- Where the value is read, it has two parts: the mode the chat is in, and a change that is pending, meaning a switch that has been asked for and has not taken effect yet.
- A switch made while Oda is idle lands at once; while a step is running, the step finishes as it is and the switch applies from Oda's next step. A switch never changes a step that is already being put together.
- The value is rebuilt from the chat's own events, so it survives restarts and reads the same in every tab. Entering and leaving plan mode, and reviewing a plan, are covered in Plan mode.
The preset a chat runs under
- A chat records the preset it runs under in its own events. Because the choice can change while the chat is still new, Oda rebuilds the preset from these events rather than from the note made when the chat was started.
- The choice is recorded because it decides what the chat's model was given: the tools and instructions of the chat follow the preset. A rebuilt chat resolves the recorded choice and runs under the same preset again.
- A helper chat joins the exact version of the preset its chat works under; Editing agent presets covers what a preset change applies to. To choose a preset for a new chat, see Presets.
The file policy a chat runs under
- The file policy, the mode that limits the file changes commands may make (Read Only, Workspace Write or Full access), is recorded as one whole value per chat: the newest record is the one in effect, and each chat keeps its own.
- A switch takes effect on the chat's next step that touches files, and the chat reopens in the last value because it is rebuilt from the chat's own events.
- When Oda starts a helper chat with a file policy taken from the chat that started it, the record marks the value as seeded into that helper, not switched inside it.
- The policy in effect is also passed to Oda as one short note while it works: it arrives with the chat's first request, and again whenever the policy changes. The modes and how a chat gets its mode are in Sandbox modes and file policy.
Scheduled-run markers
- A run's chat records one small marker naming the task and the run. The app reads it to show the chat under Scheduled, to list it in the task's run history and to open it from a notification. Runs themselves are covered in Scheduled runs and history.
- Only a marker the chat recorded itself counts. A chat forked from a run keeps the run's events as inherited history, but the inherited marker is skipped, so the fork is an ordinary chat.
Questions, answered
What is a session event, and what is a projection?
An event is one note a chat writes into its own log, like the record of a plan-mode switch or a preset choice. A projection is a small current value Oda builds from those events, such as whether plan mode is on, which preset the chat runs or whether the chat belongs to a scheduled run; Oda shows the chat's state from the projection instead of replaying every event each time.
Where do a chat's plan mode, preset and file policy live?
In the chat itself. Each of them is recorded as events inside the chat's own log on your computer, and each chat keeps its own values. For the log files themselves, see Chat logs on disk.
How does Oda rebuild these values when a chat is reopened?
From the chat's own events, read in order so the value that last took effect wins. A reopened chat continues with the same plan mode, the same preset and the same file policy; forked and helper chats are rebuilt from the events they carry the same way.
What wins when the same setting was changed more than once?
The newest value. These are whole-value records: a new record replaces the previous one instead of adding to it, so the value that last took effect is the one in force.
What does it mean that a plan-mode change is still pending?
You asked for a switch, and it has not taken effect yet. With Oda idle, the switch lands at once; while a step is running, the step finishes as it is and the switch applies from Oda's next step. Until it lands, the chat's state reads as two parts: the mode in effect and the pending change.
How does Oda know a chat is a scheduled run?
The run's chat records a small marker naming the task and the run. The app reads it to show the chat under Scheduled, list it in the task's run history and open it from a notification. See Scheduled runs and history.
Is a chat forked from a run still shown as a run?
No. The marker counts only in the chat that recorded it. A fork keeps the run's events as inherited history, but the inherited marker is skipped, so the fork is an ordinary chat.
Do these records appear in the conversation?
No. They are notes the chat keeps for itself, not messages. Where a feature adds a notice of its own, such as plan mode's switch notice, that notice is a separate message; the feature's page covers it.
Why does Oda not simply use the preset noted when the chat was started?
Because the choice can change while the chat is still new, so the note from the start may not match what the chat actually ran under. Oda rebuilds the preset from the chat's own selection records instead, and the chat runs under the rebuilt choice.