Skip to content

An empty first run no longer strands an indicator off its prepared pane - #105

Merged
alaa-eddine merged 2 commits into
devfrom
fix/empty-first-run-pane-stranding
Aug 30, 2026
Merged

alaa-eddine merged 2 commits into
devfrom
fix/empty-first-run-pane-stranding

Conversation

@alexgrover

@alexgrover alexgrover commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Bug: an indicator added while the chart''s initial bar load resolved empty (auth race, unresolved symbol, transient feed failure — typically a host restoring a saved workspace) had its first, output-free model treated as real output: applyModel consumed the one-shot pane re-route off fabricated metadata (overlay: false, generic Indicator title), cleared loading, and the indicator stayed stranded in an empty sub pane even after bars arrived (the later real model only value-patched — no title, no pane, unmounted series ids).
  • Fix: while record.loading and the chart itself has zero bars, a model carrying no output of any kind (series, drawings, bar colors, trades) is deferred — placeholder, pane, spinner, and the pending run-cause all stay untouched; the first real model still routes through the existing self-heal. The bars condition keeps the guard narrow: loading ends when a run completes, not when it produces output — a script that runs over real bars and plots nothing (alerts only) clears its spinner and announces exactly as before.

Companion PR

Root cause lives in the engine: LuxAlgo/Vela-pinets#30 stops the PineTS engines from fabricating a model for a run that never executed the script body. This orchestrator guard is the second, engine-agnostic layer — any ScriptingEngine emitting an empty model over a bar-less chart is handled, and either PR alone fixes the user-visible symptom for Pine.

Tests

Four new orchestrator tests (stub engines, no PineTS dependency): the stranding scenario (placeholder kept, nothing announced, real model lands normally), the self-heal regression (a real first model that disagrees with the prepare-time guess still re-routes), spinner semantics (an output-free run over real bars completes the load), and the late-bars end-to-end (feed loads 0 bars, live push re-runs the session, final state is price pane / declared title / plots). The stranding, spinner, and end-to-end tests fail without the fix. Full gate green: typecheck / lint / 1442 tests / build; workspace oracle suites re-run green (vela 23/23, vela-pro 11/11).


Note

Medium Risk
Changes indicator mount and event timing on a core orchestrator path, but the guard is narrowly scoped (loading + zero bars + no output) and covered by new regression tests.

Overview
Fixes indicators that were added while the chart’s initial bar load was still empty (saved layout restore, auth race, slow feed). An output-free first model used to be treated as real script output, which re-routed the pane off prepare-time metadata, cleared loading, and left a generic empty sub pane even after data arrived.

EngineOrchestrator.applyModel now returns a boolean and defers models that have no series, drawings, bar colors, trades, etc. when the indicator is still loading and this.bars.length === 0. The placeholder pane, spinner, and pendingCause stay put; onModel skips indicator:added / script-run events until a real apply. The first model with real output still uses the existing one-shot pane self-heal. Loading still ends when a run completes over real bars, not when output exists (alerts-only scripts unchanged).

Changelog updated; four orchestrator tests cover stranding, self-heal regression, alerts-only completion, and empty-then-live feed end-to-end.

Reviewed by Cursor Bugbot for commit d6d2a8a. Bugbot is set up for automated code reviews on this repo. Configure here.

While a chart still has no bars, an engine run cannot have executed the
script, so a model carrying no output is deferred instead of applied: the
prepared placeholder keeps its pane, title, and loading spinner, and the
one-shot pane re-route stays available for the first real model. Loading
still ends with the run, not with output - a script that runs over real
bars and plots nothing clears its spinner and announces as before.

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_d7d82dbd-08fe-4862-8515-a04cee61a553)

@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@alexgrover

Copy link
Copy Markdown
Member Author

I have read the CLA Document and I hereby sign the CLA

@alaa-eddine
alaa-eddine merged commit cf61ab3 into dev Aug 30, 2026
1 check passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants