You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DOCS] Document the agent stream session_stats summary line #85
infer agent (the headless JSON-line stream mode of the CLI) now emits a final session_stats line when a session completes, summarizing token usage and dollar cost. This lets stream consumers (e.g. inference-gateway/infer-action) report real run cost without re-implementing the per-model pricing table.
message: human-readable status ("Session complete").
model: the model used for the run.
prompt_tokens / completion_tokens / total_tokens: summed across all turns/requests in the run.
requests: number of LLM requests (turns that reported usage).
cost: object with input, output, total, and currency (default USD). Computed from the configured pricing table; values are zeros when pricing.enabled: false.
Behavior notes:
Additive and emitted once at session completion; consumers should ignore unknown stream type values.
Always emitted in agent mode (no flag).
Single model per run (cost is attributed to the run's model).
Lint and format the changes (npm run lint:md, npm run format:check, npm run build all green)
Commit changes and provide PR URL
Summary
Added a new ### Headless Agent Stream Output subsection to cli.md (under Agent Modes), covering:
The JSONL stream contract for infer agent (one JSON object per line, type discriminator, additive, ignore-unknown-types guidance).
The session_stats summary line with a real example and a field-reference table for all top-level fields.
A nested Cost object reference table (input, output, total, currency).
The pricing.enabled: false zeros behavior - cost is always present so consumers get a stable schema.
Behavior notes: additive, emitted once on completion (including early errors), always emitted in agent mode (no flag), single model per run, ignore-unknown-types.
The placement keeps the new headless reference adjacent to the existing interactive Agent Modes (Standard / Plan / Auto-Accept), so the page now covers both interactive and headless invocations of the agent in one spot.
Build:npm run lint:md clean, npm run format:check clean, npm run build produces a static cli.html containing the new section.
Cross-repo impact
Pure docs change, scoped to inference-gateway/docs. No SDK, operator, gateway, or schemas impact.
Activity
edenreich commentedon May 29, 2026
@claude Can you document it? use /maintainer
claude commentedon May 29, 2026
Claude finished @edenreich's task in 4m 13s —— View job •
claude/issue-85-20260529-1605• Create PR ➔Task: Document the
session_statsstream linesession_statsdocumentation: fields, nestedcostobject, behavior notesnpm run lint:md,npm run format:check,npm run buildall green)Summary
Added a new
### Headless Agent Stream Outputsubsection tocli.md(under Agent Modes), covering:infer agent(one JSON object per line,typediscriminator, additive, ignore-unknown-types guidance).session_statssummary line with a real example and a field-reference table for all top-level fields.input,output,total,currency).pricing.enabled: falsezeros behavior -costis always present so consumers get a stable schema.agentmode (no flag), single model per run, ignore-unknown-types.The placement keeps the new headless reference adjacent to the existing interactive Agent Modes (Standard / Plan / Auto-Accept), so the page now covers both interactive and headless invocations of the agent in one spot.
Build:
npm run lint:mdclean,npm run format:checkclean,npm run buildproduces a staticcli.htmlcontaining the new section.Cross-repo impact
Pure docs change, scoped to
inference-gateway/docs. No SDK, operator, gateway, or schemas impact.· branch:
claude/issue-85-20260529-1605feat(agent): emit session_stats summary on stream completion (#553)
feat(agent): emit session_stats summary on stream completion (#553)
docs(cli): document the agent stream session_stats summary line