Skip to content

feat!: remove view mode and non-xterm terminal renderers (xterm-only) - #220

Merged
aterrylu merged 2 commits into
mainfrom
terry/terminal-only-cleanup
Jun 20, 2026
Merged

feat!: remove view mode and non-xterm terminal renderers (xterm-only)#220
aterrylu merged 2 commits into
mainfrom
terry/terminal-only-cleanup

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Problem

Two alternative-surface features had accrued carrying cost with no real use:

  1. "View mode" — a /api/conversation route parsed Claude Code session JSONL into a structured web "conversation" view (ClaudeCodeParser + render/parser types in @autonomos/core, ConversationView/DiffView in the dashboard), toggled against the live terminal. The parser had a single consumer.
  2. Pluggable terminal renderers — a terminalRenderer setting let users switch between xterm.js and a Ghostty (ghostty-web) backend. The Ghostty path was a second renderer no one selected, and it dragged in a WASM blob.

Per Terry's direction: terminal-based only from now on — one view, one renderer (xterm.js) — and slim the bundle.

Solution

flowchart LR
    subgraph REMOVE["🗑️ Removed"]
        A["View mode<br/>/api/conversation + core parser<br/>ConversationView/DiffView + viewMode"]
        B["Ghostty renderer<br/>ghostty-backend + factory<br/>terminalRenderer setting"]
        D["5 dead deps<br/>ghostty-web · react-syntax-highlighter<br/>+types · @assistant-ui/* ×2"]
    end
    subgraph KEEP["✅ Kept (load-bearing)"]
        K["xterm.js + @xterm/* · live PTY hook<br/>OSC8 links (linkHandler) · titleCache<br/>react-markdown/remark-gfm (preview panes)<br/>sidebarViewMode · providerSessionId"]
    end
    REMOVE -.collapses to.-> K
Loading
  • View mode: delete the /api/conversation route, the core ClaudeCodeParser + render/parser types (+ barrel re-exports), the dashboard ConversationView/DiffView, and the viewMode store/UI toggle. viewMode was dashboard-only localStorage state — no server migration (zustand silently ignores the stale persisted key).
  • Renderer: delete ghostty-backend.ts and the renderer-selection factory (create.ts); useTerminal now calls createXtermBackend directly. The TerminalRenderer union and the renderer toggle UI are gone.
  • Settings migration: terminalRenderer is a settings.json key, so it's added to REMOVED_KEYS for accept-and-discard — scrubbed on read with a warning naming it, dropped from disk on next persist. Non-credential, so no active-credential scrub (unlike the ADR-038 auth token). Matches the inboxAgent / anthropic* precedent (ADR-037/038).
  • Deps: drop ghostty-web, react-syntax-highlighter (+ @types), and the already-dead @assistant-ui/react + @assistant-ui/react-streamdown (zero source imports; in both root + dashboard manifests). bun.lock regenerated — the heavy prismjs/highlight.js/lowlight/refractor subtree drops out.

Net: −1,789 / +47 lines across 22 files (8 file deletions).

Why "Inbox Agent" was still showing in settings

Terry reported still seeing an "Inbox Agent" control in settings despite #213 removing it. Traced it: the current source has zero inbox UI — the visible control came from a stale embedded dashboard bundle (packages/server/dist/<plat>/_embedded_dashboard/, a gitignored artifact built Jun 7, 5 days before #213 merged). git pull never refreshes it. The fresh build in this PR confirms "Inbox Agent" is absent from the bundle. A rebuild clears the ghost — no inbox code to remove.

Testing

  • make check (full CI gate) — green: biome (0 errors), tsc --build, server 462/462 (incl. the L3 real-agent integration test), dashboard 216/216.
  • New test: settings.test.ts asserts a stale terminalRenderer is scrubbed on read. The two scrub tests that used updateSettings({ terminalRenderer }) as a persist-trigger were re-pointed to autoTrust (the field-removal would otherwise have been a compile error failing the whole server suite — the load-bearing-test trap).
  • vite build — clean (confirms no removed-dep imports linger).
  • /polish (3 agents: code-reviewer, silent-failure-hunter, code-simplifier) — all clear. OSC8 Ctrl/Cmd+click parity independently verified against xterm-backend.ts's linkHandler.

Risks

  • OSC8 hyperlinks (Ctrl/Cmd+click): Ghostty had its own OSC8LinkProvider; xterm uses the linkHandler ctor option with the same hasPrimaryModifier gate + deduplicatedOpen. Parity verified, but worth a manual click-a-link smoke test.
  • useTerminal.ts is the live PTY/WebSocket hook — only renderer-selection + the Ghostty branch were removed; all PTY/resize/scroll/link wiring is untouched.

Breaking changes

  • The terminalRenderer setting and the view-mode toggle are removed from the settings UI. Old settings.json files with terminalRenderer parse cleanly (scrubbed, with a warning). The /api/conversation endpoint is removed.

🤖 Generated with Claude Code

Terminal (xterm.js) is now the only view and the only renderer.

