Skip to content

feat: hosted caller-pays service, security fixes, performance, and observability - #79

Merged
OsherElhadad merged 126 commits into
mainfrom
feat/hosted-tls-and-agent-compaction
Aug 17, 2026
Merged

OsherElhadad merged 126 commits into
mainfrom
feat/hosted-tls-and-agent-compaction

Conversation

@OsherElhadad

Copy link
Copy Markdown
Collaborator

Lands the nine reviewed PRs (#69, #78, #71–#77) on main. No new code: this branch's content is byte-identical to the integration tree those PRs were verified against.

What is in it

Area Change
Credentials Breaking: the caller's own provider key is forwarded upstream; a request without one is refused 401. The per-tenant spend cap is deleted — an account spending its own credential needs no cap from us.
Accounts Email + password (argon2id) with a 5-minute emailed code as a second factor, multi-machine sessions, self-service and manager-initiated password reset.
Security 14 confirmed findings from two adversarial reviews, each with a test that failed first: unauthenticated account takeover via re-registration, agent-key hijack, a redaction rule that never matched JSON, an unenforced hosted-mode capture refusal, cross-tenant cost attribution, an absent row quota, CSRF, account enumeration, a second credential exit, unmetered routes, clickjacking, cookie forwarding, and an agent-key guessing oracle.
Performance The rewrite path was ~91% harness, not components: 15.6 → 6.85 ms per median real request, allocations −66%, per-component duration_ms −39%, byte-identical output over 1,868 real captured requests.
Observability Structured logging with a credential-scrubbing handler, Loki + promtail, per-request metadata (reasoning effort, cache breakpoints split by location), a Usage tab, and manager-gated Grafana at /grafana/.
Product Dashboard redesign, user feedback with manager-only aggregates, full manager control over accounts including purge and delete across both databases.
Agents Bob works through the proxy for the first time. It sends Authorization: Apikey, which the credential reader did not accept, and it rewrote its own base URL's host from the profile region while keeping our port — so its second call left the box to a port nothing listens on.

Verification

go test -race ./... green across 25 packages · go vet and gofmt clean · mkdocs build --strict clean and byte-reproducible · WCAG AA measured on painted backgrounds (642 pairs, 0 failures) · tenant isolation probed live across all 18 routes including crafted ?tenant= · credential scrubbing proven against planted secrets in deliberately careless log shapes · end-to-end with Claude Code, Bob and an OpenAI-dialect client against a hosted instance.

Deployed

This is running on the internal deployment: caller-pays live (boot with zero key_env, which the previous build could not do), DEBUG logging on, the 8-character password floor served, Grafana gated and fail-closed, and the log file feeding Loki again.

Known gaps, stated rather than buried

  • Email delivery to an inbox is unconfirmed. The relay accepts on port 25 with STARTTLS and full verification; nobody has seen a message arrive.
  • Token reduction does not pay on warm sessions. Measured total_fresh_input of 240 tokens against 8,357,617 cache-read — 0.0028% of billable input. cmdfilter's real unique saving was 2,105 tokens against a 24.8× gross overcount. A two-arm benchmark at one trial per task cannot resolve a 40% cost swing against ±14% step variance.
  • Base64-encoded and prefix-less opaque credentials still pass the log denylist; that is a structural limit of pattern matching and is documented rather than papered over with speculative patterns.

Osher-Elhadad added 30 commits August 16, 2026 07:47
Claude Code and Bob both compact their own conversation when context fills.
Both compute the trigger from the API response's usage rather than a local
count of their transcript, so our reduction already delays it — but three
things went wrong when it fired.

We compacted the compactor. The pipeline ran on the agent's own
summarization request, so the summarizer was asked for verbatim fidelity
("full code snippets", "preserved verbatim") over text we had already
replaced with <<cg:HASH>> stubs. Unrecoverable, because the agent then
discards the pre-compaction history. Detect it on the LAST user message only
and forward byte-identical; last-message scoping is what stops the phrase
latching for the rest of the session.

We could disable Claude Code's auto-compact for a whole session. The expand
tool was advertised whenever a request carried tools, including the
compaction request, so an unresolvable call made the summary read as empty —
and three failures trip a circuit breaker that turns auto-compact off, after
which the agent walks into the upstream's hard prompt_too_long. Advertising
and interception are now one condition: both require markers.

One conversation showed up as two sessions, because the derived session id is
sha256(system+firstUser) and compaction changes the first user message. Read
the id the agents already send — metadata.user_id for Claude Code (a JSON
object needing session_id unwrapped, not a bare uuid), metadata.taskId for
Bob — ahead of the derived fallback.

That last fix then exposed a worse bug: the cached-prefix boundary only ever
grew, so with a stable id a transcript shrinking 50 messages to 5 left
maxCachedIdx at 49 and froze the whole new transcript permanently. Route both
boundary paths through modes.Boundary, which restarts the prefix on any
shrink. Frozen decisions and result caches are content-hash keyed and stay
valid, so history remains readable and expandable; only the position-encoded
boundary resets. Surfaced as compaction_resets on /stats.

A bypassed turn now records its length too. The provider caches whatever we
forward, so skipping the record left the next turn rewriting messages the
provider had just cached and paying a full cache-write — the cost of a
false-positive bypass was never confined to the bypassed request.

Signed-off-by: Osher-Elhadad <[email protected]>
… end created

Adds the hosted control plane: token-authenticated tenants, per-tenant
pipelines and stores, an upstream allow-list (names only — a user never
supplies a URL, which is the difference between a proxy and an
unauthenticated forwarder), per-tenant spend caps, rate limits and a
Prometheus exporter. Off unless --upstreams is given, so single-tenant
deployments and the benchmark harnesses are unchanged.

Two things only became wrong once nginx terminated TLS in front, and both
were found by probing the deployed service rather than by reading code.

/stats and /metrics were readable by anyone on the network. They are
service-wide aggregates over every tenant, gated on the caller being on this
host — but behind a reverse proxy EVERY request has a loopback peer, so the
gate stopped meaning anything the moment it was deployed. Observed live:
an unauthenticated GET /stats returned the full rollup. A loopback peer is
now trusted only when it did not relay someone else, using the forwarded
headers as the tell; that direction is safe because a remote caller cannot
forge a loopback RemoteAddr. Fails closed: a front end that sets none of
those headers loses /stats rather than silently exposing it. Local ops and
the Prometheus job on 127.0.0.1:4000 send no forwarded headers and keep
working, and MetricsToken still allows a remote scrape.

The 502 body echoed err.Error(), which for http.Client is a *url.Error
stringifying as `Post "<full upstream URL>": ...`. That handed every caller
the operator's upstream address, and would have handed them a credential
too: checkBaseURL rejects userinfo for hosted upstreams, but the
single-tenant --anthropic-upstream/--openai-upstream flags are not
validated. The caller now gets a fixed string; the detail stays in the
operator's log line.

Signed-off-by: Osher-Elhadad <[email protected]>
…sfires

extract_llm could send a prompt larger than its extraction model's window.
The upstream 400'd, the error was discarded, and the output stayed verbatim —
so it cost a round trip every turn and reported nothing. Pre-flight the
shown-body token count against a per-model limit, reserve room for the reply,
and decline with an over_model_context gate rather than putting an
oversized request on the wire. No message is dropped and no user turn is
touched: the component works one tool output at a time, so "shed older
messages" had nothing to act on here.

toon joins the codesmart default, and now refuses ambiguous arrays instead of
silently changing their meaning — it was typed lossless while being lossy.

failed_run's markers are anchored to line starts. Unanchored, they matched
"FAILED" anywhere in a body, so ordinary source files were mislabelled as
superseded test runs and dropped.

cmdfilter's goal text is clipped on rune boundaries, not bytes.

Signed-off-by: Osher-Elhadad <[email protected]>
Per-tenant scoping on every /api/* handler (set, never merged, so a crafted
?tenant= cannot widen it), per-tenant SSE topics, disk-pressure eviction with
hysteresis, spend accounting, and migration of old sessions to cold storage
so retention is bounded by the remote rather than this filesystem.

The before/after diff is the point of the thing, so it is per request and per
session, with exact ordered per-component attribution and the JSON path each
change landed on. Cold content is fetched lazily — opening a session costs no
remote call, clicking one costs exactly one.

Two filter bugs made search unusable rather than merely awkward. State was
rebuilt from the DOM, so the session filter was sticky and invisible and a
manager's tenant filter was silently dropped; and each facet was scoped by
its own column, which turned every dropdown into a one-way door that only
Clear could undo. Both fixed at both layers.

Also: a real race between /stats and the observe workers, which handed out
the live gate histogram while it was being written; and several places where
the dashboard asserted something false rather than admitting a gap — a
"Messages rewritten: 0" that contradicted its own table, and an empty-state
that deleted the evidence contradicting it.

Signed-off-by: Osher-Elhadad <[email protected]>
…not lie

deploy/service/ is the whole deployment: a cg system user, systemd units with
credentials loaded from disk rather than the unit file, nginx terminating TLS,
an optional Prometheus + Grafana pair, and cold-storage setup.

nginx has deliberately NO port 80 block. Every request carries the user's
token in a header, and a 301 to https arrives after the client has already put
that credential on the wire in cleartext — a redirect cannot retract it. So a
mistyped http:// must fail to connect, which is also what the granted firewall
exception allows. install.sh now reports anything listening on 80, because the
distro nginx.conf ships a default server there and a package upgrade can put
it back.

install.sh verifies the certificate rather than the existence of two files: it
checks the key matches, that fullchain carries its intermediate (without it,
browsers that cached the intermediate elsewhere succeed while every agent
fails), and that expiry is more than 21 days out. Its subcommands now exit
non-zero when they print a failure — `install.sh nginx && echo deployed` used
to report success on a box with a broken chain and an open port 80.

tls-smoke.sh checks the public path end to end, and every negative assertion
goes through a reachability probe first. A check of the form "this request
failed, therefore the server refused it" passes just as happily when the box
is powered off, and an all-clear produced by the absence of a service is the
worst output a smoke test can give.

Both benchmark harnesses take CG_BENCH_PORT and refuse to start when the port
is taken. The hosted service now owns 4000 permanently; when that clashed the
harness proxy never started, every container got "Connection refused", and the
summary reported solved=0 — indistinguishable from a model failure.

Signed-off-by: Osher-Elhadad <[email protected]>
…loy the service

Adds tenant/: the control database (tenants, tokens, per-tenant config, audit),
token minting where only sha256(token) plus an 8-character display prefix is
ever stored, and browser sessions. A new tenant TRACKS the server default
rather than being stamped with a copy of it — copying froze every account on
the default as it stood on their registration day, and there was no way to ask
for "just follow the default". The default is deterministic codesmart: no
cheap-model calls, so a new account adds no upstream spend and no latency to
anyone else's agent. Transcript capture is on by default so the diff view works
on the first request, and a tenant can turn it off; content is visible only to
the tenant that produced it, never to a manager.

Docs: a new "Connect to the IBM service" page — registration, the once-shown
token, adding the internal root CA on a machine that does not already trust it,
and the three agent setup blocks. Then the part people need day to day: turning
the proxy on and off for ONE session without editing any config file, for both
Claude Code and Bob, keeping the metrics while skipping the compaction, and a
way to prove it is really on.

That last part is not paranoia. An env block in ~/.claude/settings.json
silently overrides an exported ANTHROPIC_BASE_URL, and the failure looks
exactly like success: Claude Code answers normally, nothing errors, and the
only symptom is an empty dashboard and zero savings because the traffic never
arrived. The honest test is to point the client somewhere unroutable and
confirm it FAILS.

docs/how-to/agent-compaction.md records what the two agents actually do, with
citations into the shipped clients, and is explicit about the two things the
guard does NOT cover — an earlier draft described detection the code does not
implement, which a reader would fairly have taken as shipped behaviour. It also
states plainly that suppressing compaction by under-reporting usage would work,
and that we refuse to, because those same fields feed the user's own cost
display and the client's hard-limit check.

Deployment steps are derived from the scripts rather than remembered, and
include what to change outside IBM: certificate authority, firewall exception,
registration policy, spend caps.

Signed-off-by: Osher-Elhadad <[email protected]>
…st correlation

The proxy had slog calls but no logging: no handler was ever installed, so DEBUG
went nowhere, and the only per-component lines came from metrics.Slog at INFO with
neither tenant nor session on them — several lines per request, burying the request
itself.

Four things:

- internal/logging owns the level/format/sink decision (CG_LOG_LEVEL,
  CG_LOG_FORMAT, CG_LOG_FILE) and installs the default handler. Local use needs no
  configuration: text on stderr. CG_LOG_FILE adds a JSON sink for a log shipper and
  is the ONLY thing that makes logs leave the box. CG_LOG_PLAIN=1 opts out
  entirely, swapping in the stdlib's own text handler.

- Credentials are scrubbed on the way OUT, so a careless call site added later
  cannot leak one — which matters more now that the caller's own provider key
  flows through request handling. A ReplaceAttr covers attribute values (including
  the ones baked in by Logger.With) and a wrapper handler covers the message.
  The patterns are the ones dash already used: they moved to internal/redact and
  dash/redact.go delegates, because two copies of a credential denylist is one
  copy that goes stale.

- Every line of one request's lifecycle carries the tenant id — never its token —
  and, from the point apply resolves it, the session. The logger travels in the
  request context, which is why no component signature changed.

- The lines say what was DECIDED, not just what happened: one INFO per request,
  and at DEBUG the cached-prefix boundary, the bypass gate, the expand loop's
  resolved-against-unresolved counts, why a stream had to be buffered, and one
  line per component with its verdict, token delta and the gates that turned
  candidates away. Those gate names and counts are read off the same Report.Gates
  map /stats sums into components.<name>.gates, so a log line and the metric
  cannot disagree.

Signed-off-by: Osher-Elhadad <[email protected]>
…aveats

Every how-to now opens with what it achieves, then numbered copy-pasteable
steps, with the detail moved into a collapsible Troubleshooting section
(<details markdown="1">, which renders in mkdocs-material and in plain
markdown alike).

- how-to/agent-compaction.md: cut from an investigation log to a short
  user-facing page. The needle table implied the guard covers more than
  proxy/agentcompaction.go does; it is two substring matches against the
  last user message only, so the page no longer describes Bob's
  messages[0] signal or its other side-prompts as handled.
- integrations.md: stop recommending mask for long Bob sessions. Bob sends
  no tools array and parses tool calls as XML from streamed text, so it can
  never expand a <<cg:HASH>> marker — every lossy component is permanent
  loss there. Recommend the lossless set instead.
- Drop the ancestor-of-today's-codesmart warnings, the was-broken-in-#NN
  forensics, the withdrawn-claim notes and the still-unverified sections
  from RESULTS, results/*, cacheinject, cmdfilter, dsl, failed_run,
  extract_llm and dashboard, keeping the user-facing consequence of each.
- improvement-plan: the -14% cross-session prefix repair was refuted; the
  page no longer cites it as a measured lever.

Signed-off-by: Osher-Elhadad <[email protected]>
…the spend cap

The hosted proxy injected a SERVER-HELD upstream key for every tenant, which
bills every user's traffic to one account. It now forwards the credential the
caller's agent already sends, so each user's spend lands on their own provider
account.

Identity moves out of the auth slot, because the auth slot is now the caller's
key. `x-context-guru-token` carries the token, and copyHeaders already strips
every x-context-guru-* header before forwarding, so it cannot leave the box. A
token presented in an auth slot is still accepted — some tools have nowhere else
to put it — and is scrubbed on the way out, recognisable because only our tokens
are shaped cg_live_ + 26 characters.

Bob (BobShell) can carry no header of ours: its client builds Content-Type,
User-Agent, Authorization, x-instance-id and x-team-id itself, and its `headers`
setting applies to MCP servers only. So it is identified by sha256 of the
provider key it already sends, bound once via POST /api/me/agent-key. Only the
digest is stored; the key is never inserted, selected or logged. Agent-family
detection is unchanged — it reads the User-Agent.

A caller with no credential of their own gets a 401. That is the one thing that
must never become a fallback onto whatever key the box holds.

Server-held keys remain supported as an explicit per-upstream `key_env` — the
eval-containers gateway and local single-tenant use — and are no longer required
to boot. Upstreams stay an allow-list of operator-configured names.

The LLM-calling components now spend the caller's credential too: incomingModel
prefers it, the "config"-source cheap model is withheld in hosted mode, and a
tenant config that pins a model with no api_key no longer falls back to the
process's ambient provider key. All three fail OPEN — no credential means no
client and the component degrades, never an error.

The monthly cap goes entirely: monthly_cap_usd, the 402 path, the spend cache,
the Settings meter, the manager's Set cap button, the Prometheus gauge and the
Grafana panels. It only existed because one shared key was being spent. Cost
tracking and display stay.

Signed-off-by: Osher-Elhadad <[email protected]>
The published site used Material for MkDocs and looked nothing like the rest of
our work. This ports the design system already in production on the cap-evolve
site — dark-first CSS custom properties with a light override on
`html[data-theme]`, one hand-written stylesheet, one small vanilla-JS file, no
framework and no CSS from a CDN.

MkDocs core stays as the Markdown engine, so `docs/**/*.md` is still the only
source of prose and nav, TOC, breadcrumbs, prev/next and the search index are
still generated. What changes is the chrome: `theme/` is now a real MkDocs theme
(`base` + `main` + `home` + `404` + a recursive nav partial) instead of a pile of
overrides fighting Material's own layout, and mkdocs-material is no longer a
dependency.

Also fixes the two mermaid diagrams that rendered "Syntax error in text" on the
live site:

  - dashboard.md used `API[/api/*]`, which mermaid lexes as an unterminated
    parallelogram (`[/ ... /]`) rather than a label. Quoted.
  - design.md used `call` as a node id, and `call` is a reserved keyword in the
    flowchart grammar (`click X call fn()`), so the edge `stat --> call` parsed as
    a callback binding. Renamed to `complete`.

All 20 mermaid blocks in docs/ now parse under mermaid 11, and diagrams are
themed from the same custom properties as the page and re-rendered on a theme
flip instead of shipping one hard-coded palette.

Accessibility and layout, measured rather than asserted:

  - every text node on eight representative pages is at or above WCAG AA against
    its actual painted background, in both themes. Fixing that turned up two real
    bugs: white text on `--accent` was 3.68:1 (now a dedicated `--accent-strong`
    at 5.2:1), and `.doc code` outranked `pre code`, so in the light theme every
    code block painted the light inline-code chip behind its own dark surface and
    the dark syntax colours landed on near-white.
  - zero horizontal body overflow on all 57 pages at 360/768/1024/1440px. Wide
    tables scroll inside their own container, wrapped for every page by a build
    hook rather than by hand in 55 Markdown files.

Signed-off-by: Osher-Elhadad <[email protected]>
The default hosted pipeline ([format, dedup, failed_run, cmdfilter, extract,
cachesplit], sync) spent most of its CPU re-doing work it had already done. A
CPU profile over 24 real captured Claude Code requests (median 600 KB, 71
messages) attributed the rewrite path as: normalize 44%, wireBreakpoints 22%
(and it runs twice per request), a full transcript deep-clone per component 10%.
None of that is component work.

Six changes, each measured on that capture, output verified byte-identical:

  - wireBreakpoints walked the body with seven `#.field` gjson queries, each a
    full re-scan that squashed every matched array. Now one pass over the
    top-level object, with a substring prefilter before any structural parse
    (neither spelling can be a field if "cache" is not even in the bytes), and
    the post-rewrite cap re-count only when something actually changed — an
    untouched body still carries exactly the inbound count.
  - The pipeline deep-cloned the whole transcript per component for its revert
    snapshot. It now keeps ONE snapshot and re-clones only the messages a
    component changed; a revert re-establishes an independent copy, because
    req.Input then aliases the one we were holding. Every snapshot entry is
    still exactly one clone of a live message, so fidelity is unchanged — two
    new tests fail without either half.
  - The lossless round-trip check (two unmarshals into `any` plus a DeepEqual)
    ran for all ~70 messages up front; it only matters for a message a component
    changed, so it is computed on demand.
  - Every normalized message was marshalled twice: once in normalize, once for
    the count-change rebuild path only summarize takes. The rebuild now reads
    slot.pre.
  - normalize called encoding/json.Unmarshal on a type that implements
    json.Unmarshaler, so encoding/json contributed nothing but a checkValid
    re-scan of bytes gjson had already parsed — 40% of the unmarshal cost. It
    calls UnmarshalJSON directly, and fetches each message's `content` once.
  - ContentKey is memoized (like internal/tokens.Count): every offloader asks
    skipReduce about every candidate, so one request normalized and sha256'd the
    same tool output three or four times. Keyed by (len, hash) — a wrong key
    here would mean a wrong stashed original, unlike a stale token count.

Measured, 24 real captured requests, same test code both sides:

  end-to-end        552.6 ms -> 253.3 ms   (-54%)
  one median req     15.6 ms ->   6.9 ms   (-56%), 9554 -> 3232 allocs (-66%)
  per-component duration_ms, pipeline total  1.75 ms -> 1.06 ms  (-39%)
  live /compact through the proxy, 73 requests, median 37.1 -> 19.2 ms
  live LLM calls through the gateway, cg_added_ms_avg 37.1 -> 25.8

Byte-identical output verified over 373 real captured requests (73
Terminal-Bench + 300 SWE-bench) via a golden hash of every rewritten body, with
the hashes recorded on the unmodified code. Fail-open, never-worse and
reversibility are untouched; the #32 replay test still puts breakpoints on the
wire for 72 of 73 requests.

What did NOT help and was reverted: prefiltering normalize's content walk on a
"tool_result" substring (no measurable change — real user messages nearly all
carry one).

Signed-off-by: Osher-Elhadad <[email protected]>
Grafana stores no logs, so something had to. Loki wins on the property that matters
more than any feature comparison: it is read through the Grafana already running on
this box, so a latency spike on the service dashboard is one click from the log
lines for the same tenant and the same minute — one thing to secure, back up and
explain. Its storage model is also the same shape as the Prometheus beside it: a
single binary indexing a handful of labels, chunks on the local filesystem, one more
container. Elasticsearch would search better and wants a JVM and gigabytes of RAM on
a box whose job is serving agent traffic; ClickHouse is a better analytical store
than reading logs is an analytical problem; files and grep — kept as the fallback —
cannot answer "every line for this tenant's session over three days" without a human
and an ssh session, which is the question this exists for.

- `install.sh grafana` now brings up all four containers, loopback only, and installs
  the logrotate snippet. `grafana-status` checks Loki's readiness (not just its port
  — it answers while the ingester still rejects pushes), that the log file exists,
  that lines actually arrived in the last ten minutes, and which tenants Loki has
  seen. That last set of checks exists because a healthy promtail in front of an
  empty log directory renders an empty dashboard with no error anywhere.

- The proxy never talks to Loki. It writes the journal always and CG_LOG_FILE as
  JSON when set; promtail owns delivery and remembers its position. A shipper inside
  the process being debugged loses exactly the logs you need when that process is
  what is going wrong.

- `tenant` and `level` are Loki labels; `session` and `component` deliberately are
  not — a session label would mint one stream per agent conversation and eventually
  take the index down. They are read out of the JSON at query time, which is what
  the dashboard's two text fields do.

- The logs dashboard filters by tenant, session, level and component, and its
  gate table answers "the component did nothing and I cannot tell why" off the same
  Report.Gates map /stats sums.

Single-tenant proxies log tenant="local" rather than an empty string, which promtail
would drop — leaving the selector empty for exactly the people running this locally.

Signed-off-by: Osher-Elhadad <[email protected]>
…econd factor

Registration and sign-in stop being "paste your proxy token". An account is now an
email address, a password, and a 6-digit code we mail to that address.

Registration is two phases: POST /api/register creates the account UNVERIFIED with
no token and no session, and mails a code; POST /api/verify spends it, marks the
address verified, mints the first cg_live_ token and opens the session. Sign-in is
the same shape — POST /api/login checks the password and mails a fresh code, and
only /api/verify sets a cookie. Phase one never issues a session, so knowing a
password is not by itself a signed-in browser. /api/verify infers which flow it is
from the pending code's own purpose rather than from anything the client sends,
so a login code cannot be spent on the branch that mints a token.

Passwords are argon2id (64 MiB, 3 passes, 2 lanes, per-account 16-byte salt) in PHC
string format, so the parameters travel with the hash and can be raised later
without invalidating an existing password. Comparison is constant time, and the
verify runs against a random decoy hash for an unknown address so "no such account"
and "wrong password" cost the same ~50 ms and return the same message.

The 6-digit code is only a factor because of three bounds, all of them here: a
5-minute expiry, a cap of 5 wrong guesses after which the code is DESTROYED rather
than refused, and rate limits of 5 password attempts and 10 code submissions per
minute charged against both the email address and the client address. Issuing a
code REPLACES the pending one — (tenant_id, purpose) is the primary key — so a
resend narrows the valid set instead of widening it.

dash_sessions grows label/user_agent/ip/last_seen_at and gains a derived public
handle, so several machines can be signed in at once and the owner can see and
revoke one of them (GET/DELETE /api/me/sessions). last_seen_at is stamped at most
once a minute per session, so reading the dashboard is not a writer on the control
database.

Mail goes out through stdlib net/smtp, no dependency: STARTTLS whenever the relay
advertises it, and a failed negotiation aborts the send rather than continuing in
the clear. Host, port, from, HELO and any credential are read from the environment
per send. With nothing configured, registration answers 503 naming the missing
variable — a registration whose code went nowhere is worse than one that refuses.
CG_MAIL_DEV_SINK is an explicit, documented escape hatch for a deployment with no
relay.

Self-registration flips to open by default. Both halves of the old reason to keep
it closed are gone: an account no longer spends the operator's key (users forward
their own), and "nobody proves they own the address" — which the old comment named
as the missing control — is exactly what the mailed code now supplies.

Proxy tokens are untouched and remain how agents authenticate to the proxy. An
account that has a password can no longer exchange a token for a browser session;
one that has none still can, because it has nothing else.

Schema v2 is purely additive: every new column has a DEFAULT, so an existing tenant
migrates to "no password, unverified" and keeps working.

Signed-off-by: Osher-Elhadad <[email protected]>
A request row recorded what happened to a request but nothing about what the
request ASKED for, so the levers that explain a cost were invisible: reasoning
effort, thinking budget, sampling parameters, and — the one this project exists
to reason about — where the prompt-cache breakpoints sat.

Capture, normalized across both dialects (Anthropic `output_config.effort` /
`thinking.{type,budget_tokens}` / object `tool_choice` / block `system`; OpenAI
`reasoning_effort` / `max_completion_tokens` / string `tool_choice`), plus the
provider's stop reason off the same response bytes the token tiers come from.

Real columns, not a JSON blob: every field is either GROUPED BY in an aggregate
or shown on the row, so a blob would put json_extract() in the middle of every
aggregate and give free text somewhere to hide from the redactor. The sampling
columns are NULLABLE because "unset" and "0" are different facts and 0 is a
legitimate value — a sentinel would make a deterministic request read as an
unspecified one.

Client-supplied metadata is attacker-influenced input, so each text field passes
through a credential-shape check and an identifier-shape bound BEFORE the insert,
never on read. Unrecognized-but-harmless values survive verbatim: a dashboard
that renders ordinary data as «redacted» lies about its own coverage.

Breakpoints ride on apply.Trace, split by location, from the count the pipeline
already makes to respect the provider's cap of four — so placement costs the
request path nothing. The remaining fields are one structural pass over the
top-level object, measured at 0.55 ms/MB against 2.7 ms/MB for a per-field query
loop, and it never parses `messages`.

/api/breakdown groups requests, tokens and spent-vs-saved by one allowlisted
dimension, so per-model cost, cost by reasoning effort and cost by breakpoint
count are one query rather than three that can drift. Per-day usage bars need no
new query at all: bucketing already happens in SQL, so a day is a parameter.

Schema version 6 — the intended migration for a derived view: the old file is
renamed aside and the non-derived tables carried across.

Signed-off-by: Osher-Elhadad <[email protected]>
…entry

Three things a passing `mkdocs build --strict` did not catch, found by building
in a venv holding only what requirements-docs.txt asks for:

  - Pygments is an *optional* dependency of pymdown-extensions and used to arrive
    via mkdocs-material. Dropping Material silently turned every code block on the
    site into an unhighlighted `<pre><code>`, with no warning and no build failure.
    Declared explicitly, pinned alongside theme/css/pygments.css which is generated
    from its `github-dark` style.
  - The tabbed-block CSS carried a `input:checked + .tabbed-labels > label:first-child`
    rule. The last input is always the element immediately before .tabbed-labels, so
    selecting the final tab of any set also lit up the first tab's label. Every
    selector now pins both the input's index and the label's.
  - Nav: "Agent compaction (Claude Code & Bob)" → "When your agent compacts", to
    match the page's own heading.

Signed-off-by: Osher-Elhadad <[email protected]>
Left behind by the switch from a per-field query loop to the single pass; a
package-level var nothing reads is not a compile error, so nothing caught it.

Signed-off-by: Osher-Elhadad <[email protected]>
…s tenant

logging.Debugging(ctx) is the single guard for "is anyone reading DEBUG", used by
apply's decision loop and extract_llm's candidate accounting instead of each one
reaching for Enabled(). And BodyOpts's panic recovery now logs through the request's
own logger — a panic is the line you most want attributed to a tenant, and it was
going out on the default logger with nothing on it.

Signed-off-by: Osher-Elhadad <[email protected]>
The UI reads all fifteen fields as top-level keys, which holds only while Meta is
embedded anonymously; a json tag on that field would nest them and blank the
request drawer with nothing else failing.

Signed-off-by: Osher-Elhadad <[email protected]>
Signed-off-by: Osher-Elhadad <[email protected]>

# Conflicts:
#	docs/get-started/connect-ibm-service.md
The pipeline snapshots messages before each component so it can revert on
error/panic/never-worse. When the JSON round-trip clone fails, fallbackClone falls
back to bifrost's DeepCopyChatMessage — and per [email protected]/schemas/utils.go its
block copier (deepCopyChatContentBlock, l.803) copies only Type, Text, Refusal,
ImageURLStruct, InputAudio and File. ChatContentBlock also carries three
non-OpenAI fields (chatcompletions.go l.1122-1128): CacheControl, Citations and
CachePoint. All three were silently dropped.

So on that path a revert did not restore the message, it degraded it: a request
that arrived with cache_control on a block came back out without it. That is the
never-worse invariant broken on the least visible path — the one that only runs
after something else already went wrong — and it is not cosmetic here. A dropped
breakpoint is a full cache write instead of a cache read, ~12.5x the price, and
getting breakpoints onto the wire is the entire point of cachesplit/cacheinject.

The clone now restores the three fields after bifrost's copy, cloning the pointer
values (TTL/Scope/Enabled) rather than sharing them, so snapshot and live message
stay independent in both directions. The failure is reachable, not theoretical:
ChatMessageContent.MarshalJSON errors when a message carries both string and block
content, which a component can produce, and that is what the new test builds.

TestFallbackCloneKeepsCacheFields fails on the parent commit ("revert dropped
cache_control: a prompt-cache breakpoint is gone from the wire") and passes here.
Output equivalence unchanged: golden hashes still match over the same 373 real
captured requests (73 Terminal-Bench + 300 SWE-bench), the #32 replay still puts
breakpoints on the wire for 72 of 73, and the latency benchmarks are unmoved
(253 ms over 24 requests, 6.5 ms median request, 3222 allocs) since this path is
off the hot path.

Signed-off-by: Osher-Elhadad <[email protected]>
Union both features. The per-tenant monthly spend cap stays deleted: none of
monthly_cap_usd, MonthlyCapUSD, spendCache or spendgate.go come back, and the
dangling references the cap removal left behind (a Grafana row description, two
comments in proxy/tenancy.go, one in proxy/promexport.go) are cleaned up too.

Migrations: both branches shipped a migration they each called "v2". They are now
two sequential entries — tenant_agent_keys is v2, the accounts/email_codes
migration is v3 — in that order because a database written by a build of this
integration branch is already at v2 with tenant_agent_keys, and reordering would
leave those files never running the accounts step. The schema version is
len(migrations), so it follows automatically. Covered by two new tests: a fresh
database has every table and column from both branches, and every migration also
applies in sequence to a database that stopped at v1 or v2.

Register keeps its (*Tenant, string, error) signature and email-auth's split into
newTenant + insertTenant, so the token-first flow and RegisterAccount share one
list of defaults. insertTenant writes password_hash and email_verified_at but not
monthly_cap_usd, and returns error.

tenantCols and scanTenant gain the account columns LAST, in the same order, with
no cap column between capture_content and max_rows.

The package doc comment states both properties: the tenant token is minted by us,
the provider key belongs to the caller and is never stored, so every secret in
this database is a derived digest — sha256 of a token, of a session cookie, of an
agent's provider key, argon2id of a dashboard password, sha256 of a 5-minute email
code — and the only value ever displayed is a token's 8-character prefix.

docs/hosted.md documents both: the mail path and the password + mailed-code
sign-in, with no cap and no claim that we hold anyone's provider key. Fixes the
section numbering that shifted when the email-path step was inserted, the two
places that still said there was no mail path and therefore no email
verification, and the dashboard table's token-only registration description.

Also fixes the mojibake the credential-passthrough branch committed into
tenant/tenant.go, where two em-dashes had been round-tripped through latin-1.

Signed-off-by: Osher-Elhadad <[email protected]>
Signed-off-by: Osher-Elhadad <[email protected]>

# Conflicts:
#	proxy/proxy.go
…ssage

The writeback ran sjson.SetBytes over the WHOLE body per changed message. sjson
allocates and copies the entire request for every write, so the cost was O(k * body):
30 rewritten tool outputs on a 600 KB request copied ~18 MB to produce one 600 KB
result. Each write also re-scanned the body with gjson to find its target, and
applyMetaWrites did the same once per metadata key.

Now each changed message's own bytes are edited and all of them are spliced back in
one pass. The output is byte-identical, not merely equivalent JSON, because sjson's
splice is local: appendRawPaths ([email protected]) emits json[:res.Index], recurses into
that subtree's Raw, then appends json[res.Index+len(res.Raw):]. Editing a message and
putting it back at the message's span is therefore the same bytes as editing at
"messages.<i>.<rest>" on the whole body. Everything outside an edited span is copied
verbatim, which is what invariant I1 requires.

Two things make that safe rather than clever:

  - Spans come from the offsets gjson already produced for each message, plus the byte
    shift splitVolatileTail now reports (it rewrites the top-level `system` value, so
    everything after it moves). Re-parsing the messages array to find the spans instead
    was the obvious version and it was SLOWER than what it replaced: measured on the
    median captured request, one array parse is 1.21 ms against 0.44 ms for a whole-body
    sjson write, so it only paid above ~3 rewrites per request. That version was a 13%
    regression; this one has no extra parse, and drops one that rebuildCountChanged was
    already duplicating.
  - gjson documents Index as "zero means index unknown" and it is relative to whatever
    json the Result came from, so no span is trusted on its word: the body's own bytes
    at that span must equal the message's Raw or the splice declines and the original
    request is forwarded. A wrong offset therefore costs a rewrite, never a corrupt
    body.

The shift needs its own test, because captured traffic cannot cover it: Claude Code
orders the body `messages` before `system`, so the split shifts nothing on real
requests, and json.Marshal of a map sorts keys the same way. TestSpliceRewrites-
EveryMessageAtItsOwnSpan builds the body with `system` first and both splits and
rewrites in one request; it fails (fail-open, no rewrite forwarded) with the shift
hard-coded to 0 and with it off by one.

Measured, 24 real captured requests:

  end-to-end        253.6 ms -> 243.5 ms  (-4.0%)
  bytes allocated    167 MB  ->  144.5 MB (-13.4%), allocs unchanged
  one median request  6.61 ms ->   6.60 ms (flat)

Per-component duration_ms is untouched by construction — pipeline.runOne's timer wraps
the component call, and this is all after it, so the -39% stands.

Output verified byte-identical over 1868 real captured requests (73 Terminal-Bench +
1795 SWE-bench) against golden hashes recorded before the change, and the #32 replay
still puts breakpoints on the wire for 72 of 73.

applyMetaWrites now takes the message rather than the body, since metaWrite.path was
already message-relative; bodyIndexOf is gone, splitSlotPath does that job.

Signed-off-by: Osher-Elhadad <[email protected]>
Both sides rewrote the breakpoint counter for different reasons, and both
reasons stand. Reconciled to ONE implementation: the perf branch's single
structural walk (ParseBytes().ForEach + mayHold/elemMarks), accumulating into
the metadata branch's location-split Breakpoints instead of one int.

The split is what feeds the four dashboard columns; the single pass is what
takes the counter off ~22% of the rewrite path. Neither needed the other's
implementation — the walk already knows which top-level key it is under, so
the location comes out free, where the 7-path form had to derive it from the
query string. wireBreakpoints stays as the one-line Total() wrapper the cap
check calls.

Kept from fix/clone-and-writeback: the conditional re-count (an untouched
body carries exactly the inbound count, so n > inbound is false by
construction), the duplicate normPre marshal loop's removal (slot.pre already
holds it), and the spliceMessages writeback with its fail-open span check.

Kept from the observability work: every DEBUG line behind its `debug` guard,
dumpToolOutputs, and the cap-breach ERROR — now on the session-bearing
context logger, which is why it no longer repeats "session" as an attribute.

sort.Ints was the only caller of "sort"; slices was already imported for
formatGates, so spliceMessages uses slices.Sorted(maps.Keys(edits)).

Verified: gofmt/vet clean, go test -race green. Byte-identity goldens
reproduce on 373 captured requests (73 terminal-bench + a 300-request
swebench prefix). The merged counter returns the same per-location numbers as
the 7-path version on 3736 real bodies (every captured request, inbound and
post-pipeline). #32 replay: breakpoints reach the wire on 72 of 73. Per-
component duration_ms unchanged — components/pipeline.go is byte-identical to
the perf branch and Pipeline.Run holds the same cumulative CPU.

Signed-off-by: Osher-Elhadad <[email protected]>
A secret in a log attribute's KEY was emitted verbatim: scrubAttr tested the key
name and then replaced only the value. The key is as untrusted as the value —
ranging over parsed data puts data in the key slot — so a credential-shaped key
now takes the whole attr with it.

The auth-header rule matched to end of LINE. Fail-safe for a log record and
destructive for captured transcript content, which the dashboard shows users: a
minified JSON tool result with an "authorization" field lost every field after
it. The value now stops at a string/field terminator as well as the newline; a
bare 'Authorization: Bearer <token>' line still has nothing to stop at but the
newline, so the log case is unchanged.

dash.RedactHeaders had no production caller — nothing in the capture path records
request headers at all — so the allowlist implied a live protection that did not
exist. Deleted rather than wired up, with the docs corrected to say headers are
never captured; git history holds the allowlist if they ever are.

scrubToken read h.Get, the FIRST value of an auth slot, while copyHeaders
forwards ALL of them: two Authorization headers, provider key then our token,
sent the token upstream. It now checks every value, and decides on a prefix match
rather than the exact length LooksLikeToken requires — a token that lost one
character was not token-shaped, so it was forwarded as a caller credential.
Authentication stays strict; only the scrubbing decision is liberal.

Also names the two credential classes a pattern denylist knowingly misses
(base64-encoded, and prefix-less opaque keys outside a named field), so the next
reader does not add speculative patterns for them.

Signed-off-by: Osher-Elhadad <[email protected]>
Three findings from a security review of the tenant package, each with a test
that fails without the fix.

RegisterAccount treated "email_verified_at = 0" as "nobody owns this address",
but migration v3 added that column with DEFAULT 0, so every account created
before email auth migrates to unverified while being in daily use. An
unauthenticated POST to /api/register with a colleague's address therefore
installed the caller's password on a live account, locking the owner out of the
dashboard (token login refuses an account that has a password) and leaving only
the mailed code in the way of a full takeover. The claim is now gated on the
account never having been usable — no password and no token row at all — and
returns ErrEmailTaken otherwise. The v3 upgrade also stamps every account
holding a live token, in the same step that adds the column, so the existing
accounts are never in the claimable state; the same statement runs again as v4
for databases that already reached v3.

BindAgentKey upserted ON CONFLICT DO UPDATE SET tenant_id, which moved a digest
another tenant had bound to whoever asked for it, unaudited. With
capture_content defaulting on, that redirects the victim's request transcripts
to the thief's dashboard. Binding a digest owned by someone else is now
refused, a transfer has to be an unbind by the owner followed by a rebind, keys
shorter than 20 characters are rejected so low-entropy strings cannot be
claimed, and bind and unbind both write an audit row.

decodeHash accepted any non-zero argon2 parameters, so a poisoned row made
every sign-in attempt against that account a 1 GiB allocation. Parameters above
a small multiple of our own are now treated as a corrupt hash.

Also orders Audit by rowid within a timestamp: one Update writes every changed
field with the same millisecond, which left the order inside a change arbitrary.

Signed-off-by: Osher-Elhadad <[email protected]>
…unset key_env

The tenancy cache is where a tenant's frozen compaction decisions live, and it
evicted on recency alone. Registration is open to a whole /8, so max+1 throwaway
accounts sending one request each evicted every real tenant's state, and each
victim's next turn re-wrote its cached prefix at ~11.5x the read price. Entries
that have seen a second request are now last in line for eviction rather than
pinned — the bound still holds, and evicting one is logged as its own case,
because it means the cap itself is the binding constraint. The front entry is
never the victim, so a newcomer cannot be starved by a full cache of active
tenants.

setKey returned the same nil for 'no key_env, caller pays' and 'key_env named
but unset', so a half-finished config edit fell through to forwarding whatever
the caller sent. In gateway mode that is a PLACEHOLDER — non-empty, so the 'no
credential' check passed it — which published the placeholder to a third party
and returned its 401 for the operator to chase. The second case is now a
sentinel error and a 502 naming the upstream, with the variable name in the log
only. No key_env at all still means caller-pays, unchanged.

Signed-off-by: Osher-Elhadad <[email protected]>
Osher-Elhadad and others added 21 commits August 17, 2026 07:24
…ter tests

The form's own minlength=12 was refusing registration before the server saw it.
Server, form and hint now all say 8; the mailed code, the 5-attempt cap, the
per-email and per-address rate limits and a 64 MiB argon2id hash are what bound
online guessing.

The limiter tests are timed because each attempt they are allowed pays a full
KDF, so on a loaded machine they outlast the one-minute window they exist to
exhaust - which reads as a bypass when it is not.

Signed-off-by: Osher-Elhadad <[email protected]>
…ter tests

The form's own minlength=12 was refusing registration before the server saw it.
Server, form and hint now all say 8; the mailed code, the 5-attempt cap, the
per-email and per-address rate limits and a 64 MiB argon2id hash are what bound
online guessing.

The limiter tests are timed because each attempt they are allowed pays a full
KDF, so on a loaded machine they outlast the one-minute window they exist to
exhaust - which reads as a bypass when it is not.

Signed-off-by: Osher-Elhadad <[email protected]>
Grafana was loopback-only, reachable through an ssh tunnel. Publish it on the
front end at /grafana/ without publishing an admin console to 9.0.0.0/8.

Two doors, and the outer one is ours. nginx auth_request asks the proxy's new
GET /api/authz/grafana before forwarding anything; it answers 204 only for a
manager's cg_dash session and 401/403 otherwise, so Grafana never sees a request
that fails the gate — not even to render its login form, which would otherwise
be a password-guessing target in front of every tenant's spend. The endpoint is
one row in ctlRoutes with the existing ctlManager scope, so it reuses
webPrincipal + IsManager() rather than introducing a second idea of who an
administrator is, inherits the cookie-only rule (a proxy token cannot open the
dashboards), and is covered by TestEveryControlRouteEnforcesItsScope as it
stands. Grafana's own login remains the second door, with anonymous access off.

Grafana needs GF_SERVER_ROOT_URL + GF_SERVER_SERVE_FROM_SUB_PATH to generate
redirects and asset URLs under the sub-path, so the installer sets both; without
them every asset 404s. That moves Grafana's API too, so grafana-status now probes
/grafana/api/health — the bare path answers 301, which curl -sf reports as down.

Two credential findings alongside it:

- The admin password no longer rides the docker run argv, where
  /proc/<pid>/cmdline is world-readable to any local user for the life of the
  call. It goes through --env-file: 0600, root-owned, on the /run tmpfs so it
  never reaches a disk, removed as soon as the container exists.
- 20-local.conf, documented as the home for METRICS_TOKEN, is 0600 instead of
  0644 — including on boxes that already have the file, where only the content is
  left alone, not the mode.

And the finding that installing the nginx config overwrote the live file before
validating it: on a failed nginx -t the old config was already gone while nginx
served the previous one from memory, so nothing looked wrong until the next
reload took the front end down. It now backs up, swaps, tests, and rolls back.

Deploy order: the endpoint only exists once the proxy restarts, and the gate
fails closed until then — a manager sees 401 too. nginx needs no change when it
does.

Signed-off-by: Osher-Elhadad <[email protected]>
A fixed 5ms budget cannot mean the same thing at both ends of this machine's
range. Idle, a fake-upstream request settles near 1-2ms; with the suite
saturating 16 cores its own median was 331ms. The gate was reporting the
machine, failing about one run in three with nothing wrong.

Budget is now max(5ms, 10% of the measured baseline), which catches the ~53ms
regression at any baseline while contention that slows both handlers equally
cannot trip it. The median stays the statistic: the minimum was tried and is
worse, being one unaveraged sample - in one run the paired medians differed by
1.27ms where the paired minima differed by 8.13ms.

Signed-off-by: Osher-Elhadad <[email protected]>
(cherry picked from commit 3aad033)
docs: replace the mkdocs-material theme and rewrite the prose for users
feat(proxy)!: forward the caller's own provider key, and add real account auth
feat(dash): capture request metadata, and give the service real structured logging
perf(apply): the rewrite path was mostly harness, not components
…bbing

fix(security): account takeover, agent-key hijack, and a redaction rule that never matched JSON
feat(dash/ui): redesign the dashboard, and revive a tab that was silently dead
…ontrol-plane

fix(security): enforce the hosted capture refusal, per-tenant billing and quotas, and close CSRF
…h-harness

fix(observe): attribute off-path logs, and rebuild the benchmark harness for caller-pays
…trol

feat: user feedback, and full manager control over accounts
Osher-Elhadad and others added 3 commits August 17, 2026 08:51
main carries #67 as a single SQUASHED commit, so the same changes exist here as
their original commits with no shared ancestry - git reads them as independent
edits to the same lines and reports 68 conflicted files. This branch already
contains all of #67, so main's tree is the duplicate, not ours.

That is only safe because main also had one commit we do NOT have (#65,
fix(summarize)), and it is cherry-picked on top of this merge rather than
resolved into it, so its content is auditable as its own commit instead of
disappearing into a 68-file conflict resolution.
…calls it abandons (#65)

#64 did this for extract_llm and left summarize on a hardcoded
`summarizeCallTimeout = 150 * time.Second`. That 150s was sized against an IDLE
server, and the 10x asymmetry with extract_llm's old 15s hid the fact that it has
the same failure mode: on a loaded self-hosted backend the deadline can expire
before the model answers, and the operator has no knob and no counter to see it.

Two things make summarize's budget the harder of the two to size, and they ADD:

- queue wait, which is what a loaded server actually charges: p50 17.2s / p95
  78.8s measured under KV-cache pressure, before the model starts work at all;
- this component's own prefill, which is large by construction. Measured over one
  50-task SWE-bench arm: 78,155,276 input tokens across 1,372 calls, i.e. ~57k
  prompt tokens per call, because it summarizes the whole middle of the
  transcript. The same arm spent 26,890,609 ms on those calls — a 19.6s mean, so
  the idle-server figure measured only the third of those three terms.

So:

- CONTEXT_GURU_SUMMARIZE_TIMEOUT (Go duration; bare integers are seconds) now
  sets the budget, defaulting to 300s. It is deliberately SEPARATE from
  CONTEXT_GURU_LLM_TIMEOUT: the two components send requests that differ in size
  by ~20x, so a single ceiling is either generous for one or tight for the other.
- summarize_timeouts / summarize_errors / summarize_call_timeout_ms are served at
  /stats, merged by the host with the same layering as the LLM* and Frozen*
  counters, and registered in the /stats golden contract.
- The timeout is distinguished from a transport error. summarize's fail path is
  louder than extract_llm's — it returns the error and the pipeline reverts the
  component, which shows up as a per-component `reverted` count — but `reverted`
  cannot say WHY, and the two causes call for opposite responses: a blown deadline
  means the budget is too small for this load (savings are an undercount), while a
  model error means the compaction route is broken (the arm is not measuring
  summarization at all).
- The retry loop now stops once the shared deadline has expired. The ctx is built
  by the caller, OUTSIDE the loop, so all three attempts share one deadline: past
  it, each retry failed instantly and only obscured the cause. This also documents
  that the worst case is one budget, not three.

The env parsing is extracted to resolveTimeoutEnv and shared with extract_llm
rather than duplicated. A value accepted by one component and silently ignored by
the other would be invisible in a run and would look like the component not
firing.

Fail-open behaviour is unchanged throughout: a summarize that cannot summarize
must leave the request valid. What changes is that a loaded server gets time to
answer, and that giving up is now countable.

Tested: a slow model that always exhausts the deadline is counted as a timeout and
not as an error, and the message list is left intact on the error path (summarize
is the one component that changes the message COUNT, so a partial rebuild would
hand the caller a transcript with no summary in it). Plus a table test for the
shared parser: bare integers, Go durations, and fallback on zero/negative/garbage.

Assisted-By: Claude Opus 5 (1M context) <[email protected]>

Signed-off-by: Itay-Nakash <[email protected]>
(cherry picked from commit 54a8738)
#65 moved the per-call budget out of this file into common.go, so its os import
had no remaining use once that change was cherry-picked on top of this branch.
Neither side was wrong alone: main compiled without our code, and this branch
compiled without #65.

Signed-off-by: Osher-Elhadad <[email protected]>
@OsherElhadad
OsherElhadad merged commit 7598578 into main Aug 17, 2026
4 of 5 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants