Simplify human conversation and hide internal audit envelopes

This commit is contained in:
aiagent
2026-10-19 03:27:58 -07:00
parent 6b44147563
commit 547f62fa53
8 changed files with 206 additions and 33 deletions
+9
View File
@@ -341,6 +341,15 @@ class Store:
rows = db.execute('SELECT * FROM (SELECT * FROM messages WHERE session_id=? ORDER BY created DESC LIMIT 500) ORDER BY created', (sid,)).fetchall()
return [self.public_message(row) for row in rows]
def conversation(self, sid):
from .conversation import project
sid = identifier(sid)
with self.db() as db:
self._get(db, 'sessions', sid)
rows = db.execute('SELECT * FROM (SELECT * FROM messages WHERE session_id=? ORDER BY created DESC LIMIT 500) ORDER BY created', (sid,)).fetchall()
links = [json.loads(row['data']) for row in db.execute('SELECT data FROM history_links WHERE session_id=?', (sid,))]
return project([dict(row) for row in rows], links)
def claim(self, data):
sid, worker = identifier(data.get('session_id')), identifier(data.get('worker_id'))
seconds = data.get('lease_seconds', 300)