Skip to content

🤖 feat: share workspace transcript to mux.md as chat.jsonl#2110

Merged
ibetitsmike merged 11 commits intomainfrom
mike/share-transcript-jsonl
Feb 5, 2026
Merged

🤖 feat: share workspace transcript to mux.md as chat.jsonl#2110
ibetitsmike merged 11 commits intomainfrom
mike/share-transcript-jsonl

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Feb 2, 2026

Summary

Adds a workspace-level "Share transcript" action in the header that uploads the full conversation to mux.md as chat.jsonl.

Background

  • Existing mux.md sharing UX focuses on single markdown blobs; mux-md is being extended to render Mux transcripts directly from chat.jsonl.
  • mux-md is read-only and cannot call api.workspace.getPlanContent(), so propose_plan file contents must be inlined into the shared transcript for plans to render.

Implementation

  • Added buildChatJsonlForSharing() in src/common/utils/messages/transcriptShare.ts (JSONL serialization + optional tool-output stripping).
  • Compacts adjacent text/reasoning delta parts during export to keep shared transcripts small (older history can contain thousands of streaming deltas).
  • Fetches the current plan file from the workspace runtime and injects planContent into all propose_plan tool outputs during export (so shares are portable). Path matching was removed — the propose_plan handler stores ~/.mux/... while the backend resolves to an absolute path, and matching across platforms was fragile. Since all propose_plan calls in a workspace reference the same canonical plan file, the latest content is always correct.
  • Preserves propose_plan tool output even when "Include tool output" is disabled; other tool outputs are stripped.
  • Added ShareTranscriptPopover and wired into WorkspaceHeader with keybind Cmd/Ctrl+Shift+L.
  • Includes model + thinking in the FileInfo passed to uploadToMuxMd().
  • Bumped @coder/mux-md-client to ^0.1.0-main.27.
  • Added MUX_MD_URL_OVERRIDE handling so uploads/downloads/deletes/expiration can target staging/local mux.md.

Validation

  • make static-check
  • bun test --bail src/common/utils/messages/transcriptShare.test.ts — 13/13 pass

Risks

  • When tool output is stripped, tool parts (except propose_plan) are converted from state: "output-available""input-available". Viewers that render input-available as "pending" may show a tool call without results.

Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: high • Cost: $34.06

@ibetitsmike
Copy link
Contributor Author

@codex review

Please focus on:

  • Tool output stripping semantics (output-availableinput-available, including nestedCalls)
  • UX/placement of the workspace header share action + keybind

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24fda2cbb6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike
Copy link
Contributor Author

@codex review

Addressed the P2 about cross-workspace leakage by resetting share state on workspaceId changes and guarding in-flight uploads.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ibetitsmike ibetitsmike force-pushed the mike/share-transcript-jsonl branch from 0990f48 to 9b835a8 Compare February 4, 2026 14:19
@ibetitsmike ibetitsmike force-pushed the mike/share-transcript-jsonl branch from 9b835a8 to d5bf186 Compare February 5, 2026 00:41
Support mux.md base URL override for staging/local deployments.

- Add getMuxMdBaseUrl/getMuxMdAllowedHosts helpers and route upload/download/delete through them.
- Expose MUX_MD_URL_OVERRIDE to the renderer via preload as window.api.muxMdUrlOverride.
- Harden web_fetch mux.md handling to only decrypt allowed hosts and download from the link origin.
Inject MUX_MD_URL_OVERRIDE into the Vite client bundle and have muxMd.ts read it when running in a plain browser (no Electron preload).
When building a transcript for sharing, inline the provided plan snapshot into every completed\npropose_plan tool call that has a planPath and is missing planContent. This avoids fragile\nplanPath vs snapshot path normalization.\n\nAlso warn (but continue) if plan content can't be loaded while generating a share link.\n\n---\n\n_Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh` • Cost: ``_\n\n<!-- mux-attribution: model=openai:gpt-5.2 thinking=xhigh costs=unknown -->
@ibetitsmike ibetitsmike merged commit 6c4e405 into main Feb 5, 2026
23 checks passed
@ibetitsmike ibetitsmike deleted the mike/share-transcript-jsonl branch February 5, 2026 19:26
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.

1 participant