Repository navigation
Conversation
A trace segment outlives the version that wrote it: the store keeps a record whose t cannot be proved older than the retention window, and window.js skips it with !Number.isFinite(record.t). spansFrom did not, so one such record made nanos throw BigInt(NaN) and the whole timeline/export failed. Docs-not-needed: the OTLP mapping gains the input guard its sibling reader already has; no owned surface or contract changes.
|
Written-by: Delivery-2 @Birfy review request for this exact tip: Red-first on a clean base plus the gates are in the PR body; Please review |
|
Closing: our account has no write access to Owner: Delivery-2 |
Written-by: Delivery-2
Fixes #2442
Owner: Delivery-2
Tip SHA:
108ddf810f35190feda2b770188d6acada1f524aBranch: delivery2/timeline-export-untimed-records
What changes
spansFrom(plugins/timeline/src/otel.js) now skips a record whosetis not a finite number, the rulefoldinplugins/timeline/src/window.js:63already keeps for the same trace file. The skip lives in the one loop that indexests/te/ks/ke, next to the guard the message records already had, so a turn or tool span is built only from records that carry a usable time.Why
A trace segment outlives the version that wrote it.
Trace.records()(plugins/timeline/src/store.js:173) keeps every record whosetcannot be proved older than the retention window —!(record.t < floor)is true for a missing or non-numerict— andtimeline/exportfeeds those records straight intospansFrom(plugins/timeline/src/timeline.js:56).nanosthen didBigInt(Math.round(undefined)), so one stale record threwRangeError: The number NaN cannot be converted to a BigInt because it is not an integerout of the endpoint and the whole export failed, including the complete turns beside it. The panel view of the same records never had that failure becausewindow.jschecksNumber.isFinite(record.t)first.Tests
plugins/timeline/test/otel-untimed-records.test.js, red first on the base5e71a07ebefore the one-line guard was added:not ok 1 - a turn or tool record with no usable time is skipped, never converted to a span—error: 'The number NaN cannot be converted to a BigInt because it is not an integer'not ok 2 - timeline/export still answers OTLP JSON when the trace holds an untimed record— same error, raised out oftimeline.exportWindow()over a trace holding one untimed turn and one complete turn# tests 2 / # pass 0 / # fail 2# tests 2 / # pass 2 / # fail 0Full timeline suite at the tip:
# tests 137 / # pass 137 / # fail 0(base 135; this branch adds 2).Gates at the tip
plugins/timelinesuite: 137/137 pass, 0 fail (command:cd plugins/timeline && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js")ARCH_DOCS_BASE=upstream/delivery/ai-centric-development-service:Found 105 warnings and 0 errors.+arch-docs: OK (3 changed file(s))node scripts/lint-plugins.mjs,npm_config_cache=$PWD/.work/npm-cache): social 36, timeline 9, tree 2, workflow 16 warnings, 0 errors; everypack-importrannode core/scripts/build-client.mjs --check: exit 0node scripts/ds-bot-patches.mjs check:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70,ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/node .github/scripts/changelog.mjs check:changelog: 80 fragment(s) in changelog.d/ are well formedNot run:
node scripts/build-workbench.mjs --checkfails on this box withERR_MODULE_NOT_FOUND: Cannot find package 'react'(a box dependency, unrelated to this branch), andnpm run verifystops at core lint'sarch-docsstep becauseorigin/maindoes not exist in this clone, which is why each gate above was run on its own.Docs-not-needed: the OTLP mapping gains the input guard its sibling reader already has; no owned surface or contract changes.
changelog.d/2442-timeline-export-untimed-records.fixed.md
Files
plugins/timeline/src/otel.js(+6 −1)plugins/timeline/test/otel-untimed-records.test.js(+48)changelog.d/2442-timeline-export-untimed-records.fixed.md(+1)Checkpoint
{
"pr": 2444, "claim": "Delivery-2", "issue": 2442,
"summary": "The OTLP mapping now skips a trace record whose
tis not a finite number, the rule the timeline window already keeps for the same file. Without itnanosbuiltBigInt(NaN)and one stale or hand-edited record threw a RangeError out oftimeline/export, losing every complete turn beside it. The guard sits in the loop that indexes turn and tool records, next to the one the message records already had.","files": ["plugins/timeline/src/otel.js", "plugins/timeline/test/otel-untimed-records.test.js", "changelog.d/2442-timeline-export-untimed-records.fixed.md"],
"checks": { "ran": "cd plugins/timeline && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js"; node scripts/lint-plugins.mjs; node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check; node .github/scripts/changelog.mjs check", "result": "green", "at": "108ddf810f35190feda2b770188d6acada1f524a" },
"next": "none — ready for review"
}