Skip to content

fix: context telemetry ON by default + counter for proved-but-unregistered intents - #499

Merged
BaaRai merged 4 commits into
BaaRai:mainfrom
NikolayGusev-astra:fix/telemetry-on-and-registration-gap
Nov 23, 2026
Merged

BaaRai merged 4 commits into
BaaRai:mainfrom
NikolayGusev-astra:fix/telemetry-on-and-registration-gap

Conversation

@NikolayGusev-astra

Copy link
Copy Markdown

Two platform defects that were measurable all along and unmeasured.

1. Context telemetry was off, so context size was a guess

llm_context holds the per-call context breakdown (system / tools / tool_result / assistant /
user) and was empty on a stand that had already run 15 tasks — the flag was opt-in and off.
Everything said about "context bloat" came from per-task token sums instead of the per-call
composition. Now ON by default; only an explicit falsy value turns it off.

2. «Proved but did not register» had no counter

On the same run record, 3 runs out of 12 had every fact-producing intent register nothing
(3/3, 3/3, 2/2); one run burned 130 shell calls in 35 minutes and registered zero findings.
Facts carry no "this is a defect" flag, so the planner is the only place a fact can become a
finding — and it had nothing telling it that a finished intent yielded facts and nothing else.

db.FactOnlyIntents returns intents with a fact edge and no finding edge; the planner's
situational block carries them with an explicit rule (register, or say why it is not a defect).
The block is code-owned, so it survives a seeded agent_prompts template.

Verification

  • go test ./agent/ ./db/ ./llmrec/ green; both new tests were written RED first.
  • limit-scan.py --fail-on commented exits 0 on the touched files.
  • Both numbers added carry their cause in a comment (default cap 10, summary cap 140).

Stacked on #470 (branch created on top of it; the diff shows #470 too until that merges).

Николай Гусев added 2 commits November 23, 2026 17:22
The llm_context table carries the per-call context breakdown (system, tools,
tool_result, assistant) but was EMPTY on a stand that had already run 15 tasks:
the flag was opt-in and off. Context size was therefore discussed from per-task
token sums, and any fix to it was a guess.

limits: telemetry row 1 per model call - byte counting only, no content kept;
наблюдаемо до ~300 вызовов на прогон, то есть до ~300 строк
limits: disable via explicit falsy value only (0|false|off|no) - the point of the
change is that an unset env means ON

Tests: default-on and explicit-off are both asserted (RED first: the old test
asserted the opposite default).
…o finding

«Доказал — не зарегистрировал» was measurable all along and nobody measured it:
on the 2026-11-22 run record, 3 runs out of 12 had EVERY fact-producing intent
register nothing (3/3, 3/3, 2/2 intents) — task 8 burned 130 Bash calls in 35
minutes and registered zero findings. Facts carry no "this is a defect" flag, so
the planner is the only place that can turn a fact into a finding; it had no
counter telling it that a finished intent yielded facts and nothing else.

db: FactOnlyIntents(limit) — intents with >=1 fact edge and no finding edge.
agent: the situational block now carries them with the rule (register or say why
not), so the nudge survives seeded agent_prompts (the block is code-owned, not a
template).

limits: FactOnlyIntents limit default 10 - a planner round acts on a handful, the
counter is a nudge and not an inventory
limits: summary truncation 140 chars - one-sentence intent summaries; full text
stays one node_detail away, and the block must not become a second context source

Tests RED first: db test asserts the fact-without-finding intent is picked and the
fact+findings one is not; agent test asserts the block reaches the situational
prompt and does not appear for an empty lookup.
FactOnlyIntents now returns only terminal intents (done, blocked, exhausted,
stopped), so an open, running or deleted intent is no longer reported as
finished. The summaries go into the planner block inside env.wrap, and the
telemetry docs, the llmrec comment and the db comment match the on-by-default
flag with 0|false|off|no to disable it.

@BaaRai BaaRai left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for turning telemetry on by default and for the counter.

I merged main into your branch, which brings the atomic threshold from #470 and the dependency bump, then pushed deba1d1: FactOnlyIntents now returns only terminal intents (done, blocked, exhausted, stopped), so an open, running or deleted intent is no longer reported as finished. The summaries go into the planner block inside env.wrap, and the telemetry docs, the llmrec comment and the db comment match the on-by-default flag with 0|false|off|no to disable it. Tests cover the terminal states and the envelope.

Merging once CI is green.

@BaaRai
BaaRai merged commit e17ab07 into BaaRai:main Nov 23, 2026
6 checks passed
@BaaRai

BaaRai commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Merged. Thanks for turning the context telemetry on by default and for the fact-only counter: the state filter, the envelope around the summaries and the docs match the new default now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants