Repository navigation
Description
Part of #1920.
Problem
cortex-session-dump (scripts/dev/cortex-session-dump.py, 260 lines of Python) was
added in #901's era as an explicit stopgap: outside a local install Cortex kept
sessions in memory only, so a restart lost them, and the script was the way to get them
out as files.
Two things have changed since:
- feature: persist sessions #901 shipped. A local install now writes sessions to
~/.cortex/sessions, so a laptop
restart no longer loses them. agentop exportandGET /v1/exportshipped (Feat: Walk the archive into content-free records over GET /v1/export #1830, Feat: agentop export writes the archive's record export to a file #1831,core/sessionexport), in
Go, tested, with a documented record contract.
So the script is narrower than it was. It is not yet redundant, and that gap is what this
issue tracks. Carrying a second export tool, in a second language, with its own install
path, is a cost worth retiring deliberately rather than by attrition.
What only the script can do today
| Capability | Why agentop export does not cover it |
Closes with |
|---|---|---|
Content as files: prompts, completions, tool results (--full) |
Content is refused by an export path rather than offered as a flag (#1854 R13). agentop export will not grow --full. |
#1925, with #1921 for redaction |
| A proxy with no archive | /v1/export answers 404 session archive not enabled. An injected sidecar runs no archive and keeps sessions in memory, so the dump is the only way to keep anything from a cluster. |
this issue |
pipeline.json, plugins.json, usage.json beside the sessions |
agentop export writes records only. |
this issue |
| Session titles in an index | The record carries sessionId only. A title is user content. |
#1906, behind an explicit opt-in |
Proposal
Close the gaps, then delete the script. In order:
- Export where there is no archive. Decide whether
agentop exportreads the store
when the archive is absent, or whether a cluster sidecar is simply out of scope for
export and the answer is "run an archive". This is the one gap with no issue behind it,
and it is the gap that matters: it is the case a restart still loses. - Content export lands as feat: Export a session with its content, in replay formats #1925 (wire JSONL / OTel GenAI), redacted by default per
feat: Redact recorded content before it leaves the archive #1921, as its own command or route rather than a flag on the content-free path. - Carry over what else the dump writes, or document that
GET /v1/pipeline,
/v1/pluginsand/v1/usageare fetched directly. A one-linecurlmay be the right
answer rather than new flags. - Unwire the script. It is referenced in more places than a dev script suggests:
scripts/install.sh:870fetches it with every releasecmd/agentop/setup_step_binaries.go:25installs it insetupBinaryNamescmd/agentop/cmd_doctor_checks.go:190checkspython3on PATH for itcmd/agentop/cmd_uninstall.go:30removes ittests/test_cortex_session_dump.pyandscripts/install_test.shcover itdocs/session-dump.mddocuments it
- Migrate users.
agentop setuphas been installing this to~/.local/binfor
releases, so an uninstall path and a note in the release notes are needed, not just a
git rm. Removingpython3fromagentop doctoris a visible simplification.
Out of scope
- Designing the content export. That is feat: Export a session with its content, in replay formats #1925.
- Changing the content-free record. That is Export API: let a record name its session, carry tool names, and list the archive #1906.
- Deleting the script before the gaps above close. A cluster sidecar has no other way to
keep a session past a restart.
Open
Whether step 1 is worth building at all. If the answer is that a cluster deployment should
configure session.archive.dir and use /v1/export like a laptop does, then this issue is
smaller: the script retires once #1925 ships, and the no-archive case retires as a
documentation change. That decision shapes the rest.
Assisted-By: Claude (Anthropic AI) noreply@anthropic.com
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew/ToDo
Activity