[GH-ISSUE #1209] [Feature]: Make Long-Term Memory extraction debug reporting trustworthy #620

Closed
opened 2026-10-20 17:29:06 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1209

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Extraction/LLM debug events can misreport token accounting and bury the failures users need.

Findings from a read-only pass at 324446533:

  • evidence_unit_response uses result.usage?.promptTokens ?? 0 (and the same pattern for completion/reasoning/total). When a provider omits usage, the summary shows a measured zero that can replace the earlier estimated prompt tokens from evidence_unit_request.
  • summarizeCounts in ActivityView.tsx prefers promptTokens over inputTokens unconditionally, so a zero can override a real estimate.
  • The collapsed operation is titled from the first event action (for example extract_source_note), burying evidence_unit_response, finishReason, truncation, and context-budget failures.
  • responseSnippet, finishReason, and evidence_unit_context_preflight failures are already recorded but require expanding many events to find.

Proposed package or change

  • Distinguish estimated tokens from provider-reported tokens, and omit unavailable measurements instead of displaying them as zero.
  • Give the collapsed operation a meaningful workflow title, model, duration, and the principal failure or warning.
  • Keep response snippets, stacks, IDs, and full diagnostics under Technical details.
  • Surface existing truncation and context-budget status without expanding the default view.

No new providers or event fields are required beyond clearly marking estimated vs provider-reported usage.

Why should this be optional?

This is package-owned diagnostics for a downloadable Agent package (long-term-memory). It ships with the package and should not become Engine core behavior.

Alternatives considered

Adding a separate token-accounting subsystem was rejected; the existing events and summarizeCounts are enough once estimated and reported values are distinguished.

Additional context

Owner files: ActivityView.tsx, evidence-unit-extraction.ts. Existing coverage: tests/long-term-memory-debug-log.regression.ts, tests/long-term-memory-routes.regression.ts, tests/long-term-memory-feedback-clarity-ui.regression.mjs. Evidence from a read-only investigation at 324446533; no code changed yet.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1209 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Extraction/LLM debug events can misreport token accounting and bury the failures users need. Findings from a read-only pass at `324446533`: - `evidence_unit_response` uses `result.usage?.promptTokens ?? 0` (and the same pattern for completion/reasoning/total). When a provider omits usage, the summary shows a measured zero that can replace the earlier estimated prompt tokens from `evidence_unit_request`. - `summarizeCounts` in `ActivityView.tsx` prefers `promptTokens` over `inputTokens` unconditionally, so a zero can override a real estimate. - The collapsed operation is titled from the first event action (for example `extract_source_note`), burying `evidence_unit_response`, `finishReason`, truncation, and context-budget failures. - `responseSnippet`, `finishReason`, and `evidence_unit_context_preflight` failures are already recorded but require expanding many events to find. ## Proposed package or change - Distinguish estimated tokens from provider-reported tokens, and omit unavailable measurements instead of displaying them as zero. - Give the collapsed operation a meaningful workflow title, model, duration, and the principal failure or warning. - Keep response snippets, stacks, IDs, and full diagnostics under Technical details. - Surface existing truncation and context-budget status without expanding the default view. No new providers or event fields are required beyond clearly marking estimated vs provider-reported usage. ## Why should this be optional? This is package-owned diagnostics for a downloadable Agent package (`long-term-memory`). It ships with the package and should not become Engine core behavior. ## Alternatives considered Adding a separate token-accounting subsystem was rejected; the existing events and `summarizeCounts` are enough once estimated and reported values are distinguished. ## Additional context Owner files: `ActivityView.tsx`, `evidence-unit-extraction.ts`. Existing coverage: `tests/long-term-memory-debug-log.regression.ts`, `tests/long-term-memory-routes.regression.ts`, `tests/long-term-memory-feedback-clarity-ui.regression.mjs`. Evidence from a read-only investigation at `324446533`; no code changed yet. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:29:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#620
No description provided.