Skip to content

feat(activity): host-terminal working/idle dot from transcript mtime - #416

Open
jrothrock wants to merge 1 commit into
mainfrom
feat/host-claude-dots
Open

jrothrock wants to merge 1 commit into
mainfrom
feat/host-claude-dots

Conversation

@jrothrock

Copy link
Copy Markdown
Collaborator

What

Branch 3 of 4 in replacing the bespoke ChatDock host chat with a real terminal (stacks on #414, #415).

The host Claude terminal is a raw PTY with no event stream to observe — unlike merge jobs, whose Work-tab dot reads emit()'s activity clock. It also runs on the host with no container, so projectActivity (which counts proxy.log / mitmweb /v1/messages) returns "off" for a host-only session. Result: the host terminal had no working/idle dot.

Fix

Derive the dot from transcript mtime: when the container is down but the project's -claude tmux session is live, classify working/waiting by how recently the host transcript grew (Claude Code appends to the session JSONL as a turn streams). Same 6s idle threshold (activityIdleAfter) as the streamed dot.

  • hostTerminalActivity(workspace) in activity.go, consulted from projectActivity's !containerUp branch.
  • Non-.jsonl files ignored; no live session → "" so the caller still shows "off".

Test

activity_host_test.go — newest-mtime selection (ignores non-transcripts, absent/empty dirs) + the no-session path.

🤖 Generated with Claude Code

Branch 3 of the host-terminal-replaces-chat stack. The host Claude
terminal is a raw PTY with no event stream to observe (unlike merge
jobs, whose dot reads emit()'s clock), and it runs on the host with no
container — so projectActivity's proxy.log / mitmweb signals return
"off" for a host-only session.

Fill the gap with transcript mtime: when the container is down but the
project's -claude tmux session is live, derive working/waiting from how
recently the host transcript grew (Claude Code appends to the session
JSONL as a turn streams). Same 6s idle threshold as the streamed dot.
Non-.jsonl files are ignored; no live session yields "" so the caller
still shows "off".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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