Skip to content

Conversation

@dmmulroy
Copy link
Contributor

@dmmulroy dmmulroy commented Jan 2, 2026

Summary

Adds assistant metadata (mode/model/duration) to session transcript exports and adds option to open in editor without saving to file.

Changed Files

  • packages/opencode/src/cli/cmd/tui/ui/dialog-export-options.tsx - added assistantMetadata and openWithoutSaving checkbox options
  • packages/opencode/src/cli/cmd/tui/routes/session/index.tsx - showAssistantMetadata signal, conditional file save logic
  • packages/opencode/src/cli/cmd/tui/util/transcript.ts - extracted transcript formatting logic (new file)
  • packages/opencode/test/cli/tui/transcript.test.ts - 15 tests for transcript formatting (new file)

Export Dialog Options

[ ] Include thinking
[ ] Include tool details
[x] Include assistant metadata
[ ] Open without saving
  • Open without saving (default: off) - when checked, opens transcript in editor without creating a file
  • Include assistant metadata (default: on) - includes mode/model/duration per assistant turn

Output Format

When "Include assistant metadata" is enabled:

## Assistant (Build · claude-sonnet-4-20250514 · 5.4s)

Hi there!

When disabled:

## Assistant

Hi there!

Test Coverage

15 tests covering:

  • formatAssistantHeader - metadata enabled/disabled, missing completion time, agent titlecasing
  • formatPart - text, synthetic text skip, reasoning on/off, tool with/without details, tool errors
  • formatMessage - user messages, assistant messages with metadata
  • formatTranscript - complete transcript with/without metadata

Note

This PR was written with AI assistance.

AI Session Export

{
  "info": {
    "title": "Add assistant metadata to session export",
    "agent": "opencode",
    "model": "claude opus 4.5"
  },
  "summary": [
    "user requested adding mode/model to export command as third option",
    "agent explored codebase to find export dialog and session index",
    "agent added modelInfo option to DialogExportOptions",
    "agent updated export logic to include mode/model/duration in transcript",
    "user requested enabling by default and asked about naming",
    "agent renamed modelInfo to assistantMetadata throughout",
    "user requested tests",
    "agent extracted transcript formatting into testable utility",
    "agent created 15 tests covering all formatting functions",
    "agent refactored session index to use new utility",
    "user requested ability to open in editor without saving file",
    "agent added saveToFile checkbox option",
    "user requested renaming to 'Open without saving' for backwards compat",
    "agent renamed to openWithoutSaving (default: off)"
  ]
}

@dmmulroy dmmulroy force-pushed the dmmulroy/current-model-export branch from d3243c3 to 6fc3c7a Compare January 2, 2026 00:34
- adds mode/model/duration to exported transcripts (enabled by default)
- adds 'Open without saving' checkbox (default: off) to open in editor without saving
- extracts transcript formatting into testable utility with 15 tests
@dmmulroy dmmulroy force-pushed the dmmulroy/current-model-export branch from 6fc3c7a to 61783ff Compare January 2, 2026 00:38
@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

lgtm

@rekram1-node rekram1-node merged commit 05eee67 into anomalyco:dev Jan 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants