Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dogfood/issue-21-run-completion-clean/01-create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ok": true,
"command": "create",
"timestamp": "2026-04-26T20:49:52.589Z",
"result": {
"sessionId": "01KQ5RWH177CRZKPXSW91K16RG",
"createdAt": "2026-04-26T20:49:51.659Z",
"cols": 80,
"rows": 24,
"shell": "/bin/bash"
}
}
13 changes: 13 additions & 0 deletions dogfood/issue-21-run-completion-clean/02-run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"ok": true,
"command": "run",
"timestamp": "2026-04-26T20:50:07.184Z",
"result": {
"accepted": true,
"completed": true,
"timedOut": false,
"seq": 2,
"durationMs": 208,
"marker": "__AT_MARKER_739e240b0762477e833bf3fd8b0dfd5f__"
}
}
113 changes: 113 additions & 0 deletions dogfood/issue-21-run-completion-clean/03-snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"ok": true,
"command": "snapshot",
"timestamp": "2026-04-26T20:50:19.514Z",
"result": {
"format": "structured",
"sessionId": "01KQ5RWH177CRZKPXSW91K16RG",
"capturedAtSeq": 8,
"cols": 80,
"rows": 24,
"cursorRow": 4,
"cursorCol": 20,
"isAltScreen": false,
"visibleLines": [
{
"row": 0,
"text": "bash-5.1$ printf \"before-clean-marker-proof\\n\"; sleep 0.2; printf \"after-clean-m"
},
{
"row": 1,
"text": "arker-proof\\n\""
},
{
"row": 2,
"text": "before-clean-marker-proof"
},
{
"row": 3,
"text": "after-clean-marker-proof"
},
{
"row": 4,
"text": "bash-5.1$ bash-5.1$"
},
{
"row": 5,
"text": ""
},
{
"row": 6,
"text": ""
},
{
"row": 7,
"text": ""
},
{
"row": 8,
"text": ""
},
{
"row": 9,
"text": ""
},
{
"row": 10,
"text": ""
},
{
"row": 11,
"text": ""
},
{
"row": 12,
"text": ""
},
{
"row": 13,
"text": ""
},
{
"row": 14,
"text": ""
},
{
"row": 15,
"text": ""
},
{
"row": 16,
"text": ""
},
{
"row": 17,
"text": ""
},
{
"row": 18,
"text": ""
},
{
"row": 19,
"text": ""
},
{
"row": 20,
"text": ""
},
{
"row": 21,
"text": ""
},
{
"row": 22,
"text": ""
},
{
"row": 23,
"text": ""
}
]
}
}
20 changes: 20 additions & 0 deletions dogfood/issue-21-run-completion-clean/04-screenshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"ok": true,
"command": "screenshot",
"timestamp": "2026-04-26T20:50:29.854Z",
"result": {
"sessionId": "01KQ5RWH177CRZKPXSW91K16RG",
"capturedAtSeq": 8,
"profileName": "reference-dark",
"cols": 80,
"rows": 24,
"artifactPath": "/tmp/agent-tty-issue21-dogfood-aC31nw/sessions/01KQ5RWH177CRZKPXSW91K16RG/artifacts/screenshot-8-reference-dark.png",
"pngSizeBytes": 8884,
"cursorVisible": false,
"rendererBackend": "ghostty-web",
"pixelWidth": 640,
"pixelHeight": 384,
"sha256": "5d25d81377d59dfa79928b7ce1824ab521328eba74f73b53abd02f58d4658ccf",
"renderProfileHash": "8ffed6af301ec7c0e6b69599c3be0d1d12096f9fcdfc59d0bbb4cc474d64c53d"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions dogfood/issue-21-run-completion-clean/05-asciicast.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"ok": true,
"command": "record export",
"timestamp": "2026-04-26T20:50:38.337Z",
"result": {
"sessionId": "01KQ5RWH177CRZKPXSW91K16RG",
"format": "asciicast",
"artifactPath": "/home/coder/.mux/src/agent-terminal/agent-tty-4d32/dogfood/issue-21-run-completion-clean/05-recording.cast",
"bytes": 543,
"sha256": "167aea68969d96fd2b159f5f6a5ad5c201e3db1396de889eab2be9026a54ad82",
"capturedAtSeq": 8,
"durationMs": 14205,
"metadata": {
"width": 80,
"height": 24,
"title": "01KQ5RWH177CRZKPXSW91K16RG",
"timestamp": 1777236592,
"outputEventCount": 7,
"resizeEventCount": 0,
"markerCount": 0
}
}
}
8 changes: 8 additions & 0 deletions dogfood/issue-21-run-completion-clean/05-recording.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"version":2,"width":80,"height":24,"timestamp":1777236592,"title":"01KQ5RWH177CRZKPXSW91K16RG","sessionId":"01KQ5RWH177CRZKPXSW91K16RG","env":{"TERM":"xterm-256color"},"toolVersion":"0.1.1-beta.4"}
[0,"o","\u001b[?2004h"]
[0.001,"o","bash-5.1$ "]
[13.998,"o","printf \"before-clean-marker-proof\\n\"; sleep 0.2; printf \"after-clean-ma\rarker-proof\\n\"\r\n\u001b[?2004l\r"]
[13.999,"o","before-clean-marker-proof\r\n"]
[14.201,"o","after-clean-marker-proof\r\n\u001b[?2004h"]
[14.201,"o","bash-5.1$ "]
[14.205,"o","\u001b[?2004hbash-5.1$ "]
Binary file not shown.
24 changes: 24 additions & 0 deletions dogfood/issue-21-run-completion-clean/06-webm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"ok": true,
"command": "record export",
"timestamp": "2026-04-26T20:50:41.609Z",
"result": {
"sessionId": "01KQ5RWH177CRZKPXSW91K16RG",
"format": "webm",
"artifactPath": "/home/coder/.mux/src/agent-terminal/agent-tty-4d32/dogfood/issue-21-run-completion-clean/06-recording.webm",
"bytes": 26432,
"sha256": "27384d1fafaeee27c0e8511f3df659c3b195c4fccf56262fdb5605caa7b7dcee",
"capturedAtSeq": 8,
"durationMs": 14205,
"metadata": {
"width": 80,
"height": 24,
"profileName": "reference-dark",
"renderProfileHash": "8ffed6af301ec7c0e6b69599c3be0d1d12096f9fcdfc59d0bbb4cc474d64c53d",
"timingMode": "accelerated",
"rendererBackend": "ghostty-web",
"outputEventCount": 7,
"resizeEventCount": 0
}
}
}
9 changes: 9 additions & 0 deletions dogfood/issue-21-run-completion-clean/07-events.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{"seq":0,"ts":"2026-04-26T20:49:52.489Z","type":"output","payload":{"data":"\u001b[?2004h"}}
{"seq":1,"ts":"2026-04-26T20:49:52.490Z","type":"output","payload":{"data":"bash-5.1$ "}}
{"seq":2,"ts":"2026-04-26T20:50:06.485Z","type":"input_run","payload":{"command":"printf \"before-clean-marker-proof\\n\"; sleep 0.2; printf \"after-clean-marker-proof\\n\"","marker":"__AT_MARKER_739e240b0762477e833bf3fd8b0dfd5f__","noWait":false}}
{"seq":3,"ts":"2026-04-26T20:50:06.487Z","type":"output","payload":{"data":"printf \"before-clean-marker-proof\\n\"; sleep 0.2; printf \"after-clean-ma\rarker-proof\\n\"\r\n\u001b[?2004l\r"}}
{"seq":4,"ts":"2026-04-26T20:50:06.488Z","type":"output","payload":{"data":"before-clean-marker-proof\r\n"}}
{"seq":5,"ts":"2026-04-26T20:50:06.690Z","type":"output","payload":{"data":"after-clean-marker-proof\r\n\u001b[?2004h"}}
{"seq":6,"ts":"2026-04-26T20:50:06.690Z","type":"output","payload":{"data":"bash-5.1$ "}}
{"seq":7,"ts":"2026-04-26T20:50:06.693Z","type":"run_complete","payload":{"marker":"__AT_MARKER_739e240b0762477e833bf3fd8b0dfd5f__","inputRunSeq":2}}
{"seq":8,"ts":"2026-04-26T20:50:06.694Z","type":"output","payload":{"data":"\u001b[?2004hbash-5.1$ "}}
9 changes: 9 additions & 0 deletions dogfood/issue-21-run-completion-clean/08-destroy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ok": true,
"command": "destroy",
"timestamp": "2026-04-26T20:51:54.509Z",
"result": {
"sessionId": "01KQ5RWH177CRZKPXSW91K16RG",
"destroyed": true
}
}
80 changes: 80 additions & 0 deletions dogfood/issue-21-run-completion-clean/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Issue #21 — Run completion markers stay out of rendered artifacts

