Files
stack/scripts/hello.sh
T
jason.woltje 0734b1f3a5 fix(launcher): detach stdin on agent container run (#5)
pi print mode reads piped stdin until EOF; an attached terminal stdin
blocked the one-shot run forever. Automated contexts (closed stdin)
never exposed it. Request text comes from the compose command.

Proven: tail -f /dev/null | scripts/hello.sh now returns MOSAIC_HELLO_OK
in ~4s (previously timed out at 30s); verify.sh remains green.

Closes #5
2026-09-02 19:50:07 -05:00

23 lines
840 B
Bash
Executable File

#!/usr/bin/env bash
# Run the mosaic-agent service as a one-shot container and print the
# model response for the exact startup verification request.
#
# The request deliberately does NOT contain the expected marker
# MOSAIC_HELLO_OK. Only the model response is printed to stdout; no
# credentials or unrelated runtime data are printed.
set -euo pipefail
cd "$(dirname "$0")/.."
# shellcheck source=common.sh
source scripts/common.sh
load_config
bootstrap_runtime_dir
# -T: no pseudo-TTY, so stdout is clean model output.
# </dev/null: detach stdin. Pi's print mode reads piped stdin until EOF;
# an interactive terminal would otherwise block it forever. The request
# text comes from the compose command, not stdin, so nothing is lost.
# Errors, if any, go to stderr for diagnostics.
docker compose run --rm -T mosaic-agent < /dev/null