colibri/scripts/sample-pi-agent.py
Sam & Claude daed5db908
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
test: rename 'fake' test agent → 'sample' (lighter, less loaded)
'fake' carries a broad/negative association. Rename the test-double agent and
all its references to 'sample' (it emits a canned sample of pi-format JSONL):

- scripts/fake-pi-agent.py → scripts/sample-pi-agent.py (git mv, mode kept)
- pi_spawn_live.rs: sample-pi-agent.py, pane label 'sample-pi'
- socket.rs: fn sample_agent_stdout_stream_updates_glasspane, labels, 'pi-sample'
- live_socket_check.rs: sample_agent; colibri.rs: /tmp/sample-agent
- glasspane/spawner doc comments: 'sample JSONL readers'
- docs (ISO-SERVICE-LAYOUT, PRIORITY-HANDOFF, ISO-ACCEPTANCE-RUNBOOK)

Pure rename; no behavior change. ./scripts/ci-checks.sh green.
Stacks on #158.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 18:19:49 +02:00

25 lines
686 B
Python
Executable file

#!/usr/bin/env python3
"""Sample Pi agent — emits JSONL in the colibri-pi-events format.
Used by Colibri integration tests to validate the spawn → JSONL → glasspane path.
"""
import sys
import json
import time
messages = [
{"type": "session", "id": f"pi-test-{int(time.time())}", "cwd": "/tmp"},
{"type": "agent_start"},
{"type": "turn_start"},
{"type": "message_start"},
{"type": "message_update", "delta": "Processing task..."},
{"type": "message_end"},
{"type": "turn_end", "stop": "end_turn"},
{"type": "agent_end"},
]
for msg in messages:
sys.stdout.write(json.dumps(msg) + "\n")
sys.stdout.flush()
time.sleep(0.01)
sys.exit(0)