Repository navigation
docs: Cortex laptop observability — read the numbers, first-run path, troubleshooting - #2551
Conversation
…leshooting Add the Cortex v0.9.0 laptop-tool documentation for the observability release (rossoctl/cortex#962). Written against the v0.9.0 target UX (install.sh, `abctl observe`, `abctl service`, tool pruning); each point not yet verifiable against a shipped binary carries a `VERIFY v0.9.0` comment for the outside-reader check that backs exit criterion 5. - New `get-started/reading-the-numbers.md`: the value case, the abctl keys and the `/` filter, the five token categories, why cache-read and cache-write are priced apart, how to read cost, latency and the tool-pruning savings (including what a zero means), and a worked example. Addresses cortex#963, cortex#844 and cortex#867. - `get-started/laptop.md`: complete the first-run spine — a read-the- numbers step, a stop-and-remove step, and the `/` filter. cortex#959. - `operate/troubleshooting.md`: a laptop section (CA not trusted, port 47600 in use, service will not start, another tool broke, no events, numbers wrong, where the logs are). Splits the page into laptop and Kubernetes parts. cortex#960 and cortex#961. - Wire the new page into the concepts index, the RossoCortex page, the context-compaction page, the observability page and both landing pages; renumber the get-started sidebar. STE100 throughout. All internal links and anchors resolve. Assisted-By: Claude Code Signed-off-by: Mariusz Sabath <[email protected]>
Point users at the Laptop feedback form on rossoctl/cortex from the end of the laptop quickstart, the read-the-numbers page and the laptop troubleshooting section. A user looking at the numbers is the user most likely to have feedback, so the docs now ask for it where that happens rather than only in a related-links list. Pairs with the abctl footer link (cortex#975) and the issue form (cortex#977); all three point at the same place. Part of cortex#977. Assisted-By: Claude Code Signed-off-by: Mariusz Sabath <[email protected]>
|
Added a commit ( |
huang195
left a comment
There was a problem hiding this comment.
Dobra — the shape of this is genuinely good, and I want that on the record before the red ink. Splitting troubleshooting into laptop-then-Kubernetes with the heading levels pushed down correctly, the four-decisions framing at the top of the new page (find an expensive prompt / see whether caching operates / catch a session that does not end / decide whether to prune), the cache-write-repeating-with-no-cache-read diagnosis, and the VERIFY v0.9.0 markers sitting on exactly the claims that depend on unlanded issues — that is someone writing for a reader rather than for a checklist. The sidebar_position renumbering is also complete and collision-free (clean 1→8 across all eight pages, I checked), which is the thing that usually goes wrong in a PR like this.
Then I fact-checked the checkable claims against rossoctl/cortex@main, and four of them do not survive:
| Claim | Reality |
|---|---|
y writes "to a file in /tmp" |
~/.cortex/abctl-events/<timestamp>-<rand>.json |
/ is "a substring match on the method… not a query language" |
matchEventRow matches a haystack of many event fields, and supports deny and plugin:<name> |
| "five categories, because each has a different price" | numTiers = 4 — input, cache-write, cache-read, output |
| unrecognised model → "its cost is zero" | inverted; a non-positive cost is deliberately not priced |
The first two are in a keys table and a filter paragraph — the parts a reader trusts most and verifies least. Someone presses y, goes rummaging in /tmp, and concludes the feature is broken; someone else reads that / only matches the method and never finds deny or plugin:<name>. Cheap to fix, expensive to ship, hence the block. Details inline.
Things I checked that are right, so you do not have to re-verify them: ~/.cortex/ca/ca.crt (I was suspicious because ca/bundle.crt also exists in the tree — it is the outlier), the x-litellm-response-cost header name, and the 47600/47601/47602 port split.
On the red X, which is not yours. Ollama Model Drift fails with doc not found: .github/scripts/docs/check-ollama-model-drift.sh hardcodes docs/demos/demo-weather-agent.md, and docs/demos/ does not exist on main at all any more. docs-ci.yaml is path-filtered to **.md/docs/**, which is why #2548–2550 show n/a for that check and your docs PR is the one holding the bag. Nothing to change here — it wants a one-line path fix (or a deletion) in its own PR, otherwise every docs PR from now on is red.
| | `Esc` | Return to the previous view | | ||
| | `/` | Filter the events | | ||
| | `p` | Pause and resume the stream | | ||
| | `y` | Write the event to a file in `/tmp` | |
There was a problem hiding this comment.
must-fix — two rows of this reference table send people the wrong way, and a reference table is the one thing readers will not second-guess.
y writes to ~/.cortex/abctl-events/<timestamp>-<rand>.json, not /tmp. cortex's own abctl README says so in three separate places, including its deferred-work list ("Native clipboard (currently writes a file under ~/.cortex/abctl-events)").
/ (line 71) is described in a way that is actively wrong rather than merely incomplete. events_pane.go:matchEventRow builds a haystack from many event fields and matches your substring against all of them, so "a substring match on the method" is not what happens. And there are exactly two query forms that the paragraph tells people do not exist:
deny— matches denied eventsplugin:<name>— matches events carrying that plugin's record
Those are the two filters an operator actually reaches for, so they are worth documenting rather than denying. The same method-only sentence appears in laptop.md:57, so both need the same edit.
| ## Read the tokens | ||
|
|
||
| A model call has a cost in tokens. Cortex separates the tokens into five categories, because each | ||
| category has a different price. |
There was a problem hiding this comment.
suggestion — "five categories, because each category has a different price" is four categories. pricing/rates.go has numTiers = 4: TierInput, TierCacheWrite, TierCacheRead, TierOutput. There is no reasoning tier.
Your own table row on line 86 already says as much — "a part of the output on some models" — which contradicts the premise one paragraph above it. The worked example then lists "Reasoning tokens 3,100" as its own row, implying Cortex reports it separately.
Either fold it into a note under Output, or say plainly that reasoning tokens are billed as output and Cortex does not price them apart. The second reads better and is true.
| - **The cost is an estimate, unless the provider returns an exact figure.** Cortex computes the cost | ||
| from published rates for each model. When the provider returns an exact cost (for example, the | ||
| `x-litellm-response-cost` header from LiteLLM), Cortex uses that figure instead. | ||
| - **The rates come from a table for each model.** A model that Cortex does not recognize has no rate, |
There was a problem hiding this comment.
suggestion — "A model that Cortex does not recognize has no rate, so its cost is zero even when its token counts are correct" is backwards, and it happens to describe the precise behaviour the code exists to prevent.
costevent.Decode refuses to treat a non-positive cost as priced, with the reasoning in the comment: "free" and "unknown" must not be conflated, because a consumer that treated 0 as priced would render $0.00 for traffic it simply cannot price. So an unpriced model shows no cost, not a cost of zero.
That is also the better story: the tool admits it does not know, rather than quietly claiming the call was free.
| - **The token count is zero.** RossoCortex reads the token counts from the reply of the model. A | ||
| reply that Cortex cannot parse gives no counts. Confirm that the model is an OpenAI-compatible or an | ||
| Anthropic endpoint. | ||
| - **The cost is zero, but the tokens are correct.** Cortex has no rate for that model. See |
There was a problem hiding this comment.
suggestion — same inversion as the one on reading-the-numbers.md:114: "The cost is zero, but the tokens are correct." What a user actually sees is a missing cost alongside correct tokens.
Worth fixing here especially, because this is the page someone lands on when the number confuses them — and "no cost shown" versus "a cost of zero" is exactly the distinction they arrived to resolve.
Review fact-checked the checkable claims against rossoctl/cortex@main and found four wrong. All verified against the source and corrected: - `y` writes to ~/.cortex/abctl-events/, not /tmp (const yankDirRel). - The `/` filter is a text match across many event fields (host, method, plugin, reason, path, content), not the method alone, and special-cases `deny` and `plugin:<name>`. Documented all three, in reading-the-numbers and laptop.md. - Pricing has four tiers (input, cache-write, cache-read, output), not five. Reasoning tokens are captured but are a part of output, not a priced tier. - An unrecognized model shows no cost, not a zero — a non-positive cost is deliberately not rendered. Fixed in the cost section and in the troubleshooting "numbers are wrong or absent" entry. Addresses review on #2551. Assisted-By: Claude Code Signed-off-by: Mariusz Sabath <[email protected]>
|
Thank you for the fact-check, @huang195 — every one of the four held up when I traced it to source, and these were exactly the claims a reader trusts and does not verify. Fixed in I re-read each against
The reasoning-token row stays in the worked example (it is a real captured count), just no longer billed as its own tier. STE100 kept; the On the two things that are not the text:
The three |
huang195
left a comment
There was a problem hiding this comment.
No dobra — all four blockers from my last pass are in, and I re-verified every one against rossoctl/cortex@main rather than taking the commit message's word for it:
| Claim | Verified |
|---|---|
y → ~/.cortex/abctl-events/ |
tui/app.go: const yankDirRel = ".cortex/abctl-events", with its own "Not os.TempDir()" comment explaining why |
/ matches many fields; deny and plugin:<name> are the two special forms |
matchEventRow — exactly those two, then substring over eventHaystack. Structure is right; see the inline note on the example |
deny = events a plugin denied |
eventMatchesDeny: Phase == SessionDenied or any Action == ActionDeny. Accurate |
| Four priced categories, reasoning folded in | numTiers = 4, and the wording now matches pricing.Usage's own comment ("Reasoning is omitted (a subset of Output, already counted)") |
| Unpriced model → blank cost, not zero | Both sites fixed. "A blank cost with correct tokens means the model is unpriced, not free" is exactly the costevent.Decode distinction |
Two unasked-for improvements worth naming, because they show the fix was understood rather than pattern-matched: the token table reordered to input → cache-write → cache-read → output, which now matches the Tier iota order in rates.go; and laptop.md got a cross-link to the filter explanation instead of a duplicated half-sentence, so there is one place to keep correct instead of two.
The new feedback commit checks out too, including the claim most likely to have been invented: .github/ISSUE_TEMPLATE/laptop-feedback.yml really exists in cortex with name: Laptop feedback, so /issues/new/choose will show it. And "the form asks for each item in the list above" holds — all five map to a field (abctl --version → Cortex version, abctl service status and the log → Service status and logs, uname -sm → Operating system and architecture, agent+model → Agent and model).
Approving, since this is still a draft and the one real problem left is a single identifier. But it does need fixing before this leaves draft, alongside the VERIFY v0.9.0 markers you already have queued: plugin:jwt-validation names the one plugin in the tree that publishes no plugin-public record, so the only example of that filter returns an empty list. Details inline.
On the red X, still not yours. Ollama Model Drift fails identically to three days ago — check-ollama-model-drift.sh hardcodes docs/demos/demo-weather-agent.md, and I re-confirmed docs/demos/ is a 404 on main. Nothing to change here, but it has been red for three days and every docs PR inherits it, so someone should land the one-line path fix or delete the check.
Assisted-By: Claude Code
| Two searches are special: | ||
|
|
||
| - `deny` shows only the events that a plugin denied. | ||
| - `plugin:<name>` shows only the events that the named plugin acted on. For example, `plugin:jwt-validation`. |
There was a problem hiding this comment.
fix before leaving draft — you fixed my filter complaint by documenting plugin:<name>, and then picked the one plugin in the entire tree that cannot be found that way. I laughed, then checked twice, because I did not believe it either.
matchEventRow resolves plugin: as an exact lookup in r.event.Plugins, and SessionEvent.Plugins is populated only from Extensions.Custom entries written with PluginEventSuffix ("/event") — an opt-in for plugins that publish a plugin-public record. jwtvalidation/plugin.go never writes Extensions.Custom; it has four pctx.Record(pipeline.Invocation{...}) calls, and Record populates Invocations, a different field entirely. So Plugins["jwt-validation"] is never set and this filter returns an empty list, every time.
The extra sting: jwt-validation events are findable — by typing the bare jwt-validation, because eventHaystack includes iv.Plugin. So for your example plugin the plain search works and the special syntax does not, which is exactly backwards from how the bullet reads.
Swap in a plugin that publishes a record. Both verified:
plugin:tool-prune—toolprune/event.gowritesCustom[p.Name()+PluginEventSuffix],Name()returns"tool-prune", and the listener strips the suffix, so the key really istool-prune.plugin:cost—costevent.Key = "cost". Note this one is a record name rather than a plugin name, so "the named plugin" is doing a little work in that sentence if you want it strictly true.
Same reason as the last round: this is a copy-pasteable instruction in a reference section. The reader types it, gets nothing, and concludes the filter is broken rather than that the docs picked a bad example.
| | Cache read | 486,000 | | ||
| | Cache write | 61,200 | | ||
| | Output tokens | 8,900 | | ||
| | Reasoning tokens | 3,100 | |
There was a problem hiding this comment.
suggestion — the prose fix above is exactly right ("They are a part of the output count, not a fifth priced category" matches pricing.Usage's own comment almost word for word), but the worked example did not get the memo:
| Output tokens | 8,900 |
| Reasoning tokens | 3,100 |Sibling rows, with no hint that one is inside the other. A reader who sums the token rows double-counts 3,100, and nothing on the table says whether 8,900 already contains it. | Reasoning tokens (part of the output) | 3,100 | and you are done — last loose thread from the four-versus-five fix.
| | `q` or `Ctrl+C` | Quit | | ||
|
|
||
| The `/` key filters the events by a **text match**. For example, `messages` shows only the events | ||
| that contain that text. The match covers many fields of an event, not the method alone — the host, |
There was a problem hiding this comment.
nit — the six-field list is accurate, but eventHaystack also covers Identity.Subject, Identity.ClientID, and every invocation Details key and value — the source comment there specifically calls out searching target_audience and its value.
"Every event from this caller" and "every event where this plugin wrote this detail" are the two searches an operator reaches for on day two, and they are the two the list omits. A trailing "…and the caller identity, and any diagnostic detail a plugin recorded" would cover it.
What & why
Documentation for the Cortex v0.9.0 laptop tool, the observability release (rossoctl/cortex#962). It gives a first-time user, on their own workstation, everything needed to install Cortex, watch a session, and understand what the numbers mean and why the tool is worth leaving running. This backs the epic's exit criterion 5 — a new user self-serves from the docs alone.
Written against the v0.9.0 target UX (
install.sh,abctl observe,abctl service, tool pruning). Where a detail is not yet verifiable against a shipped binary, an HTMLVERIFY v0.9.0comment marks it for the outside-reader check.Sub-issues addressed
get-started/reading-the-numbers.mdget-started/laptop.mdspine: install → observe → read → stopoperate/troubleshooting.mdget-started/; troubleshooting split laptop / Kubernetes/filterThe new page
get-started/reading-the-numbers.mdcovers:abctl observeviews and keys, including the/filter.Concepts extension
The new page is wired into
concepts/index.md(a new Core row), theRossoCortexpage, thecontext-compactionpage,observability.md, and both landing pages. The get-started sidebar is renumbered to seat the new page after the laptop quickstart.Notes for reviewers
VERIFY v0.9.0comments name the exact things to confirm against a shipped binary (install command,abctl observe/service, CA path, log paths, rate source, and the local-only claim relative to the opt-in central-collector feature #898).METHOD name filter…. That is a code change incortex, out of scope here; the docs describe the current behaviour.Acceptance tier
Checklist
Assisted-Bytrailer, noCo-Authored-ByVERIFY v0.9.0markers confirmed against a shipped binary (blocks leaving draft)Assisted-By: Claude Code