sessions: a pasted image lands in the session directory, and the notice says where
An image pasted into the chat lived only in the transcript. The system prompt of
every session names `session_files/<id>/` as the place its files live, so an agent
looking for "the attached images" went there, found nothing, and spent turns on
fruitless `find` calls before giving up.

Now the agent's non-hidden turn writes each pasted image into that directory as
`image_N.<ext>` — the extension sniffed from the bytes, the bytes stored as they
arrived, so a PNG keeps its alpha channel. Numbering runs across the session, and
a picture sent twice reuses the file already holding it.

The paths go into the hidden context copy of the message: images past the context
budget are not sent to the model at all, so the notice names them for `image_view`
instead. The line is written by the agent rather than the websocket handler, which
is the layer that knows the names the files actually took — including for a message
queued behind a running turn.

A save that fails is logged and skipped: it never costs the turn.
1 parent 02f5ac8 commit 03a8f3889969dcce3dc44e72a5d428a6c9805cfa
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 8 hours ago
Showing 8 changed files
View
docs/api.md
View
docs/sessions.md
View
manuals/filesystem.md
View
navi/api/websocket.py
View
navi/core/agent.py
View
navi/session_files.py
View
tests/unit/api/test_session_files.py
View
tests/unit/core/test_agent.py