This bundle proves that `run --wait` no longer leaks the internal completion
marker into reviewer-facing artifacts (snapshot, screenshot, asciicast, WebM)
while still preserving the public CLI JSON envelope.

Generated under an isolated `AGENT_TTY_HOME` (`/tmp/agent-tty-issue21-dogfood-…`,
removed after capture). See `commands.sh` for the exact reproduction.

## What was exercised

The waited `run` command was:

```sh
printf "before-clean-marker-proof\n"; sleep 0.2; printf "after-clean-marker-proof\n"
```

Run marker returned in the JSON envelope: `__AT_MARKER_739e240b0762477e833bf3fd8b0dfd5f__`
(UUID portion: `739e240b0762477e833bf3fd8b0dfd5f`).

## Verification matrix

| Artifact | User output present | `__AT_MARKER_` count | `agent-tty:run-complete:` count | Marker UUID count |
| --------------------------------------- | --------------------- | -------------------- | ------------------------------- | ----------------- |
| `03-snapshot.json` (visibleLines text) | ✅ both lines | 0 | 0 | 0 |
| `05-recording.cast` (asciicast frames) | ✅ both lines | 0 | 0 | 0 |
| `06-recording.webm` (binary, byte scan) | n/a (encoded video) | 0 | 0 | 0 |
| `07-events.jsonl` `output` events | ✅ visible bytes only | 0 | 0 | 0 |

