Documentation
¶
Overview ¶
Package streamevent emits diagnostic JSON-line events on stdout so observers (the inference-gateway/infer-action runner, log scrapers, human eyeballs in CI) can see internal agent lifecycle moments that are otherwise silent - system reminder injections, conversation compaction triggers, and similar checkpoints.
Events are HIDDEN BY DEFAULT and only emitted when the global logger is configured at debug level (via `--verbose`, `logging.debug=true`, or env var `INFER_LOGGING_DEBUG=true`). This keeps normal `infer agent` runs quiet on stdout while letting operators turn on the firehose when they need to diagnose.
Two shapes are emitted:
EmitDebugMessage mirrors a real conversation message (`role`, `content`) with `hidden: true` and a `kind` discriminator. Use this when surfacing an internally-injected message the LLM received - e.g. a hidden user-role system-reminder turn.
EmitDebugEvent emits an operational lifecycle event keyed by `type`, not `role`. Use this for things that aren't conversation turns at all - e.g. "auto-compaction crossed the token threshold".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitDebugEvent ¶
EmitDebugEvent writes a JSON-line describing an operational lifecycle event keyed by `type`. Used for things that are NOT conversation messages (e.g. compaction triggers, token-threshold crossings).
No-op unless debug is enabled (see package docs).
func EmitDebugMessage ¶
EmitDebugMessage writes a JSON-line that mirrors the shape of a normal conversation message but flagged `hidden: true` and tagged with a `kind` discriminator so observers can distinguish it from real conversation turns. Used to surface internally-injected messages (e.g. the hidden user-role system-reminder appended every N turns) that the user would not otherwise see.
No-op unless debug is enabled (see package docs).
func SetDebugEnabledForTest ¶
func SetDebugEnabledForTest(enabled bool) func()
SetDebugEnabledForTest forces the debug gate to a specific value, bypassing the global-logger probe. Returns a restore function. Test-only.
Types ¶
This section is empty.