- Remove "view mode": delete the /api/conversation route, the
  @autonomos/core ClaudeCodeParser + render/parser types, the dashboard
  ConversationView/DiffView, and the viewMode store/UI toggle. viewMode was
  dashboard-only localStorage state, so there is no server-side migration.
- Remove non-xterm renderers: delete the Ghostty (ghostty-web) backend and
  the renderer-selection factory; useTerminal now calls createXtermBackend
  directly. OSC8 Ctrl/Cmd+click links are preserved via xterm's linkHandler.
- terminalRenderer settings key added to REMOVED_KEYS (accept-and-discard:
  scrubbed on read with a warning naming it, dropped from disk on next
  persist) following the ADR-037/038 removed-feature convention.
- Drop 5 now-dead dependencies: ghostty-web, react-syntax-highlighter
  (+ @types), and the unused @assistant-ui/react + @assistant-ui/react-streamdown.

Note: the "Inbox Agent" control still visible in settings was a stale
embedded dashboard bundle (server dist/.../_embedded_dashboard, built
pre-#213), not live code; a rebuild clears it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KRUUfmiCZ55Q6Vp8H8T3Ux
@aterrylu
aterrylu enabled auto-merge (squash) June 20, 2026 00:18

@nox-0x nox-0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving — clean, mechanical removal of view-mode and the Ghostty renderer with no lingering references in source.

Verified:

  • All source refs to viewMode / terminalRenderer / ghostty-web / ConversationView / DiffView / ClaudeCodeParser / assistant-ui / react-syntax-highlighter are gone from packages/** (only the intentional REMOVED_KEYS entry + corresponding test/comments remain).
  • Settings migration is correct: terminalRenderer is added to REMOVED_KEYS so getSettings() scrubs it and updateSettings() drops it from disk on next persist — matches the ADR-037/038 precedent. The route also no longer accepts the key.
  • xterm-backend.ts wires OSC 8 via the linkHandler ctor option with the hasPrimaryModifier + deduplicatedOpen gate, so Ctrl/Cmd+click parity with the old ghostty OSC8LinkProvider is preserved.
  • bun.lock no longer contains the removed deps; the stale pnpm-lock.yaml files weren't touched but they haven't been updated in this repo for ages and bun is the active lockfile.
  • Test edits look right: the two scrub tests that used terminalRenderer as a persist trigger were re-pointed to autoTrust (would otherwise be a compile error), and a dedicated scrub test asserts the new behavior.

Minor follow-up (non-blocking): the async IIFE wrapping the terminal init in useTerminal.ts existed because ghostty-web's WASM init was awaited; createXtermBackend is sync, so the IIFE could be unwound in a later pass.

@aterrylu
aterrylu merged commit 1446cc6 into main Jun 20, 2026
9 checks passed
@aterrylu
aterrylu deleted the terry/terminal-only-cleanup branch June 20, 2026 00:34
aterrylu added a commit that referenced this pull request Jun 20, 2026
Four append-only ADRs documenting decisions shipped across PRs #220, #219,
#221, and #222:

- ADR-039 — Terminal-only view, xterm.js-only renderer (#220, Cleanup@autonomOS)
- ADR-040 — selectUsageOrg() picks chat/claude_max capability (#219, ClaudeUsage)
- ADR-041 — Zero-touch Claude Usage via in-memory cookie harvest (#221, ClaudeUsage)
- ADR-042 — Insecure-context clipboard fallback for OSC 52 (#222, RemoteCopy)

Bundled to keep the docs cadence dense — each ADR is owned by the agent who
shipped the underlying code. ADR-038 and prior entries untouched.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
johnnywang016 added a commit that referenced this pull request Jun 26, 2026
…refactor)

Conflicts arose from three independent changes landing on main after this
branch diverged:

1. PR #220 (remove view mode / xterm-only): deleted ConversationView.tsx,
   DiffView.tsx, /api/conversation route, ClaudeCodeParser, and the
   parser/render/render types from @autonomos/core. This branch had modified
   ConversationView (Fix A2) and conversation.ts (Fix A1), and added
   buildCopyText + conversationLayout helpers. Since the entire view-mode
   subsystem was intentionally removed and the core types it depended on
   are gone, accept the deletions and remove the now-dead helpers and their
   tests (conversation-cache.test.ts, buildCopyText.*, conversationLayout.*).

2. PR (run.ts refactor): server startup logic moved from index.ts into run.ts
   as runServer(). Accept main's thin index.ts entry point and integrate the
   PR's additions (initMemory() call + /api/memory route) into run.ts.

3. gateway/router.ts broadcast: main added Codex-agent exclusion comment +
   logic; this branch added the `delivered` tracking array. Keep both.

4. routes/agents.ts DELETE handler: main added robust deleteAgentRaw fallback
   with CachePoisonedError handling; this branch added a recordEvent() call.
   Keep both — recordEvent fires after the delta flush.

5. core/src/index.ts: keep the PR's new `./types/memory` export, drop
   `./types/parser` which main intentionally removed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDGAaQfEC1hR7mLJhTJD9F
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