Skip to content

feat: Retire cortex-session-dump in favour of agentop export #1930

Open

Description

@mrsabath

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:

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:

  1. Export where there is no archive. Decide whether agentop export reads 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.
  2. 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.
  3. Carry over what else the dump writes, or document that GET /v1/pipeline,
    /v1/plugins and /v1/usage are fetched directly. A one-line curl may be the right
    answer rather than new flags.
  4. Unwire the script. It is referenced in more places than a dev script suggests:
    • scripts/install.sh:870 fetches it with every release
    • cmd/agentop/setup_step_binaries.go:25 installs it in setupBinaryNames
    • cmd/agentop/cmd_doctor_checks.go:190 checks python3 on PATH for it
    • cmd/agentop/cmd_uninstall.go:30 removes it
    • tests/test_cortex_session_dump.py and scripts/install_test.sh cover it
    • docs/session-dump.md documents it
  5. Migrate users. agentop setup has been installing this to ~/.local/bin for
    releases, so an uninstall path and a note in the release notes are needed, not just a
    git rm. Removing python3 from agentop doctor is a visible simplification.

Out of scope

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions