Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Capture web terminal stdin as logged CommandEvents - #153

Merged
Panacota96 merged 2 commits into
developfrom
codex/capture-terminal-inputs-jsonl
Apr 6, 2026
Merged

Capture web terminal stdin as logged CommandEvents#153
Panacota96 merged 2 commits into
developfrom
codex/capture-terminal-inputs-jsonl

Conversation

@Codex

@Codex Codex AI commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Browser terminals were not logging stdin, losing command history and metadata for web-launched shells.

  • Web terminal plumbing: Added PTY manager (TERMINALS) and REST/WebSocket endpoints (/api/session/{name}/terminal/*, /ws/session/{name}/terminal) that stream stdin to the PTY while appending each newline-delimited input as a CommandEvent (cwd, seq, part, HMAC) to session.jsonl.
  • Session page UI: Injected a live terminal panel that uses the new endpoints/WebSocket for interactive input/output; terminal output continues to mirror into terminal.log.
  • Docs/notes: Documented live terminal capture in README and changelog; added WebSocket test ensuring captured commands surface in the session API.

Example (stdin capture before PTY write):

# src/guild_scroll/web/terminal.py
event = CommandEvent(
    seq=self._seq,
    command=command,
    timestamp_start=ts,
    timestamp_end=ts,
    exit_code=-1,
    working_directory=self._capture_cwd(),
    part=self.part,
)
JSONLWriter(self._session_log_path, hmac_key=self._hmac_key).write(event.to_dict())

Co-authored-by: Panacota96 <118935424+Panacota96@users.noreply.github.com>
@Codex Codex AI changed the title [WIP] Capture terminal inputs as JSONL CommandEvents Capture web terminal stdin as logged CommandEvents Apr 6, 2026
@Codex
Codex AI requested a review from Panacota96 April 6, 2026 20:14
@Panacota96
Panacota96 marked this pull request as ready for review April 6, 2026 20:16
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Panacota96
Panacota96 merged commit 0fbe95a into develop Apr 6, 2026
9 checks passed
@Panacota96
Panacota96 deleted the codex/capture-terminal-inputs-jsonl branch April 6, 2026 20:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Capture terminal inputs — WebSocket stdin logging as JSONL CommandEvents

2 participants