Skip to content

fix(cost): read usage only from scan-owned transcripts - #830

Open
msapelov wants to merge 8 commits into
openai:mdangelo/codex/dashboard-performancefrom
msapelov:fix/scan-tracker-memory
Open

msapelov wants to merge 8 commits into
openai:mdangelo/codex/dashboard-performancefrom
msapelov:fix/scan-tracker-memory

Conversation

@msapelov

@msapelov msapelov commented Sep 8, 2026 •

Copy link
Copy Markdown

Summary

The live usage tracker reads unrelated session transcripts before deciding whether they belong to the current scan. Index session ownership first and replay only the parent and its discovered workers. Preserve partial-usage diagnostics for malformed token events.

Changes

  • Read unrelated sessions only until their metadata identifies them, retaining incremental handling of partial metadata and delayed worker association.
  • Keep indexed state until an initial replay succeeds so a transient read failure does not lose early usage or events. Replay newly associated workers from the start; allocate progress queues only when an observer consumes them and store compact identities for prose deduplication.
  • Treat explicit null token measurements as unmeasured updates while keeping missing or malformed measurements visible as partial coverage.

Testing

  • An actual filesystem-read probe on the parent read the full unrelated 256 KiB transcript; the regression now reads only metadata and does not reopen it.
  • Complete cost suite: 79 passed, 215 assertions (seed 12345). The remaining four affected SDK suites passed in the focused run.
  • Python saved-usage suite: 21 passed, two skipped. Valid, null, malformed, and missing token measurements were checked through actual scan completion.
  • Types, formatting, build:ci, plugin bundle build, Ruff lint/format, portable source checks and nine compatibility tests passed.
  • Full SDK runs passed with seeds 12345 and 84248915: 3603 passed, 53 platform skips, 70249 assertions each.
  • Three independent native reviews and fresh verification passed.

Risk and rollout

Depends on #1276 and preserves that PR's usage callbacks and dashboard rendering. Directory enumeration continues; this change makes no constant-memory or timing guarantee. Existing polling intervals, prices, spending limits, and CLI syntax remain unchanged. Fixtures use synthetic local sessions.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Sep 8, 2026
sylvesterkaczmarek and others added 7 commits October 5, 2026 01:08
* fix(server): cancel failed embedding response bodies

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>

* test(server): reuse embedding fixtures for response cleanup

---------

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Co-authored-by: Michael D'Angelo <mdangelo@openai.com>
…enai#1236)

Recognize PHP heredoc and nowdoc closing identifiers inside expressions while preserving following code and PHP identifier-continuation semantics.

Add regression coverage for quoting, indentation, comma continuations, same-line braces, and identifier prefixes.
…kslashes (openai#1235)

Handle Go backtick strings through the existing raw-string terminator so literal trailing backslashes do not hide later declarations from ranking previews.

Add a regression test covering declarations before and after the raw string.
# Conflicts:
#	sdk/typescript/src/cost.ts
#	sdk/typescript/tests-ts/cost.test.ts
@mldangelo-oai mldangelo-oai changed the title fix(sdk): prevent transcript memory leaks in scan tracking fix(sdk): read usage only from scan-owned transcripts Oct 5, 2026
@mldangelo-oai
mldangelo-oai changed the base branch from main to mdangelo/codex/dashboard-performance October 5, 2026 14:40
@mldangelo-oai mldangelo-oai changed the title fix(sdk): read usage only from scan-owned transcripts fix(cost): read usage only from scan-owned transcripts Oct 8, 2026
@mldangelo-oai mldangelo-oai added area:cost Token usage, cost estimates, spending limits, and quota visibility. and removed area:cost Token usage, cost estimates, spending limits, and quota visibility. labels Oct 8, 2026

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants