Skip to content

fix(export): apply message-role filters to exports #406

Closed

Description

@Sinity

Repro

```
polylogue --message-role user export --format json
```

returns the full message list including assistant + system + unknown. The filter is silently ignored on `export`.

Expected

`--message-role` should filter the `messages` array in the export output, same as it does on `list`. Currently the only workaround is to dump full JSON and post-filter in Python:

```python
import json, subprocess
d = json.loads(subprocess.run(['polylogue', 'export', sid, '--format', 'json'], capture_output=True).stdout)
users = [m for m in d['messages'] if m['role'] == 'user']
```

Why it matters

When extracting user prose across many conversations (e.g. for retrospective intent analysis), having to round-trip every message through Python before discarding 90 % is wasteful. The flag exists; just needs to be wired through to the export path.

Related

Came up while extracting user inputs for thoughtspace-related sessions in #405 territory.

Activity

  1. changed the title [-]`--message-role` filter doesn't propagate to `export` subcommand[/-] [+]fix(export): apply message-role filters to exports[/+] on Apr 26, 2026
  2. added a commit that references this issue on Apr 26, 2026
    62333b6
  3. added a commit that references this issue on Apr 26, 2026
    846aa16
  4. added a commit that references this issue on May 7, 2026
    054a1b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions