Skip to content

Render agent runs as a main-view transcript with an auxiliary terminal - #12

Merged
sionic-khope merged 1 commit into
mainfrom
feature/headless-agent-transcript
Jul 20, 2026
Merged

Render agent runs as a main-view transcript with an auxiliary terminal#12
sionic-khope merged 1 commit into
mainfrom
feature/headless-agent-transcript

Conversation

@sionic-khope

Copy link
Copy Markdown
Contributor

Summary

  • Agent runs go headless: claude -p --output-format stream-json / codex exec --json spawned per run (login shell for PATH), parsed line-by-line into transcript items — assistant messages, tool/code-change rows, error notices — rendered in the main conversation view and persisted per thread (PersistedWorkspaceSession.transcript, backward/forward compatible).
  • Codex parsing targets the current ThreadEvent schema (item.*/turn.*, verified against a real codex-cli 0.141 run) with the legacy msg dialect kept as fallback; --skip-git-repo-check added so runs work in non-git folders.
  • Run completion = process exit (PTY foreground heuristics deleted); deleting a thread or closing the workspace cancels the run so no full-access subprocess outlives its UI.
  • Terminal is now a VS-Code-style auxiliary panel: never auto-opens on submit, ❯ TERMINAL divider drag-resizes it, dragging below the close threshold (or press-and-hold) closes it.
  • Composer send button becomes a stop control during a run; conversation auto-scrolls while streaming; animated thinking/working indicator (Reduce Motion aware); new threads default to ~/Desktop.

Test plan

  • swift build -Xswiftc -warnings-as-errors clean
  • swift test -Xswiftc -warnings-as-errors: 203/203 (was 193 baseline; new suites: AgentEventStreamTests, AgentWorkspaceModelTests, HeadlessAgentRunnerTests incl. real-subprocess integration, AgentWorkspaceLayoutTests)
  • Claude stream shape validated against a live claude -p --output-format stream-json run; codex schema validated against a live codex exec --json run
  • App boot smoke via swift run MikuCodeApp

🤖 Generated with Claude Code

https://claude.ai/code/session_015peMZyaHEmxDzyzNyhYeR5

Agent prompts no longer run inside the embedded PTY. Each run launches the
CLI headless (claude -p --output-format stream-json; codex exec --json with
the current ThreadEvent schema plus the legacy msg dialect) and streams
JSONL into transcript items — assistant messages, tool/code-change rows,
and error notices — rendered in the main conversation view and persisted
per thread. Run completion is simply process exit, replacing the PTY
foreground-group heuristics, and deleting a thread or closing the
workspace cancels its run so no subprocess outlives its UI.

The terminal becomes a VS-Code-style auxiliary panel: submitting never
opens it, its divider drag-resizes it (dragging below the close threshold
or press-and-holding closes it), and the send button turns into a stop
control while a run streams. The conversation auto-scrolls with streaming
output, shows an animated thinking/working indicator, and new threads
default to ~/Desktop instead of running without a working directory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015peMZyaHEmxDzyzNyhYeR5
@sionic-khope
sionic-khope merged commit dbab2ec into main Jul 20, 2026
1 check 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.

1 participant