Skip to content

Emit no model for a run that never executed the script body - #30

Merged
alaa-eddine merged 1 commit into
mainfrom
fix/empty-run-fabricated-model
Aug 30, 2026
Merged

alaa-eddine merged 1 commit into
mainfrom
fix/empty-run-fabricated-model

Conversation

@alexgrover

@alexgrover alexgrover commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A run over zero bars (empty initial load: auth race, unresolved symbol, transient feed failure) never executes the script body — including the indicator(...)/strategy(...) call — yet pineCtxToModel still mapped it, fabricating default metadata (title: Indicator, overlay: false). Hosts finalized pane routing and the legend title off that fabricated model, permanently stranding an overlay = true indicator in an empty sub pane titled Indicator (the classic workspace-restore race).
  • Such a run now emits nothing at all: runPineStatic returns a null model when the run context carries no executed declaration (new declarationExecuted helper), and the live stream skips such ticks. The session re-runs when bars arrive, and that first real model carries the executed declaration. The rule lives in the shared runtime, so PineEngine and PineWorkerEngine behave identically; the worker still acks done so run bookkeeping balances.

Companion PR

This is the root-cause half of a two-layer fix. LuxAlgo/Vela#105 adds the engine-agnostic orchestrator guard: an output-free model arriving while the chart still has no bars is deferred instead of finalizing pane routing, so no engine can strand an indicator this way. Either PR alone fixes the user-visible symptom for Pine; together each layer covers the other.

Tests

  • New test/empty-run-suppression.test.ts: overlay + non-overlay empty-then-bars runs through PineEngine (static and live stream) and through the real worker module driven over its message protocol; regression pins that an executed run keeps runtime-authoritative metadata (variable overlay= arg); declarationExecuted shape cases; plus an end-to-end test through the built Vela + real PineEngine: placeholder stays on the price pane with the declared title while loading, recovers when data arrives. 6 of the new tests fail without the fix.
  • Full gate green: typecheck / lint / 194 tests / build.

A run over zero bars (empty initial load: auth race, unresolved symbol,
transient feed failure) never executes the declaration, so the mapped
model fabricated defaults - title Indicator, overlay false - and the
host finalized pane routing off them, stranding an overlay indicator in
an empty sub pane. Such a run now emits nothing at all, from the static
path and the live stream alike; the session re-runs when bars arrive
and the first real model carries the executed declaration. Both engines
share the rule through the runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_0dbf5f9b-4ab4-48d8-996c-e7e7092605c8)

@alaa-eddine
alaa-eddine merged commit acb7824 into main Aug 30, 2026
1 check passed
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