fakeclaude

import "github.com/jbcom/radioactive-ralph/internal/session/internal/fakeclaude"

Package main is a test double for `claude -p –input-format stream-json`.

It implements enough of the stream-json protocol for session tests:

  • Emits an initial system frame with the assigned –session-id.

  • Reads user messages from stdin, one JSON line at a time.

  • For each user message, emits an assistant frame echoing the user’s text, then a result frame with subtype=success.

  • Exits 0 on stdin EOF.

Behavior knobs via env vars:

  • FAKE_CLAUDE_DELAY_MS: sleep this many ms before emitting the result frame, to exercise WaitForIdle timing.

  • FAKE_CLAUDE_RESUME_ECHO: if set, the first emitted frame after a –resume flag is an assistant message with subtype=resumed_ack carrying the session ID, so tests can verify resume routing.

Index

Generated by gomarkdoc