Skip to content

bug(server): /rewind broken — conversation workspace never populated, counts 0/0, truncated messages resurrect #1303

Description

@dennisonbertram

Found by a live tmux-driven TUI test sweep. Evidence: .tmp/tui-test/results/destructive.md.

Bugs (acceptance criteria — each fixed with a regression test)

  • /rewind confirm can never succeed: server 404 "conversation workspace not found" because conversations.workspace is never populated in production (only writer internal/harness/runner.go:3262 passes ""); the TUI's workspace_path run field is never decoded server-side. Points get recorded but can never restore.
  • /rewind success counts always display 0/0: TUI RewindResultMsg lacks JSON tags; server sends snake_case files_restored/messages_truncated.
  • /rewind message truncation is ineffective: the in-memory conversation mirror isn't truncated, so the next turn resurrects all rewound messages and overwrites the DB truncation. Only the file restore takes effect.

Test plan

Failing Go regression tests first (runner/conversation store level for workspace population and mirror truncation; TUI message-unmarshal test for the JSON tags), then minimal fixes; scripts/test-regression.sh green.

Impact analysis

Touches run creation (workspace capture), rewind restore path, and the TUI rewind result message. Verify no other consumers of conversations.workspace depend on it being empty.

Rollout/rollback

Revert the branch; existing rewind points recorded without a workspace remain unrestorable (pre-existing limitation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions