Added
- Auto workspaces and the ingest API, both experimental, import history from another system, such as a chat server or a repository, and model the people in it.
auto: trueonPOST /workspacescreates an auto workspace; only a new workspace can be made auto, and asking for it on an existing workspace that isn't auto is a 409.POST /workspaces/{workspace_id}/ingesttakes up to 100 source records per request, each with its source identity, container, author and participants, creates the sessions, peers and messages they map to, and reports each record as created, duplicate or rejected, so an import can be sent again safely. Records sent withderive: "later"are stored without being derived untilPOST /workspaces/{workspace_id}/ingest/derivereleases them.GET .../ingest/status,.../ingest/peopleand.../ingest/sessionsshow what an import became before it is derived, andPOST .../ingest/link,.../ingest/unlinkand.../ingest/resetmerge one person's several accounts and start an import over. Nothing is derived about people marked as bots, and imported history is summarized once rather than at every interval. The record format is published as a JSON Schema,docs/schemas/ingest-record.v0.json. Migration7dbf160eb7c9adds the ingest tables andworkspaces.auto_enabled_at. Ingest may change or stop working without notice (#1584, #1587, #1588, #1593, #1606, #1608, #1622) - A webhook endpoint can subscribe to event types. Registering an endpoint accepts
event_types, and delivery sends it only those types. Without a list it receives every type, so existing endpoints are unchanged. Registering a URL that already exists withevent_typesset replaces its list,nullresets it to every type, and leaving the field out keeps it as it is.test.eventreaches every endpoint and can't be subscribed to. An empty list or an unknown type is a 422. Migration0e32bf9d5a22adds the nullablewebhook_endpoints.event_typescolumn (#1581) - A peer's session join time can be set by the caller.
joined_atis accepted next toobserve_meandobserve_otherswherever a session-peer configuration is sent:peersonPOST /sessions,POSTandPUT /sessions/{session_id}/peers, andPUT /sessions/{session_id}/peers/{peer_id}/config. A search withpeer_perspectiveonly returns messages created at or after the peer's join time, and that time was always the moment the peer was added, so messages imported with their original dates were hidden from it. A suppliedjoined_atalways applies, including to a peer that is already in the session, which is how an existing import is repaired; without one nothing changes. It is write-only (not stored in the configuration, not returned), a timestamp without a timezone is read as UTC, and a time more than five minutes in the future is a 422. Changing the join time of a peer that is already in a session needs a key that can edit the session (session-level or broader): a peer-scoped key that sendsjoined_attoPOST /sessionsfor an existing session gets a 401 (#1613) POST /workspaces/{workspace_id}/dreams/listtakes the sharedfiltersobject, so a caller can list the dreams that started in a date range, for example{"filters": {"started_at": {"gte": "...", "lte": "..."}}}. The filterable fields arestarted_at,finished_at,observer_idandobserved_id; any other field is a 422. The filter is ANDed with the top-levelobserver_idandobserved_id, andtotal,pagesand cursor paging count only the matching dreams (#1604)DB_SEARCH_STATEMENT_TIMEOUT_MS(default 60000;0disables) is a time budget for each message search, and for each of the dialectic's exact-text message searches. It covers the whole search, not each of its statements: every statement is limited to the time the search has left. A search that runs out fails with a 504 instead of running to completion after its caller has given up, as one with a bad query plan could for many minutes while client retries started more copies. A lowerstatement_timeoutalready set on the database or role is kept. The limit is set withSET LOCALin a short transaction of the search's own, so it never applies to anything else that later uses the same pooled connection (#1637)
Changed
- Representation History is kept indefinitely by default.
DREAM_HISTORY_RETENTION_DAYSnow defaults to unset, not 30, and with it unset the reconciler no longer prunes any run; deleting a conclusion, its session or the workspace still removes what history recorded of it. Setting a window keeps the old behavior. Only an unset value means indefinitely: a set value must be 1 to 3650, and an empty value or 0 refuses boot. Setting a peer card throughPUT /peers/{peer_id}/cardnow deletes the cards dreams recorded for that observer and peer, so text the new card replaces is no longer readable in history; the runs still reportpeer_card_updated(#1590) - Tenant responses from
/v3/tenantsno longer carrytier. Create still accepts one and ignores it, so existing callers keep working (#1636) deriver_queue_items_processedalso counts the dream and deletion items the deriver finishes. Before, it counted only representation and summary items (#1629)
Fixed
- Concurrent requests that create the same new peers no longer deadlock. Two requests naming the same new peers in opposite orders (a message batch from alice then bob, and one from bob then alice) could each wait on the other's insert, and the loser got a 500. New peers are now inserted in name order (#1589)
- Concurrent member changes on one session no longer deadlock. Two replaces of a session's members with different sets, or a replace and a remove, locked rows in opposite orders and one got a 500. Replaces and removes of one session now run one at a time (#1594)
- A member removed while another request re-added them no longer ends up with
left_atearlier thanjoined_at, and a remove that waited while its session was deleted no longer ends the deleted session's memberships (#1616) - The deriver unwraps a structured-output answer that an OpenAI-compatible proxy returned nested in a tool call (
{"name": "json_tool_call", "arguments": {...}}and similar). Before, each such answer was rejected and retried, and when every attempt failed the batch's first queue item was marked errored and never derived (#1586) - A message write that fails no longer leaves a newly created session or new session memberships behind: the session is created in the same transaction as the messages (#1612)
- A message is saved together with the queue work that derives it.
POST /sessions/{session_id}/messagesandPOST /sessions/{session_id}/messages/uploadcommitted the messages first and queued them afterwards in a background task that logged and dropped any failure, so a message could be saved and never derived. Both now insert the messages and their queue rows in one transaction: if queuing fails, the request fails and nothing is saved, so the client can retry it. A deadlock or serialization failure reruns the write up to twice before failing; a lock or statement timeout fails it at once (#1621)