Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/cubeplexai/cubepi/streaminggit clone --depth 1 https://github.com/cubeplexai/cubepiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/cubeplexai/cubepi/streaming)<a href="https://agentmods.dev/agents/cubeplexai/cubepi/streaming"><img src="https://agentmods.dev/badge/agents/cubeplexai/cubepi/streaming.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00017 | $0.01554 |
| Opus 5 | $0.00009 | $0.00777 |
| Sonnet 5 | $0.00003 | $0.00311 |
| Haiku 4.5 | $0.00002 | $0.00155 |
Grade A, and why
streaming scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Streaming Events
CubePi exposes two streams, layered:
- Provider stream —
MessageStreamyou get fromprovider.stream(...). YieldsStreamEvents describing the raw wire output: text deltas, thinking deltas, tool-call deltas, thendoneorerror. - Agent event stream — what listeners registered with
agent.subscribe(...)see. Eleven event types covering the full lifecycle of aprompt()call, including provider events wrapped insideMessageUpdateEvent.
Most app code only needs the agent event stream.
The eleven agent events
| Event | Fires when |
|---|---|
agent_start |
At the very beginning of prompt() / resume() |
turn_start |
Before each model invocation (one or more per prompt) |
message_start |
Right before a new message (user / assistant / tool result) is added to history |
message_update |
On every provider StreamEvent (deltas, etc.); has event.stream_event attached |
message_end |
After a message is finalised |
tool_execution_start |
A tool call is dispatched (one per call, before parallel asyncio.gather) |
tool_execution_update |
A tool reported partial progress via on_update(...) |
tool_execution_end |
A tool finished (or failed) |
turn_end |
After all tools in a batch settled, or after a tool-less assistant response |
agent_end |
The whole prompt() call has finished — clean exit, abort, or error |
MessageStartEvent and MessageEndEvent apply to every message,
not just assistant ones. User and tool-result messages also get them.
Event order for a tool-using turn
A typical "user asks question → model calls one tool → model responds" sequence:
agent_start
turn_start
message_start (UserMessage from prompt)
message_end (UserMessage)
message_start (AssistantMessage — empty partial)
message_update × N (text_delta, toolcall_delta, …)
message_end (AssistantMessage — finalised)
tool_execution_start
tool_execution_end
message_start (ToolResultMessage)
message_end (ToolResultMessage)
turn_end
turn_start (loop continues with the tool result in context)
message_start
message_update × N
message_end
turn_end
agent_end
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 172 lines · 17 tokens per session scan A 8e4d60fa6a70
streaming is an agent published in the GitHub repository cubeplexai/cubepi (43 stars, last pushed 2d ago), licensed MIT. It adds 17 tokens to every session and 1,554 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
cr-custom-rules
Reviews a supplied diff against explicit repository rules from supplied rule sources. Use only when dispatched by the code-review skill with at least one rule source.
cr-security
Reviews a supplied diff for introduced, practically exploitable security vulnerabilities. Use only when dispatched by the code-review skill.
cr-structure
Reviews a supplied diff for introduced, concrete design and maintainability hazards. Use only when dispatched by the code-review skill.
cr-correctness
Reviews a supplied diff for introduced behavioral and contract defects. Use only when dispatched by the code-review skill.
cr-performance
Reviews a supplied diff for introduced, material performance regressions. Use only when dispatched by the code-review skill.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.