Allowed and expected: the marker text appears only in the structured metadata
events that never reach renderer/export — `input_run.payload.marker` and
`run_complete.payload.marker`.

## Event-log highlight

Single waited run produced 9 events:

- 1 × `input_run` (carries marker as correlation metadata only)
- 7 × `output` (visible PTY bytes; marker-free)
- 1 × `run_complete` (new structured non-rendered event with `{ marker, inputRunSeq: 2 }`)

`run_complete` event payload:

```json
{ "marker": "__AT_MARKER_739e240b0762477e833bf3fd8b0dfd5f__", "inputRunSeq": 2 }
```

## Public envelope preserved

`02-run.json` still includes:

```json
{
"accepted": true,
"completed": true,
"timedOut": false,
"seq": 2,
"durationMs": 208,
"marker": "__AT_MARKER_739e240b0762477e833bf3fd8b0dfd5f__"
}
```

## Files

- `01-create.json` — `create` JSON envelope
- `02-run.json` — `run --wait` JSON envelope (still exposes `marker`, `completed`, `durationMs`, …)
- `03-snapshot.json` — semantic snapshot
- `04-screenshot.{json,png}` — rendered screenshot result + PNG (640 × 384, ghostty-web)
- `05-recording.cast` + `05-asciicast.json` — exported asciicast and result envelope
- `06-recording.webm` + `06-webm.json` — exported WebM (accelerated timing) and result envelope
- `07-events.jsonl` — canonical event log copy
- `08-destroy.json` — session teardown envelope
- `commands.sh` — exact reproduction script

## Suggested review order

1. `02-run.json` to confirm the public envelope is unchanged.
2. `07-events.jsonl` to see the new `run_complete` event and confirm `output` events are marker-free.
3. `03-snapshot.json` and `04-screenshot.png` to confirm the rendered terminal state contains user output but no marker.
4. `05-recording.cast` and `06-recording.webm` to confirm exported recordings are also marker-free.
37 changes: 37 additions & 0 deletions dogfood/issue-21-run-completion-clean/commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Reproduce the issue-21 run-completion-clean dogfood bundle.
# All paths use an isolated AGENT_TTY_HOME under /tmp; nothing writes to ~/.agent-tty.
set -euo pipefail

DOGFOOD_HOME=$(mktemp -d -t agent-tty-issue21-dogfood-XXXXXX)
ARTIFACTS_DIR="$(pwd)/dogfood/issue-21-run-completion-clean"
mkdir -p "$ARTIFACTS_DIR"

CLI=(npx tsx src/cli/main.ts --home "$DOGFOOD_HOME")

# 1. Create an interactive bash session
"${CLI[@]}" create --json -- bash --noprofile --norc \
| tee "$ARTIFACTS_DIR/01-create.json"
SESSION_ID=$(jq -r '.result.sessionId' "$ARTIFACTS_DIR/01-create.json")

# 2. Run a waited command with recognizable user output
"${CLI[@]}" run --json --timeout 10000 "$SESSION_ID" \
'printf "before-clean-marker-proof\n"; sleep 0.2; printf "after-clean-marker-proof\n"' \
| tee "$ARTIFACTS_DIR/02-run.json"

# 3. Capture artifacts
"${CLI[@]}" snapshot --json "$SESSION_ID" > "$ARTIFACTS_DIR/03-snapshot.json"
"${CLI[@]}" screenshot --json "$SESSION_ID" > "$ARTIFACTS_DIR/04-screenshot.json"
cp "$(jq -r '.result.artifactPath' "$ARTIFACTS_DIR/04-screenshot.json")" \
"$ARTIFACTS_DIR/04-screenshot.png"
"${CLI[@]}" record export --json "$SESSION_ID" --format asciicast \
--out "$ARTIFACTS_DIR/05-recording.cast" > "$ARTIFACTS_DIR/05-asciicast.json"
"${CLI[@]}" record export --json "$SESSION_ID" --format webm --timing accelerated \
--out "$ARTIFACTS_DIR/06-recording.webm" > "$ARTIFACTS_DIR/06-webm.json"

# 4. Copy the canonical event log for cleanliness inspection
cp "$DOGFOOD_HOME/sessions/$SESSION_ID/events.jsonl" "$ARTIFACTS_DIR/07-events.jsonl"

# 5. Tear down
"${CLI[@]}" destroy --json "$SESSION_ID" > "$ARTIFACTS_DIR/08-destroy.json"
rm -rf "$DOGFOOD_HOME"
Loading
Loading